From 085e1b1b6d1823d6866f5be2ecc2125ec491adde Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Thu, 2 Jan 2025 05:26:36 +0300 Subject: [PATCH] #336: Codebase migrated to es module system --- .gitignore | 2 +- CHANGELOG.md | 7 +- .../{addFixVersion.ts => addFixVersion.mts} | 0 .../src/{addWorklog.ts => addWorklog.mts} | 0 examples/src/{basic.ts => basic.mts} | 0 .../src/{credentials.ts => credentials.mts} | 0 .../{getAllWorklogs.ts => getAllWorklogs.mts} | 0 .../utils/{addWorklog.ts => addWorklog.mts} | 0 .../utils/{createIssue.ts => createIssue.mts} | 0 examples/src/utils/{index.ts => index.mts} | 0 package-lock.json | 898 ++++++++++++- package.json | 28 +- rollup.config.ts | 37 + src/agile/backlog.mts | 73 ++ src/agile/backlog.ts | 73 -- src/agile/board.mts | 872 +++++++++++++ src/agile/board.ts | 872 ------------- src/agile/builds.mts | 190 +++ src/agile/builds.ts | 190 --- src/agile/client/agileClient.mts | 30 + src/agile/client/agileClient.ts | 32 - src/agile/client/index.ts | 1 - src/agile/deployments.mts | 231 ++++ src/agile/deployments.ts | 231 ---- src/agile/developmentInformation.mts | 189 +++ src/agile/developmentInformation.ts | 189 --- src/agile/devopsComponents.mts | 189 +++ src/agile/devopsComponents.ts | 189 --- src/agile/epic.mts | 232 ++++ src/agile/epic.ts | 232 ---- src/agile/featureFlags.mts | 193 +++ src/agile/featureFlags.ts | 193 --- src/agile/index.mts | 17 + src/agile/index.ts | 17 - src/agile/issue.mts | 160 +++ src/agile/issue.ts | 160 --- .../models/{avatarUrls.ts => avatarUrls.mts} | 0 src/agile/models/board.mts | 52 + src/agile/models/board.ts | 52 - src/agile/models/createBoard.mts | 52 + src/agile/models/createBoard.ts | 52 - src/agile/models/{epic.ts => epic.mts} | 0 ...ByProperties.ts => existsByProperties.mts} | 0 src/agile/models/fields.mts | 85 ++ src/agile/models/fields.ts | 85 -- .../models/{fixVersion.ts => fixVersion.mts} | 0 src/agile/models/getAllBoards.mts | 9 + src/agile/models/getAllBoards.ts | 9 - ...QuickFilters.ts => getAllQuickFilters.mts} | 0 src/agile/models/getBoard.mts | 52 + src/agile/models/getBoard.ts | 52 - ...rdByFilterId.ts => getBoardByFilterId.mts} | 0 .../{getBuildByKey.ts => getBuildByKey.mts} | 0 ...tComponentById.ts => getComponentById.mts} | 0 ...tConfiguration.ts => getConfiguration.mts} | 0 ...loymentByKey.ts => getDeploymentByKey.mts} | 0 ....ts => getDeploymentGatingStatusByKey.mts} | 0 ...tureFlagById.ts => getFeatureFlagById.mts} | 0 ...resForBoard.ts => getFeaturesForBoard.mts} | 0 ...getIncidentById.ts => getIncidentById.mts} | 0 ...paceById.ts => getLinkedWorkspaceById.mts} | 0 ...dWorkspaces.ts => getLinkedWorkspaces.mts} | 0 .../{getQuickFilter.ts => getQuickFilter.mts} | 0 ...emoteLinkById.ts => getRemoteLinkById.mts} | 0 ...ortsForBoard.ts => getReportsForBoard.mts} | 0 .../{getRepository.ts => getRepository.mts} | 0 .../{getReviewById.ts => getReviewById.mts} | 0 ...bilityById.ts => getVulnerabilityById.mts} | 0 .../{getWorkspaces.ts => getWorkspaces.mts} | 0 src/agile/models/{group.ts => group.mts} | 0 src/agile/models/index.mts | 58 + src/agile/models/index.ts | 58 - src/agile/models/issue.mts | 216 ++++ src/agile/models/issue.ts | 216 ---- src/agile/models/issueTransition.mts | 58 + src/agile/models/issueTransition.ts | 58 - .../models/{issueType.ts => issueType.mts} | 0 .../models/{jsonType.ts => jsonType.mts} | 0 .../models/{linkGroup.ts => linkGroup.mts} | 0 ...eIds.ts => linkedSecurityWorkspaceIds.mts} | 0 ...linkedWorkspace.ts => linkedWorkspace.mts} | 0 src/agile/models/operations.mts | 7 + src/agile/models/operations.ts | 7 - .../models/{progress.ts => progress.mts} | 0 src/agile/models/project.mts | 33 + src/agile/models/project.ts | 33 - src/agile/models/projects.mts | 21 + src/agile/models/projects.ts | 21 - src/agile/models/scope.mts | 41 + src/agile/models/scope.ts | 41 - src/agile/models/searchResults.mts | 21 + src/agile/models/searchResults.ts | 21 - src/agile/models/{sprint.ts => sprint.mts} | 0 src/agile/models/status.mts | 10 + src/agile/models/status.ts | 10 - .../{statusCategory.ts => statusCategory.mts} | 0 ...ion.ts => storeDevelopmentInformation.mts} | 0 .../{submitBuilds.ts => submitBuilds.mts} | 0 ...bmitComponents.ts => submitComponents.mts} | 0 ...itDeployments.ts => submitDeployments.mts} | 0 .../{submitEntity.ts => submitEntity.mts} | 0 ...FeatureFlags.ts => submitFeatureFlags.mts} | 0 ...aces.ts => submitOperationsWorkspaces.mts} | 0 ...itRemoteLinks.ts => submitRemoteLinks.mts} | 0 ...abilities.ts => submitVulnerabilities.mts} | 0 ....ts => submittedVulnerabilitiesResult.mts} | 0 .../{toggleFeatures.ts => toggleFeatures.mts} | 0 src/agile/models/user.mts | 39 + src/agile/models/user.ts | 39 - src/agile/models/{version.ts => version.mts} | 0 .../{vulnerability.ts => vulnerability.mts} | 0 src/agile/operations.mts | 357 ++++++ src/agile/operations.ts | 357 ------ .../{createBoard.ts => createBoard.mts} | 0 .../{createSprint.ts => createSprint.mts} | 0 .../{deleteBoard.ts => deleteBoard.mts} | 0 ...ardProperty.ts => deleteBoardProperty.mts} | 0 ...leteBuildByKey.ts => deleteBuildByKey.mts} | 0 ...Property.ts => deleteBuildsByProperty.mts} | 0 ...ByProperties.ts => deleteByProperties.mts} | 0 ...mponentById.ts => deleteComponentById.mts} | 0 ...erty.ts => deleteComponentsByProperty.mts} | 0 ...mentByKey.ts => deleteDeploymentByKey.mts} | 0 ...rty.ts => deleteDeploymentsByProperty.mts} | 0 .../{deleteEntity.ts => deleteEntity.mts} | 0 ...Property.ts => deleteEntityByProperty.mts} | 0 ...eFlagById.ts => deleteFeatureFlagById.mts} | 0 ...ty.ts => deleteFeatureFlagsByProperty.mts} | 0 ...IncidentById.ts => deleteIncidentById.mts} | 0 ...rkspaces.ts => deleteLinkedWorkspaces.mts} | 0 .../{deleteProperty.ts => deleteProperty.mts} | 0 ...teLinkById.ts => deleteRemoteLinkById.mts} | 0 ...rty.ts => deleteRemoteLinksByProperty.mts} | 0 ...leteRepository.ts => deleteRepository.mts} | 0 ...leteReviewById.ts => deleteReviewById.mts} | 0 .../{deleteSprint.ts => deleteSprint.mts} | 0 ...ts => deleteVulnerabilitiesByProperty.mts} | 0 ...ityById.ts => deleteVulnerabilityById.mts} | 0 ...leteWorkspaces.ts => deleteWorkspaces.mts} | 0 ...eForBoard.ts => estimateIssueForBoard.mts} | 0 ...ByProperties.ts => existsByProperties.mts} | 0 .../{getAllBoards.ts => getAllBoards.mts} | 0 ...QuickFilters.ts => getAllQuickFilters.mts} | 0 .../{getAllSprints.ts => getAllSprints.mts} | 0 .../{getAllVersions.ts => getAllVersions.mts} | 0 .../parameters/{getBoard.ts => getBoard.mts} | 0 ...rdByFilterId.ts => getBoardByFilterId.mts} | 0 .../parameters/getBoardIssuesForEpic.mts | 28 + src/agile/parameters/getBoardIssuesForEpic.ts | 28 - .../parameters/getBoardIssuesForSprint.mts | 29 + .../parameters/getBoardIssuesForSprint.ts | 29 - ...tBoardProperty.ts => getBoardProperty.mts} | 0 ...opertyKeys.ts => getBoardPropertyKeys.mts} | 0 .../{getBuildByKey.ts => getBuildByKey.mts} | 0 ...tComponentById.ts => getComponentById.mts} | 0 ...tConfiguration.ts => getConfiguration.mts} | 0 ...loymentByKey.ts => getDeploymentByKey.mts} | 0 ....ts => getDeploymentGatingStatusByKey.mts} | 0 .../parameters/{getEpic.ts => getEpic.mts} | 0 .../parameters/{getEpics.ts => getEpics.mts} | 0 ...tureFlagById.ts => getFeatureFlagById.mts} | 0 ...resForBoard.ts => getFeaturesForBoard.mts} | 0 ...getIncidentById.ts => getIncidentById.mts} | 0 .../parameters/{getIssue.ts => getIssue.mts} | 0 ...oard.ts => getIssueEstimationForBoard.mts} | 0 src/agile/parameters/getIssuesForBacklog.mts | 27 + src/agile/parameters/getIssuesForBacklog.ts | 27 - src/agile/parameters/getIssuesForBoard.mts | 27 + src/agile/parameters/getIssuesForBoard.ts | 27 - src/agile/parameters/getIssuesForEpic.mts | 27 + src/agile/parameters/getIssuesForEpic.ts | 27 - src/agile/parameters/getIssuesForSprint.mts | 27 + src/agile/parameters/getIssuesForSprint.ts | 27 - src/agile/parameters/getIssuesWithoutEpic.mts | 24 + src/agile/parameters/getIssuesWithoutEpic.ts | 24 - .../getIssuesWithoutEpicForBoard.mts | 27 + .../getIssuesWithoutEpicForBoard.ts | 27 - ...paceById.ts => getLinkedWorkspaceById.mts} | 0 .../{getProjects.ts => getProjects.mts} | 0 ...getProjectsFull.ts => getProjectsFull.mts} | 0 ...ropertiesKeys.ts => getPropertiesKeys.mts} | 0 .../{getProperty.ts => getProperty.mts} | 0 .../{getQuickFilter.ts => getQuickFilter.mts} | 0 ...emoteLinkById.ts => getRemoteLinkById.mts} | 0 ...ortsForBoard.ts => getReportsForBoard.mts} | 0 .../{getRepository.ts => getRepository.mts} | 0 .../{getReviewById.ts => getReviewById.mts} | 0 .../{getSprint.ts => getSprint.mts} | 0 ...bilityById.ts => getVulnerabilityById.mts} | 0 .../{getWorkspaces.ts => getWorkspaces.mts} | 0 src/agile/parameters/index.mts | 95 ++ src/agile/parameters/index.ts | 95 -- ...esToBacklog.ts => moveIssuesToBacklog.mts} | 0 ...ard.ts => moveIssuesToBacklogForBoard.mts} | 0 ...IssuesToBoard.ts => moveIssuesToBoard.mts} | 0 ...veIssuesToEpic.ts => moveIssuesToEpic.mts} | 0 ...dRank.ts => moveIssuesToSprintAndRank.mts} | 0 ...yUpdateEpic.ts => partiallyUpdateEpic.mts} | 0 ...ateSprint.ts => partiallyUpdateSprint.mts} | 0 .../{rankEpics.ts => rankEpics.mts} | 0 .../{rankIssues.ts => rankIssues.mts} | 0 ...esFromEpic.ts => removeIssuesFromEpic.mts} | 0 .../{searchEpics.ts => searchEpics.mts} | 0 ...tBoardProperty.ts => setBoardProperty.mts} | 0 .../{setProperty.ts => setProperty.mts} | 0 ...ion.ts => storeDevelopmentInformation.mts} | 0 .../{submitBuilds.ts => submitBuilds.mts} | 0 ...bmitComponents.ts => submitComponents.mts} | 0 ...itDeployments.ts => submitDeployments.mts} | 0 .../{submitEntity.ts => submitEntity.mts} | 0 ...FeatureFlags.ts => submitFeatureFlags.mts} | 0 ...aces.ts => submitOperationsWorkspaces.mts} | 0 ...itRemoteLinks.ts => submitRemoteLinks.mts} | 0 ...abilities.ts => submitVulnerabilities.mts} | 0 ...bmitWorkspaces.ts => submitWorkspaces.mts} | 0 .../{swapSprint.ts => swapSprint.mts} | 0 .../{toggleFeatures.ts => toggleFeatures.mts} | 0 .../{updateSprint.ts => updateSprint.mts} | 0 src/agile/remoteLinks.mts | 198 +++ src/agile/remoteLinks.ts | 198 --- src/agile/securityInformation.mts | 322 +++++ src/agile/securityInformation.ts | 322 ----- src/agile/sprint.mts | 357 ++++++ src/agile/sprint.ts | 357 ------ src/callback.mts | 3 + src/callback.ts | 3 - src/clients/baseClient.mts | 165 +++ src/clients/baseClient.ts | 165 --- src/clients/client.mts | 12 + src/clients/client.ts | 12 - .../{httpException.ts => httpException.mts} | 0 src/clients/index.mts | 8 + src/clients/index.ts | 11 - src/config.mts | 75 ++ src/config.ts | 75 -- src/createClient.ts | 31 - src/index.mts | 11 + src/index.ts | 12 - src/{paginated.ts => paginated.mts} | 0 ...paramSerializer.ts => paramSerializer.mts} | 0 src/requestConfig.mts | 3 + src/requestConfig.ts | 3 - src/serviceDesk/client/index.ts | 1 - src/serviceDesk/client/serviceDeskClient.mts | 20 + src/serviceDesk/client/serviceDeskClient.ts | 20 - src/serviceDesk/customer.mts | 46 + src/serviceDesk/customer.ts | 46 - src/serviceDesk/index.mts | 12 + src/serviceDesk/index.ts | 12 - src/serviceDesk/info.mts | 33 + src/serviceDesk/info.ts | 33 - src/serviceDesk/insight.mts | 45 + src/serviceDesk/insight.ts | 45 - src/serviceDesk/knowledgeBase.mts | 46 + src/serviceDesk/knowledgeBase.ts | 46 - ...tionalComment.ts => additionalComment.mts} | 0 src/serviceDesk/models/approval.mts | 22 + src/serviceDesk/models/approval.ts | 22 - ...Request.ts => approvalDecisionRequest.mts} | 0 src/serviceDesk/models/approver.mts | 7 + src/serviceDesk/models/approver.ts | 7 - src/serviceDesk/models/article.mts | 11 + src/serviceDesk/models/article.ts | 11 - src/serviceDesk/models/attachment.mts | 15 + src/serviceDesk/models/attachment.ts | 15 - src/serviceDesk/models/attachmentCreate.mts | 9 + src/serviceDesk/models/attachmentCreate.ts | 9 - .../models/attachmentCreateResult.mts | 7 + .../models/attachmentCreateResult.ts | 7 - .../{attachmentLink.ts => attachmentLink.mts} | 0 .../models/{avatarUrls.ts => avatarUrls.mts} | 0 src/serviceDesk/models/comment.mts | 21 + src/serviceDesk/models/comment.ts | 21 - .../{commentCreate.ts => commentCreate.mts} | 0 .../models/{content.ts => content.mts} | 0 src/serviceDesk/models/csatFeedbackFull.mts | 9 + src/serviceDesk/models/csatFeedbackFull.ts | 9 - .../{customerCreate.ts => customerCreate.mts} | 0 src/serviceDesk/models/customerRequest.mts | 40 + src/serviceDesk/models/customerRequest.ts | 40 - ...estAction.ts => customerRequestAction.mts} | 0 .../models/customerRequestActions.mts | 8 + .../models/customerRequestActions.ts | 8 - .../models/customerRequestCreateMeta.mts | 10 + .../models/customerRequestCreateMeta.ts | 10 - ...Value.ts => customerRequestFieldValue.mts} | 0 ...RequestLink.ts => customerRequestLink.mts} | 0 .../models/customerRequestStatus.mts | 9 + .../models/customerRequestStatus.ts | 9 - ...erTransition.ts => customerTransition.mts} | 0 .../models/customerTransitionExecution.mts | 7 + .../models/customerTransitionExecution.ts | 7 - src/serviceDesk/models/{date.ts => date.mts} | 0 .../models/{duration.ts => duration.mts} | 0 .../{entityProperty.ts => entityProperty.mts} | 0 src/serviceDesk/models/index.mts | 79 ++ src/serviceDesk/models/index.ts | 79 -- ...sightWorkspace.ts => insightWorkspace.mts} | 0 src/serviceDesk/models/issue.mts | 4 + src/serviceDesk/models/issue.ts | 4 - src/serviceDesk/models/issueTransition.mts | 28 + src/serviceDesk/models/issueTransition.ts | 28 - .../models/{jsonType.ts => jsonType.mts} | 0 src/serviceDesk/models/organization.mts | 9 + src/serviceDesk/models/organization.ts | 9 - ...zationCreate.ts => organizationCreate.mts} | 0 ...e.ts => organizationServiceDeskUpdate.mts} | 0 src/serviceDesk/models/pagedApproval.mts | 17 + src/serviceDesk/models/pagedApproval.ts | 17 - src/serviceDesk/models/pagedArticle.mts | 17 + src/serviceDesk/models/pagedArticle.ts | 17 - src/serviceDesk/models/pagedAttachment.mts | 17 + src/serviceDesk/models/pagedAttachment.ts | 17 - src/serviceDesk/models/pagedComment.mts | 17 + src/serviceDesk/models/pagedComment.ts | 17 - .../models/pagedCustomerRequest.mts | 17 + .../models/pagedCustomerRequest.ts | 17 - .../models/pagedCustomerRequestStatus.mts | 17 + .../models/pagedCustomerRequestStatus.ts | 17 - .../models/pagedCustomerTransition.mts | 17 + .../models/pagedCustomerTransition.ts | 17 - .../models/pagedInsightWorkspace.mts | 17 + .../models/pagedInsightWorkspace.ts | 17 - src/serviceDesk/models/pagedIssue.mts | 17 + src/serviceDesk/models/pagedIssue.ts | 17 - .../models/{pagedLink.ts => pagedLink.mts} | 0 src/serviceDesk/models/pagedOrganization.mts | 17 + src/serviceDesk/models/pagedOrganization.ts | 17 - src/serviceDesk/models/pagedQueue.mts | 17 + src/serviceDesk/models/pagedQueue.ts | 17 - src/serviceDesk/models/pagedRequestType.mts | 17 + src/serviceDesk/models/pagedRequestType.ts | 17 - .../models/pagedRequestTypeGroup.mts | 17 + .../models/pagedRequestTypeGroup.ts | 17 - src/serviceDesk/models/pagedServiceDesk.mts | 17 + src/serviceDesk/models/pagedServiceDesk.ts | 17 - .../models/pagedSlaInformation.mts | 17 + src/serviceDesk/models/pagedSlaInformation.ts | 17 - src/serviceDesk/models/pagedUser.mts | 17 + src/serviceDesk/models/pagedUser.ts | 17 - .../{propertyKey.ts => propertyKey.mts} | 0 src/serviceDesk/models/propertyKeys.mts | 7 + src/serviceDesk/models/propertyKeys.ts | 7 - src/serviceDesk/models/queue.mts | 15 + src/serviceDesk/models/queue.ts | 15 - .../{renderedValue.ts => renderedValue.mts} | 0 .../{requestCreate.ts => requestCreate.mts} | 0 ...ts => requestNotificationSubscription.mts} | 0 ...Update.ts => requestParticipantUpdate.mts} | 0 src/serviceDesk/models/requestType.mts | 29 + src/serviceDesk/models/requestType.ts | 29 - ...estTypeCreate.ts => requestTypeCreate.mts} | 0 src/serviceDesk/models/requestTypeField.mts | 21 + src/serviceDesk/models/requestTypeField.ts | 21 - ...ieldValue.ts => requestTypeFieldValue.mts} | 0 ...questTypeGroup.ts => requestTypeGroup.mts} | 0 src/serviceDesk/models/requestTypeIcon.mts | 7 + src/serviceDesk/models/requestTypeIcon.ts | 7 - ...ypeIconLink.ts => requestTypeIconLink.mts} | 0 .../models/{selfLink.ts => selfLink.mts} | 0 src/serviceDesk/models/serviceDesk.mts | 13 + src/serviceDesk/models/serviceDesk.ts | 13 - ...eskCustomer.ts => serviceDeskCustomer.mts} | 0 src/serviceDesk/models/slaInformation.mts | 16 + src/serviceDesk/models/slaInformation.ts | 16 - .../models/slaInformationCompletedCycle.mts | 13 + .../models/slaInformationCompletedCycle.ts | 13 - .../models/slaInformationOngoingCycle.mts | 16 + .../models/slaInformationOngoingCycle.ts | 16 - src/serviceDesk/models/softwareInfo.mts | 15 + src/serviceDesk/models/softwareInfo.ts | 15 - .../models/{source.ts => source.mts} | 0 .../{statusCategory.ts => statusCategory.mts} | 0 src/serviceDesk/models/statusDetails.mts | 16 + src/serviceDesk/models/statusDetails.ts | 16 - src/serviceDesk/models/user.mts | 21 + src/serviceDesk/models/user.ts | 21 - src/serviceDesk/models/userDetails.mts | 51 + src/serviceDesk/models/userDetails.ts | 51 - .../models/{userLink.ts => userLink.mts} | 0 ...nUpdate.ts => usersOrganizationUpdate.mts} | 0 src/serviceDesk/organization.mts | 516 ++++++++ src/serviceDesk/organization.ts | 516 -------- src/serviceDesk/parameters/addCustomers.mts | 9 + src/serviceDesk/parameters/addCustomers.ts | 9 - .../parameters/addOrganization.mts | 9 + src/serviceDesk/parameters/addOrganization.ts | 9 - .../parameters/addRequestParticipants.mts | 6 + .../parameters/addRequestParticipants.ts | 6 - .../parameters/addUsersToOrganization.mts | 6 + .../parameters/addUsersToOrganization.ts | 6 - src/serviceDesk/parameters/answerApproval.mts | 8 + src/serviceDesk/parameters/answerApproval.ts | 8 - ...mporaryFile.ts => attachTemporaryFile.mts} | 0 .../parameters/createAttachment.mts | 6 + .../parameters/createAttachment.ts | 6 - src/serviceDesk/parameters/createCustomer.mts | 3 + src/serviceDesk/parameters/createCustomer.ts | 3 - .../parameters/createCustomerRequest.mts | 3 + .../parameters/createCustomerRequest.ts | 3 - .../parameters/createOrganization.mts | 3 + .../parameters/createOrganization.ts | 3 - .../parameters/createRequestComment.mts | 6 + .../parameters/createRequestComment.ts | 6 - .../parameters/createRequestType.mts | 9 + .../parameters/createRequestType.ts | 9 - .../{deleteFeedback.ts => deleteFeedback.mts} | 0 ...Organization.ts => deleteOrganization.mts} | 0 ...erty.ts => deleteOrganizationProperty.mts} | 0 .../{deleteProperty.ts => deleteProperty.mts} | 0 ...teRequestType.ts => deleteRequestType.mts} | 0 ...RequestTypes.ts => getAllRequestTypes.mts} | 0 ...getApprovalById.ts => getApprovalById.mts} | 0 .../{getApprovals.ts => getApprovals.mts} | 0 .../{getArticles.ts => getArticles.mts} | 0 ...entContent.ts => getAttachmentContent.mts} | 0 ...humbnail.ts => getAttachmentThumbnail.mts} | 0 ...equest.ts => getAttachmentsForRequest.mts} | 0 ...tachments.ts => getCommentAttachments.mts} | 0 ...Key.ts => getCustomerRequestByIdOrKey.mts} | 0 ...Status.ts => getCustomerRequestStatus.mts} | 0 ...merRequests.ts => getCustomerRequests.mts} | 0 ...nsitions.ts => getCustomerTransitions.mts} | 0 .../{getCustomers.ts => getCustomers.mts} | 0 .../{getFeedback.ts => getFeedback.mts} | 0 ...Workspaces.ts => getInsightWorkspaces.mts} | 0 ...tIssuesInQueue.ts => getIssuesInQueue.mts} | 0 ...getOrganization.ts => getOrganization.mts} | 0 ...roperty.ts => getOrganizationProperty.mts} | 0 ...eys.ts => getOrganizationPropertyKeys.mts} | 0 ...tOrganizations.ts => getOrganizations.mts} | 0 ...ropertiesKeys.ts => getPropertiesKeys.mts} | 0 .../{getProperty.ts => getProperty.mts} | 0 .../parameters/{getQueue.ts => getQueue.mts} | 0 .../{getQueues.ts => getQueues.mts} | 0 ...mmentById.ts => getRequestCommentById.mts} | 0 ...uestComments.ts => getRequestComments.mts} | 0 ...icipants.ts => getRequestParticipants.mts} | 0 ...uestTypeById.ts => getRequestTypeById.mts} | 0 ...TypeFields.ts => getRequestTypeFields.mts} | 0 ...TypeGroups.ts => getRequestTypeGroups.mts} | 0 ...getRequestTypes.ts => getRequestTypes.mts} | 0 ...viceDeskById.ts => getServiceDeskById.mts} | 0 ...getServiceDesks.ts => getServiceDesks.mts} | 0 ...laInformation.ts => getSlaInformation.mts} | 0 ...ationById.ts => getSlaInformationById.mts} | 0 ...ionStatus.ts => getSubscriptionStatus.mts} | 0 ...nization.ts => getUsersInOrganization.mts} | 0 src/serviceDesk/parameters/index.mts | 70 ++ src/serviceDesk/parameters/index.ts | 70 -- .../parameters/performCustomerTransition.mts | 6 + .../parameters/performCustomerTransition.ts | 6 - src/serviceDesk/parameters/postFeedback.mts | 6 + src/serviceDesk/parameters/postFeedback.ts | 6 - .../parameters/removeCustomers.mts | 9 + src/serviceDesk/parameters/removeCustomers.ts | 9 - .../parameters/removeOrganization.mts | 9 + .../parameters/removeOrganization.ts | 9 - .../parameters/removeRequestParticipants.mts | 6 + .../parameters/removeRequestParticipants.ts | 6 - .../removeUsersFromOrganization.mts | 6 + .../parameters/removeUsersFromOrganization.ts | 6 - ...roperty.ts => setOrganizationProperty.mts} | 0 .../{setProperty.ts => setProperty.mts} | 0 .../{subscribe.ts => subscribe.mts} | 0 .../{unsubscribe.ts => unsubscribe.mts} | 0 src/serviceDesk/request.mts | 1105 ++++++++++++++++ src/serviceDesk/request.ts | 1105 ---------------- src/serviceDesk/requestType.mts | 65 + src/serviceDesk/requestType.ts | 65 - src/serviceDesk/serviceDesk.mts | 802 ++++++++++++ src/serviceDesk/serviceDesk.ts | 803 ------------ .../createBasicAuthenticationToken.mts | 19 + .../createBasicAuthenticationToken.ts | 19 - .../createOAuth2AuthenticationToken.mts | 5 + .../createOAuth2AuthenticationToken.ts | 5 - .../createPATAuthentication.mts | 5 + .../createPATAuthentication.ts | 5 - .../authentications/index.mts | 3 + .../authentications/index.ts | 3 - .../authenticationService/base64Encoder.mts | 70 ++ .../authenticationService/base64Encoder.ts | 69 - .../getAuthenticationToken.mts | 28 + .../getAuthenticationToken.ts | 28 - src/services/authenticationService/index.mts | 1 + src/services/authenticationService/index.ts | 1 - src/{utilityTypes.ts => utilityTypes.mts} | 0 src/version2/announcementBanner.mts | 61 + src/version2/announcementBanner.ts | 61 - src/version2/appMigration.mts | 114 ++ src/version2/appMigration.ts | 114 -- src/version2/appProperties.mts | 224 ++++ src/version2/appProperties.ts | 224 ---- src/version2/applicationRoles.mts | 68 + src/version2/applicationRoles.ts | 68 - src/version2/auditRecords.mts | 79 ++ src/version2/auditRecords.ts | 79 -- src/version2/avatars.mts | 332 +++++ src/version2/avatars.ts | 332 ----- src/version2/client/index.ts | 1 - src/version2/client/version2Client.mts | 174 +++ src/version2/client/version2Client.ts | 176 --- src/version2/dashboards.mts | 727 +++++++++++ src/version2/dashboards.ts | 727 ----------- src/version2/dynamicModules.mts | 90 ++ src/version2/dynamicModules.ts | 90 -- src/version2/filterSharing.mts | 255 ++++ src/version2/filterSharing.ts | 255 ---- src/version2/filters.mts | 624 +++++++++ src/version2/filters.ts | 624 --------- src/version2/groupAndUserPicker.mts | 110 ++ src/version2/groupAndUserPicker.ts | 110 -- src/version2/groups.mts | 281 +++++ src/version2/groups.ts | 281 ----- src/version2/index.mts | 89 ++ src/version2/index.ts | 89 -- src/version2/issueAttachments.mts | 445 +++++++ src/version2/issueAttachments.ts | 446 ------- src/version2/issueCommentProperties.mts | 196 +++ src/version2/issueCommentProperties.ts | 196 --- src/version2/issueComments.mts | 309 +++++ src/version2/issueComments.ts | 309 ----- .../issueCustomFieldConfigurationApps.mts | 111 ++ .../issueCustomFieldConfigurationApps.ts | 111 -- src/version2/issueCustomFieldContexts.mts | 724 +++++++++++ src/version2/issueCustomFieldContexts.ts | 724 ----------- src/version2/issueCustomFieldOptions.mts | 301 +++++ src/version2/issueCustomFieldOptions.ts | 301 ----- src/version2/issueCustomFieldOptionsApps.mts | 407 ++++++ src/version2/issueCustomFieldOptionsApps.ts | 407 ------ src/version2/issueCustomFieldValuesApps.mts | 85 ++ src/version2/issueCustomFieldValuesApps.ts | 85 -- src/version2/issueFieldConfigurations.mts | 650 ++++++++++ src/version2/issueFieldConfigurations.ts | 650 ---------- src/version2/issueFields.mts | 319 +++++ src/version2/issueFields.ts | 319 ----- src/version2/issueLinkTypes.mts | 208 +++ src/version2/issueLinkTypes.ts | 208 --- src/version2/issueLinks.mts | 162 +++ src/version2/issueLinks.ts | 162 --- src/version2/issueNavigatorSettings.mts | 76 ++ src/version2/issueNavigatorSettings.ts | 76 -- src/version2/issueNotificationSchemes.mts | 281 +++++ src/version2/issueNotificationSchemes.ts | 281 ----- src/version2/issuePriorities.mts | 241 ++++ src/version2/issuePriorities.ts | 241 ---- src/version2/issueProperties.mts | 511 ++++++++ src/version2/issueProperties.ts | 511 -------- src/version2/issueRemoteLinks.mts | 336 +++++ src/version2/issueRemoteLinks.ts | 336 ----- src/version2/issueResolutions.mts | 224 ++++ src/version2/issueResolutions.ts | 224 ---- src/version2/issueSearch.mts | 234 ++++ src/version2/issueSearch.ts | 234 ---- src/version2/issueSecurityLevel.mts | 95 ++ src/version2/issueSecurityLevel.ts | 95 -- src/version2/issueSecuritySchemes.mts | 605 +++++++++ src/version2/issueSecuritySchemes.ts | 605 --------- src/version2/issueTypeProperties.mts | 176 +++ src/version2/issueTypeProperties.ts | 176 --- src/version2/issueTypeSchemes.mts | 437 +++++++ src/version2/issueTypeSchemes.ts | 437 ------- src/version2/issueTypeScreenSchemes.mts | 440 +++++++ src/version2/issueTypeScreenSchemes.ts | 440 ------- src/version2/issueTypes.mts | 351 ++++++ src/version2/issueTypes.ts | 351 ------ src/version2/issueVotes.mts | 148 +++ src/version2/issueVotes.ts | 148 --- src/version2/issueWatchers.mts | 215 ++++ src/version2/issueWatchers.ts | 215 ---- src/version2/issueWorklogProperties.mts | 197 +++ src/version2/issueWorklogProperties.ts | 197 --- src/version2/issueWorklogs.mts | 456 +++++++ src/version2/issueWorklogs.ts | 456 ------- src/version2/issues.mts | 1062 ++++++++++++++++ src/version2/issues.ts | 1062 ---------------- src/version2/jQL.ts | 312 ----- src/version2/jiraExpressions.mts | 193 +++ src/version2/jiraExpressions.ts | 193 --- src/version2/jiraSettings.mts | 241 ++++ src/version2/jiraSettings.ts | 241 ---- src/version2/jql.mts | 312 +++++ src/version2/jqlFunctionsApps.mts | 82 ++ src/version2/jqlFunctionsApps.ts | 82 -- src/version2/labels.mts | 38 + src/version2/labels.ts | 38 - src/version2/licenseMetrics.mts | 88 ++ src/version2/licenseMetrics.ts | 88 -- .../models/{actorInput.ts => actorInput.mts} | 0 .../models/{actorsMap.ts => actorsMap.mts} | 0 .../models/{addField.ts => addField.mts} | 0 .../models/{addGroup.ts => addGroup.mts} | 0 .../models/addSecuritySchemeLevelsRequest.mts | 6 + .../models/addSecuritySchemeLevelsRequest.ts | 6 - ...ts => announcementBannerConfiguration.mts} | 0 ...announcementBannerConfigurationUpdate.mts} | 0 .../{application.ts => application.mts} | 0 ...ionProperty.ts => applicationProperty.mts} | 0 src/version2/models/applicationRole.mts | 36 + src/version2/models/applicationRole.ts | 36 - ...eldConfigurationsWithIssueTypesRequest.mts | 7 + ...ieldConfigurationsWithIssueTypesRequest.ts | 7 - .../{associatedItem.ts => associatedItem.mts} | 0 src/version2/models/attachment.mts | 22 + src/version2/models/attachment.ts | 22 - ...iveEntry.ts => attachmentArchiveEntry.mts} | 0 src/version2/models/attachmentArchiveImpl.mts | 8 + src/version2/models/attachmentArchiveImpl.ts | 8 - ...e.ts => attachmentArchiveItemReadable.mts} | 0 .../attachmentArchiveMetadataReadable.mts | 15 + .../attachmentArchiveMetadataReadable.ts | 15 - src/version2/models/attachmentMetadata.mts | 29 + src/version2/models/attachmentMetadata.ts | 29 - ...mentSettings.ts => attachmentSettings.mts} | 0 src/version2/models/auditRecord.mts | 28 + src/version2/models/auditRecord.ts | 28 - src/version2/models/auditRecords.mts | 13 + src/version2/models/auditRecords.ts | 13 - ...ggestion.ts => autoCompleteSuggestion.mts} | 0 .../models/autoCompleteSuggestions.mts | 7 + .../models/autoCompleteSuggestions.ts | 7 - ...Gadget.ts => availableDashboardGadget.mts} | 0 .../availableDashboardGadgetsResponse.mts | 7 + .../availableDashboardGadgetsResponse.ts | 7 - ...le.ts => availableWorkflowConnectRule.mts} | 0 ...Rule.ts => availableWorkflowForgeRule.mts} | 0 ...ule.ts => availableWorkflowSystemRule.mts} | 0 ...s.ts => availableWorkflowTriggerTypes.mts} | 0 .../models/availableWorkflowTriggers.mts | 9 + .../models/availableWorkflowTriggers.ts | 9 - src/version2/models/{avatar.ts => avatar.mts} | 0 .../models/{avatarUrls.ts => avatarUrls.mts} | 0 ...arWithDetails.ts => avatarWithDetails.mts} | 0 src/version2/models/avatars.mts | 9 + src/version2/models/avatars.ts | 9 - ...rDetails.ts => bulkChangeOwnerDetails.mts} | 0 .../bulkCustomFieldOptionCreateRequest.mts | 7 + .../bulkCustomFieldOptionCreateRequest.ts | 7 - .../bulkCustomFieldOptionUpdateRequest.mts | 7 + .../bulkCustomFieldOptionUpdateRequest.ts | 7 - ...eEntity.ts => bulkEditShareableEntity.mts} | 0 ...eIsWatching.ts => bulkIssueIsWatching.mts} | 0 .../models/bulkIssuePropertyUpdateRequest.mts | 18 + .../models/bulkIssuePropertyUpdateRequest.ts | 18 - .../models/bulkOperationErrorResult.mts | 7 + .../models/bulkOperationErrorResult.ts | 7 - src/version2/models/bulkPermissionGrants.mts | 9 + src/version2/models/bulkPermissionGrants.ts | 9 - .../models/bulkPermissionsRequest.mts | 11 + src/version2/models/bulkPermissionsRequest.ts | 11 - ...nts.ts => bulkProjectPermissionGrants.mts} | 0 ...missions.ts => bulkProjectPermissions.mts} | 0 .../{changeDetails.ts => changeDetails.mts} | 0 .../{changedValue.ts => changedValue.mts} | 0 src/version2/models/changedWorklog.mts | 11 + src/version2/models/changedWorklog.ts | 11 - src/version2/models/changedWorklogs.mts | 16 + src/version2/models/changedWorklogs.ts | 16 - src/version2/models/changelog.mts | 15 + src/version2/models/changelog.ts | 15 - .../models/{columnItem.ts => columnItem.mts} | 0 src/version2/models/comment.mts | 40 + src/version2/models/comment.ts | 40 - ...ssuesCount.ts => componentIssuesCount.mts} | 0 .../models/componentWithIssueCount.mts | 51 + .../models/componentWithIssueCount.ts | 51 - .../models/conditionGroupConfiguration.mts | 15 + .../models/conditionGroupConfiguration.ts | 15 - src/version2/models/conditionGroupUpdate.mts | 15 + src/version2/models/conditionGroupUpdate.ts | 15 - src/version2/models/configuration.mts | 27 + src/version2/models/configuration.ts | 27 - ...ldValue.ts => connectCustomFieldValue.mts} | 0 .../models/connectCustomFieldValues.mts | 7 + .../models/connectCustomFieldValues.ts | 7 - .../{connectModule.ts => connectModule.mts} | 0 src/version2/models/connectModules.mts | 9 + src/version2/models/connectModules.ts | 9 - .../models/connectWorkflowTransitionRule.mts | 12 + .../models/connectWorkflowTransitionRule.ts | 12 - .../models/containerForProjectFeatures.mts | 7 + .../models/containerForProjectFeatures.ts | 7 - .../models/containerForRegisteredWebhooks.mts | 7 + .../models/containerForRegisteredWebhooks.ts | 7 - ...bhookIDs.ts => containerForWebhookIDs.mts} | 0 .../containerOfWorkflowSchemeAssociations.mts | 7 + .../containerOfWorkflowSchemeAssociations.ts | 7 - ...e.ts => contextForProjectAndIssueType.mts} | 0 ...uration.ts => contextualConfiguration.mts} | 0 src/version2/models/convertedJQLQueries.mts | 9 + src/version2/models/convertedJQLQueries.ts | 9 - ...ontext.ts => createCustomFieldContext.mts} | 0 .../createIssueSecuritySchemeDetails.mts | 11 + .../createIssueSecuritySchemeDetails.ts | 11 - .../createNotificationSchemeDetails.mts | 11 + .../models/createNotificationSchemeDetails.ts | 11 - ...tyDetails.ts => createPriorityDetails.mts} | 0 ...ectDetails.ts => createProjectDetails.mts} | 0 ...Details.ts => createResolutionDetails.mts} | 0 .../models/createUiModificationDetails.mts | 13 + .../models/createUiModificationDetails.ts | 13 - ...Request.ts => createUpdateRoleRequest.mts} | 0 ...ndition.ts => createWorkflowCondition.mts} | 0 src/version2/models/createWorkflowDetails.mts | 29 + src/version2/models/createWorkflowDetails.ts | 29 - ...ils.ts => createWorkflowStatusDetails.mts} | 0 .../createWorkflowTransitionDetails.mts | 20 + .../models/createWorkflowTransitionDetails.ts | 20 - ...le.ts => createWorkflowTransitionRule.mts} | 0 .../createWorkflowTransitionRulesDetails.mts | 72 ++ .../createWorkflowTransitionRulesDetails.ts | 72 -- ...createWorkflowTransitionScreenDetails.mts} | 0 src/version2/models/createdIssue.mts | 13 + src/version2/models/createdIssue.ts | 13 - src/version2/models/createdIssues.mts | 10 + src/version2/models/createdIssues.ts | 10 - ...tVariable.ts => customContextVariable.mts} | 0 .../models/customFieldConfigurations.mts | 7 + .../models/customFieldConfigurations.ts | 7 - ...FieldContext.ts => customFieldContext.mts} | 0 ....ts => customFieldContextDefaultValue.mts} | 0 .../customFieldContextDefaultValueUpdate.mts | 6 + .../customFieldContextDefaultValueUpdate.ts | 6 - ...Option.ts => customFieldContextOption.mts} | 0 ...s => customFieldContextProjectMapping.mts} | 0 ...ts => customFieldContextUpdateDetails.mts} | 0 .../customFieldCreatedContextOptionsList.mts | 7 + .../customFieldCreatedContextOptionsList.ts | 7 - .../models/customFieldDefinitionJson.mts | 61 + .../models/customFieldDefinitionJson.ts | 61 - ...omFieldOption.ts => customFieldOption.mts} | 0 ...nCreate.ts => customFieldOptionCreate.mts} | 0 ...nUpdate.ts => customFieldOptionUpdate.mts} | 0 ...lacement.ts => customFieldReplacement.mts} | 0 .../customFieldUpdatedContextOptionsList.mts | 7 + .../customFieldUpdatedContextOptionsList.ts | 7 - ...ueUpdate.ts => customFieldValueUpdate.mts} | 0 .../models/customFieldValueUpdateDetails.mts | 7 + .../models/customFieldValueUpdateDetails.ts | 7 - src/version2/models/dashboard.mts | 32 + src/version2/models/dashboard.ts | 32 - src/version2/models/dashboardDetails.mts | 13 + src/version2/models/dashboardDetails.ts | 13 - src/version2/models/dashboardGadget.mts | 16 + src/version2/models/dashboardGadget.ts | 16 - ...osition.ts => dashboardGadgetPosition.mts} | 0 .../models/dashboardGadgetResponse.mts | 7 + .../models/dashboardGadgetResponse.ts | 7 - .../models/dashboardGadgetSettings.mts | 19 + .../models/dashboardGadgetSettings.ts | 19 - .../models/dashboardGadgetUpdateRequest.mts | 10 + .../models/dashboardGadgetUpdateRequest.ts | 10 - src/version2/models/dashboardUser.mts | 16 + src/version2/models/dashboardUser.ts | 16 - ...dateRangeFilter.ts => dateRangeFilter.mts} | 0 ...ultLevelValue.ts => defaultLevelValue.mts} | 0 ...ultShareScope.ts => defaultShareScope.mts} | 0 ...defaultWorkflow.ts => defaultWorkflow.mts} | 0 ...documentVersion.ts => documentVersion.mts} | 0 .../{entityProperty.ts => entityProperty.mts} | 0 ...tyDetails.ts => entityPropertyDetails.mts} | 0 src/version2/models/{error.ts => error.mts} | 0 ...errorCollection.ts => errorCollection.mts} | 0 src/version2/models/errors.mts | 8 + src/version2/models/errors.ts | 8 - src/version2/models/eventNotification.mts | 39 + src/version2/models/eventNotification.ts | 39 - ...s => exportArchivedIssuesTaskProgress.mts} | 0 .../{failedWebhook.ts => failedWebhook.mts} | 0 src/version2/models/failedWebhooks.mts | 18 + src/version2/models/failedWebhooks.ts | 18 - src/version2/models/field.mts | 28 + src/version2/models/field.ts | 28 - ...onfiguration.ts => fieldConfiguration.mts} | 0 ...tails.ts => fieldConfigurationDetails.mts} | 0 ...ts => fieldConfigurationIssueTypeItem.mts} | 0 ...tionItem.ts => fieldConfigurationItem.mts} | 0 .../models/fieldConfigurationItemsDetails.mts | 7 + .../models/fieldConfigurationItemsDetails.ts | 7 - ...Scheme.ts => fieldConfigurationScheme.mts} | 0 ...ConfigurationSchemeProjectAssociation.mts} | 0 .../fieldConfigurationSchemeProjects.mts | 8 + .../fieldConfigurationSchemeProjects.ts | 8 - ... fieldConfigurationToIssueTypeMapping.mts} | 0 src/version2/models/fieldDetails.mts | 27 + src/version2/models/fieldDetails.ts | 27 - .../{fieldLastUsed.ts => fieldLastUsed.mts} | 0 src/version2/models/fieldMetadata.mts | 24 + src/version2/models/fieldMetadata.ts | 24 - ...eferenceData.ts => fieldReferenceData.mts} | 0 src/version2/models/fields.mts | 98 ++ src/version2/models/fields.ts | 98 -- src/version2/models/filter.mts | 40 + src/version2/models/filter.ts | 40 - src/version2/models/filterDetails.mts | 47 + src/version2/models/filterDetails.ts | 47 - src/version2/models/filterSubscription.mts | 10 + src/version2/models/filterSubscription.ts | 10 - .../models/filterSubscriptionsList.mts | 15 + .../models/filterSubscriptionsList.ts | 15 - .../models/{fixVersion.ts => fixVersion.mts} | 0 src/version2/models/foundGroup.mts | 15 + src/version2/models/foundGroup.ts | 15 - src/version2/models/foundGroups.mts | 13 + src/version2/models/foundGroups.ts | 13 - src/version2/models/foundUsers.mts | 13 + src/version2/models/foundUsers.ts | 13 - src/version2/models/foundUsersAndGroups.mts | 8 + src/version2/models/foundUsersAndGroups.ts | 8 - ...renceData.ts => functionReferenceData.mts} | 0 .../{globalScope.ts => globalScope.mts} | 0 src/version2/models/group.mts | 16 + src/version2/models/group.ts | 16 - .../{groupDetails.ts => groupDetails.mts} | 0 .../models/{groupLabel.ts => groupLabel.mts} | 0 .../models/{groupName.ts => groupName.mts} | 0 src/version2/models/hierarchy.mts | 7 + src/version2/models/hierarchy.ts | 7 - .../{hierarchyLevel.ts => hierarchyLevel.mts} | 0 src/version2/models/historyMetadata.mts | 24 + src/version2/models/historyMetadata.ts | 24 - ...pant.ts => historyMetadataParticipant.mts} | 0 src/version2/models/{icon.ts => icon.mts} | 0 src/version2/models/{id.ts => id.mts} | 0 .../models/{idOrKey.ts => idOrKey.mts} | 0 .../{includedFields.ts => includedFields.mts} | 0 src/version2/models/index.mts | 543 ++++++++ src/version2/models/index.ts | 543 -------- src/version2/models/issue.mts | 35 + src/version2/models/issue.ts | 35 - src/version2/models/issueArchivalSync.mts | 7 + src/version2/models/issueArchivalSync.ts | 7 - ...eChangelogIds.ts => issueChangelogIds.mts} | 0 ...Request.ts => issueCommentListRequest.mts} | 0 src/version2/models/issueCreateMetadata.mts | 9 + src/version2/models/issueCreateMetadata.ts | 9 - ...roperties.ts => issueEntityProperties.mts} | 0 ...> issueEntityPropertiesForMultiUpdate.mts} | 0 .../models/{issueEvent.ts => issueEvent.mts} | 0 src/version2/models/issueFieldOption.mts | 17 + src/version2/models/issueFieldOption.ts | 17 - .../models/issueFieldOptionConfiguration.mts | 6 + .../models/issueFieldOptionConfiguration.ts | 6 - .../models/issueFieldOptionCreate.mts | 13 + src/version2/models/issueFieldOptionCreate.ts | 13 - src/version2/models/issueFieldOptionScope.mts | 12 + src/version2/models/issueFieldOptionScope.ts | 12 - ...s => issueFilterForBulkPropertyDelete.mts} | 0 ...t.ts => issueFilterForBulkPropertySet.mts} | 0 src/version2/models/issueLink.mts | 13 + src/version2/models/issueLink.ts | 13 - .../{issueLinkType.ts => issueLinkType.mts} | 0 src/version2/models/issueLinkTypes.mts | 7 + src/version2/models/issueLinkTypes.ts | 7 - .../models/{issueList.ts => issueList.mts} | 0 src/version2/models/issueMatches.mts | 6 + src/version2/models/issueMatches.ts | 6 - src/version2/models/issueMatchesForJQL.mts | 7 + src/version2/models/issueMatchesForJQL.ts | 7 - .../models/issuePickerSuggestions.mts | 7 + src/version2/models/issuePickerSuggestions.ts | 7 - .../issuePickerSuggestionsIssueType.mts | 15 + .../models/issuePickerSuggestionsIssueType.ts | 15 - .../models/issueSecurityLevelMember.mts | 10 + .../models/issueSecurityLevelMember.ts | 10 - ...> issueSecuritySchemeToProjectMapping.mts} | 0 src/version2/models/issueTransition.mts | 31 + src/version2/models/issueTransition.ts | 31 - ...issueTypeCreate.ts => issueTypeCreate.mts} | 0 src/version2/models/issueTypeDetails.mts | 24 + src/version2/models/issueTypeDetails.ts | 24 - .../{issueTypeIds.ts => issueTypeIds.mts} | 0 ...dsToRemove.ts => issueTypeIdsToRemove.mts} | 0 .../{issueTypeInfo.ts => issueTypeInfo.mts} | 0 .../models/issueTypeIssueCreateMetadata.mts | 28 + .../models/issueTypeIssueCreateMetadata.ts | 28 - ...issueTypeScheme.ts => issueTypeScheme.mts} | 0 ...eDetails.ts => issueTypeSchemeDetails.mts} | 0 ...eTypeSchemeID.ts => issueTypeSchemeID.mts} | 0 ...eMapping.ts => issueTypeSchemeMapping.mts} | 0 ... => issueTypeSchemeProjectAssociation.mts} | 0 .../models/issueTypeSchemeProjects.mts | 8 + .../models/issueTypeSchemeProjects.ts | 8 - ...ls.ts => issueTypeSchemeUpdateDetails.mts} | 0 ...eenScheme.ts => issueTypeScreenScheme.mts} | 0 .../models/issueTypeScreenSchemeDetails.mts | 14 + .../models/issueTypeScreenSchemeDetails.ts | 14 - ...chemeId.ts => issueTypeScreenSchemeId.mts} | 0 ...eItem.ts => issueTypeScreenSchemeItem.mts} | 0 ...ng.ts => issueTypeScreenSchemeMapping.mts} | 0 .../issueTypeScreenSchemeMappingDetails.mts | 10 + .../issueTypeScreenSchemeMappingDetails.ts | 10 - ...sueTypeScreenSchemeProjectAssociation.mts} | 0 ...=> issueTypeScreenSchemeUpdateDetails.mts} | 0 .../models/issueTypeScreenSchemesProjects.mts | 8 + .../models/issueTypeScreenSchemesProjects.ts | 8 - ...pping.ts => issueTypeToContextMapping.mts} | 0 ...issueTypeUpdate.ts => issueTypeUpdate.mts} | 0 src/version2/models/issueTypeWithStatus.mts | 15 + src/version2/models/issueTypeWithStatus.ts | 15 - ...apping.ts => issueTypeWorkflowMapping.mts} | 0 ...pping.ts => issueTypesWorkflowMapping.mts} | 0 src/version2/models/issueUpdateDetails.mts | 23 + src/version2/models/issueUpdateDetails.ts | 23 - src/version2/models/issueUpdateMetadata.mts | 7 + src/version2/models/issueUpdateMetadata.ts | 7 - src/version2/models/issuesAndJQLQueries.mts | 7 + src/version2/models/issuesAndJQLQueries.ts | 7 - src/version2/models/issuesJqlMetaData.mts | 13 + src/version2/models/issuesJqlMetaData.ts | 13 - src/version2/models/issuesMeta.mts | 6 + src/version2/models/issuesMeta.ts | 6 - src/version2/models/issuesUpdate.mts | 5 + src/version2/models/issuesUpdate.ts | 5 - .../jQLPersonalDataMigrationRequest.mts | 5 + .../models/jQLPersonalDataMigrationRequest.ts | 5 - .../models/jQLQueryWithUnknownUsers.mts | 7 + .../models/jQLQueryWithUnknownUsers.ts | 7 - src/version2/models/jQLReferenceData.mts | 12 + src/version2/models/jQLReferenceData.ts | 12 - src/version2/models/jexpIssues.mts | 6 + src/version2/models/jexpIssues.ts | 6 - src/version2/models/jexpJqlIssues.mts | 19 + src/version2/models/jexpJqlIssues.ts | 19 - .../models/jiraExpressionAnalysis.mts | 18 + src/version2/models/jiraExpressionAnalysis.ts | 18 - ...lexity.ts => jiraExpressionComplexity.mts} | 0 .../models/jiraExpressionEvalContext.mts | 32 + .../models/jiraExpressionEvalContext.ts | 32 - .../models/jiraExpressionEvalRequest.mts | 7 + .../models/jiraExpressionEvalRequest.ts | 7 - .../jiraExpressionEvaluationMetaData.mts | 7 + .../jiraExpressionEvaluationMetaData.ts | 7 - ...lysis.ts => jiraExpressionForAnalysis.mts} | 0 src/version2/models/jiraExpressionResult.mts | 13 + src/version2/models/jiraExpressionResult.ts | 13 - ...r.ts => jiraExpressionValidationError.mts} | 0 .../models/jiraExpressionsAnalysis.mts | 7 + .../models/jiraExpressionsAnalysis.ts | 7 - .../models/jiraExpressionsComplexity.mts | 8 + .../models/jiraExpressionsComplexity.ts | 8 - ....ts => jiraExpressionsComplexityValue.mts} | 0 src/version2/models/jiraStatus.mts | 17 + src/version2/models/jiraStatus.ts | 17 - src/version2/models/jiraWorkflow.mts | 32 + src/version2/models/jiraWorkflow.ts | 32 - src/version2/models/jiraWorkflowStatus.mts | 22 + src/version2/models/jiraWorkflowStatus.ts | 22 - ...ation.ts => jqlFunctionPrecomputation.mts} | 0 ...ts => jqlFunctionPrecomputationUpdate.mts} | 0 ...jqlFunctionPrecomputationUpdateRequest.mts | 6 + .../jqlFunctionPrecomputationUpdateRequest.ts | 6 - src/version2/models/jqlQueriesToParse.mts | 5 + src/version2/models/jqlQueriesToParse.ts | 5 - src/version2/models/jqlQueriesToSanitize.mts | 7 + src/version2/models/jqlQueriesToSanitize.ts | 7 - src/version2/models/jqlQuery.mts | 8 + src/version2/models/jqlQuery.ts | 8 - src/version2/models/jqlQueryClause.mts | 2 + src/version2/models/jqlQueryClause.ts | 2 - src/version2/models/jqlQueryField.mts | 14 + src/version2/models/jqlQueryField.ts | 14 - ...rty.ts => jqlQueryFieldEntityProperty.mts} | 0 src/version2/models/jqlQueryOrderByClause.mts | 7 + src/version2/models/jqlQueryOrderByClause.ts | 7 - .../models/jqlQueryOrderByClauseElement.mts | 8 + .../models/jqlQueryOrderByClauseElement.ts | 8 - src/version2/models/jqlQueryToSanitize.mts | 13 + src/version2/models/jqlQueryToSanitize.ts | 13 - .../models/{jsonType.ts => jsonType.mts} | 0 src/version2/models/license.mts | 7 + src/version2/models/license.ts | 7 - .../{licenseMetric.ts => licenseMetric.mts} | 0 ...Application.ts => licensedApplication.mts} | 0 src/version2/models/linkGroup.mts | 11 + src/version2/models/linkGroup.ts | 11 - src/version2/models/linkIssueRequestJson.mts | 10 + src/version2/models/linkIssueRequestJson.ts | 10 - src/version2/models/linkedIssue.mts | 12 + src/version2/models/linkedIssue.ts | 12 - ...=> listWrapperCallbackApplicationRole.mts} | 0 ...me.ts => listWrapperCallbackGroupName.mts} | 0 src/version2/models/{locale.ts => locale.mts} | 0 .../models/{moveField.ts => moveField.mts} | 0 .../models/multiIssueEntityProperties.mts | 10 + .../models/multiIssueEntityProperties.ts | 10 - ...ts => multipleCustomFieldValuesUpdate.mts} | 0 ...multipleCustomFieldValuesUpdateDetails.mts | 6 + .../multipleCustomFieldValuesUpdateDetails.ts | 6 - src/version2/models/nestedResponse.mts | 8 + src/version2/models/nestedResponse.ts | 8 - .../{newUserDetails.ts => newUserDetails.mts} | 0 src/version2/models/notification.mts | 17 + src/version2/models/notification.ts | 17 - ...ficationEvent.ts => notificationEvent.mts} | 0 .../models/notificationRecipients.mts | 20 + src/version2/models/notificationRecipients.ts | 20 - .../notificationRecipientsRestrictions.mts | 12 + .../notificationRecipientsRestrictions.ts | 12 - src/version2/models/notificationScheme.mts | 20 + src/version2/models/notificationScheme.ts | 20 - ...> notificationSchemeAndProjectMapping.mts} | 0 ...otificationSchemeAndProjectMappingPage.mts | 19 + ...notificationSchemeAndProjectMappingPage.ts | 19 - .../models/notificationSchemeEvent.mts | 8 + .../models/notificationSchemeEvent.ts | 8 - .../models/notificationSchemeEventDetails.mts | 9 + .../models/notificationSchemeEventDetails.ts | 9 - ...d.ts => notificationSchemeEventTypeId.mts} | 0 ...onSchemeId.ts => notificationSchemeId.mts} | 0 ...notificationSchemeNotificationDetails.mts} | 0 ...s.ts => oldToNewSecurityLevelMappings.mts} | 0 ...erationMessage.ts => operationMessage.mts} | 0 src/version2/models/operations.mts | 7 + src/version2/models/operations.ts | 7 - ...tions.ts => orderOfCustomFieldOptions.mts} | 0 ...rOfIssueTypes.ts => orderOfIssueTypes.mts} | 0 src/version2/models/pageChangelog.mts | 19 + src/version2/models/pageChangelog.ts | 19 - src/version2/models/pageComment.mts | 19 + src/version2/models/pageComment.ts | 19 - .../models/pageComponentWithIssueCount.mts | 19 + .../models/pageComponentWithIssueCount.ts | 19 - .../pageContextForProjectAndIssueType.mts | 19 + .../pageContextForProjectAndIssueType.ts | 19 - .../models/pageContextualConfiguration.mts | 19 + .../models/pageContextualConfiguration.ts | 19 - .../models/pageCustomFieldContext.mts | 19 + src/version2/models/pageCustomFieldContext.ts | 19 - .../pageCustomFieldContextDefaultValue.mts | 19 + .../pageCustomFieldContextDefaultValue.ts | 19 - .../models/pageCustomFieldContextOption.mts | 19 + .../models/pageCustomFieldContextOption.ts | 19 - .../pageCustomFieldContextProjectMapping.mts | 19 + .../pageCustomFieldContextProjectMapping.ts | 19 - src/version2/models/pageDashboard.mts | 19 + src/version2/models/pageDashboard.ts | 19 - src/version2/models/pageField.mts | 19 + src/version2/models/pageField.ts | 19 - .../models/pageFieldConfiguration.mts | 19 + src/version2/models/pageFieldConfiguration.ts | 19 - .../pageFieldConfigurationIssueTypeItem.mts | 19 + .../pageFieldConfigurationIssueTypeItem.ts | 19 - .../models/pageFieldConfigurationItem.mts | 19 + .../models/pageFieldConfigurationItem.ts | 19 - .../models/pageFieldConfigurationScheme.mts | 19 + .../models/pageFieldConfigurationScheme.ts | 19 - .../pageFieldConfigurationSchemeProjects.mts | 19 + .../pageFieldConfigurationSchemeProjects.ts | 19 - src/version2/models/pageFilterDetails.mts | 19 + src/version2/models/pageFilterDetails.ts | 19 - src/version2/models/pageGroupDetails.mts | 19 + src/version2/models/pageGroupDetails.ts | 19 - src/version2/models/pageIssueFieldOption.mts | 19 + src/version2/models/pageIssueFieldOption.ts | 19 - .../models/pageIssueSecurityLevelMember.mts | 19 + .../models/pageIssueSecurityLevelMember.ts | 19 - ...ageIssueSecuritySchemeToProjectMapping.mts | 19 + ...pageIssueSecuritySchemeToProjectMapping.ts | 19 - src/version2/models/pageIssueTypeScheme.mts | 19 + src/version2/models/pageIssueTypeScheme.ts | 19 - .../models/pageIssueTypeSchemeMapping.mts | 19 + .../models/pageIssueTypeSchemeMapping.ts | 19 - .../models/pageIssueTypeSchemeProjects.mts | 19 + .../models/pageIssueTypeSchemeProjects.ts | 19 - .../models/pageIssueTypeScreenScheme.mts | 19 + .../models/pageIssueTypeScreenScheme.ts | 19 - .../models/pageIssueTypeScreenSchemeItem.mts | 19 + .../models/pageIssueTypeScreenSchemeItem.ts | 19 - .../pageIssueTypeScreenSchemesProjects.mts | 19 + .../pageIssueTypeScreenSchemesProjects.ts | 19 - .../models/pageIssueTypeToContextMapping.mts | 19 + .../models/pageIssueTypeToContextMapping.ts | 19 - .../models/pageJqlFunctionPrecomputation.mts | 19 + .../models/pageJqlFunctionPrecomputation.ts | 19 - .../models/pageNotificationScheme.mts | 19 + src/version2/models/pageNotificationScheme.ts | 19 - src/version2/models/pageOfChangelogs.mts | 13 + src/version2/models/pageOfChangelogs.ts | 13 - src/version2/models/pageOfComments.mts | 13 + src/version2/models/pageOfComments.ts | 13 - src/version2/models/pageOfDashboards.mts | 17 + src/version2/models/pageOfDashboards.ts | 17 - src/version2/models/pageOfStatuses.mts | 18 + src/version2/models/pageOfStatuses.ts | 18 - src/version2/models/pageOfWorklogs.mts | 13 + src/version2/models/pageOfWorklogs.ts | 13 - src/version2/models/pagePriority.mts | 19 + src/version2/models/pagePriority.ts | 19 - src/version2/models/pageProject.mts | 19 + src/version2/models/pageProject.ts | 19 - src/version2/models/pageProjectDetails.mts | 19 + src/version2/models/pageProjectDetails.ts | 19 - src/version2/models/pageResolution.mts | 19 + src/version2/models/pageResolution.ts | 19 - src/version2/models/pageScreen.mts | 19 + src/version2/models/pageScreen.ts | 19 - src/version2/models/pageScreenScheme.mts | 19 + src/version2/models/pageScreenScheme.ts | 19 - src/version2/models/pageScreenWithTab.mts | 19 + src/version2/models/pageScreenWithTab.ts | 19 - src/version2/models/pageSecurityLevel.mts | 19 + src/version2/models/pageSecurityLevel.ts | 19 - .../models/pageSecurityLevelMember.mts | 19 + .../models/pageSecurityLevelMember.ts | 19 - .../models/pageSecuritySchemeWithProjects.mts | 19 + .../models/pageSecuritySchemeWithProjects.ts | 19 - .../models/{pageString.ts => pageString.mts} | 0 .../models/pageUiModificationDetails.mts | 19 + .../models/pageUiModificationDetails.ts | 19 - src/version2/models/pageUser.mts | 19 + src/version2/models/pageUser.ts | 19 - src/version2/models/pageUserDetails.mts | 19 + src/version2/models/pageUserDetails.ts | 19 - src/version2/models/pageUserKey.mts | 19 + src/version2/models/pageUserKey.ts | 19 - src/version2/models/pageVersion.mts | 19 + src/version2/models/pageVersion.ts | 19 - src/version2/models/pageWebhook.mts | 19 + src/version2/models/pageWebhook.ts | 19 - src/version2/models/pageWorkflow.mts | 19 + src/version2/models/pageWorkflow.ts | 19 - src/version2/models/pageWorkflowScheme.mts | 19 + src/version2/models/pageWorkflowScheme.ts | 19 - .../models/pageWorkflowTransitionRules.mts | 19 + .../models/pageWorkflowTransitionRules.ts | 19 - .../pagedListUserDetailsApplicationUser.mts | 18 + .../pagedListUserDetailsApplicationUser.ts | 18 - src/version2/models/parsedJqlQueries.mts | 7 + src/version2/models/parsedJqlQueries.ts | 7 - src/version2/models/parsedJqlQuery.mts | 10 + src/version2/models/parsedJqlQuery.ts | 10 - src/version2/models/permissionDetails.mts | 9 + src/version2/models/permissionDetails.ts | 9 - src/version2/models/permissionGrant.mts | 19 + src/version2/models/permissionGrant.ts | 19 - src/version2/models/permissionGrants.mts | 9 + src/version2/models/permissionGrants.ts | 9 - ...rmissionHolder.ts => permissionHolder.mts} | 0 src/version2/models/permissionScheme.mts | 22 + src/version2/models/permissionScheme.ts | 22 - src/version2/models/permissionSchemes.mts | 7 + src/version2/models/permissionSchemes.ts | 7 - .../{permissions.ts => permissions.mts} | 0 ...permissionsKeys.ts => permissionsKeys.mts} | 0 src/version2/models/permittedProjects.mts | 7 + src/version2/models/permittedProjects.ts | 7 - .../models/{priority.ts => priority.mts} | 0 .../models/{priorityId.ts => priorityId.mts} | 0 src/version2/models/project.mts | 80 ++ src/version2/models/project.ts | 80 -- ...ypePair.ts => projectAndIssueTypePair.mts} | 0 src/version2/models/projectAvatars.mts | 9 + src/version2/models/projectAvatars.ts | 9 - ...projectCategory.ts => projectCategory.mts} | 0 src/version2/models/projectComponent.mts | 66 + src/version2/models/projectComponent.ts | 66 - src/version2/models/projectDetails.mts | 24 + src/version2/models/projectDetails.ts | 24 - ...mailAddress.ts => projectEmailAddress.mts} | 0 .../{projectFeature.ts => projectFeature.mts} | 0 ...est.ts => projectFeatureToggleRequest.mts} | 0 .../models/{projectId.ts => projectId.mts} | 0 ...ectIdentifier.ts => projectIdentifier.mts} | 0 ...tIdentifiers.ts => projectIdentifiers.mts} | 0 .../models/{projectIds.ts => projectIds.mts} | 0 .../{projectInsight.ts => projectInsight.mts} | 0 .../models/projectIssueCreateMetadata.mts | 19 + .../models/projectIssueCreateMetadata.ts | 19 - .../models/projectIssueSecurityLevels.mts | 7 + .../models/projectIssueSecurityLevels.ts | 7 - .../models/projectIssueTypeHierarchy.mts | 9 + .../models/projectIssueTypeHierarchy.ts | 9 - ...Mapping.ts => projectIssueTypeMapping.mts} | 0 .../models/projectIssueTypeMappings.mts | 7 + .../models/projectIssueTypeMappings.ts | 7 - src/version2/models/projectIssueTypes.mts | 8 + src/version2/models/projectIssueTypes.ts | 8 - .../projectIssueTypesHierarchyLevel.mts | 11 + .../models/projectIssueTypesHierarchyLevel.ts | 11 - ...PageInfo.ts => projectLandingPageInfo.mts} | 0 ...tPermissions.ts => projectPermissions.mts} | 0 src/version2/models/projectRole.mts | 27 + src/version2/models/projectRole.ts | 27 - ...sUpdate.ts => projectRoleActorsUpdate.mts} | 0 src/version2/models/projectRoleDetails.mts | 22 + src/version2/models/projectRoleDetails.ts | 22 - ...ojectRoleGroup.ts => projectRoleGroup.mts} | 0 ...projectRoleUser.ts => projectRoleUser.mts} | 0 .../{projectScope.ts => projectScope.mts} | 0 .../{projectType.ts => projectType.mts} | 0 .../{propertyKey.ts => propertyKey.mts} | 0 src/version2/models/propertyKeys.mts | 7 + src/version2/models/propertyKeys.ts | 7 - ...dWorkflowId.ts => publishedWorkflowId.mts} | 0 ...steredWebhook.ts => registeredWebhook.mts} | 0 src/version2/models/remoteIssueLink.mts | 16 + src/version2/models/remoteIssueLink.ts | 16 - ...ifies.ts => remoteIssueLinkIdentifies.mts} | 0 .../models/remoteIssueLinkRequest.mts | 23 + src/version2/models/remoteIssueLinkRequest.ts | 23 - src/version2/models/remoteObject.mts | 14 + src/version2/models/remoteObject.ts | 14 - ...iorities.ts => reorderIssuePriorities.mts} | 0 ....ts => reorderIssueResolutionsRequest.mts} | 0 .../models/{resolution.ts => resolution.mts} | 0 .../{resolutionId.ts => resolutionId.mts} | 0 ...Permission.ts => restrictedPermission.mts} | 0 .../models/{richText.ts => richText.mts} | 0 src/version2/models/roleActor.mts | 25 + src/version2/models/roleActor.ts | 25 - ...Configuration.ts => ruleConfiguration.mts} | 0 src/version2/models/sanitizedJqlQueries.mts | 7 + src/version2/models/sanitizedJqlQueries.ts | 7 - src/version2/models/sanitizedJqlQuery.mts | 12 + src/version2/models/sanitizedJqlQuery.ts | 12 - src/version2/models/scope.mts | 11 + src/version2/models/scope.ts | 11 - src/version2/models/screen.mts | 12 + src/version2/models/screen.ts | 12 - .../{screenDetails.ts => screenDetails.mts} | 0 src/version2/models/screenScheme.mts | 14 + src/version2/models/screenScheme.ts | 14 - src/version2/models/screenSchemeDetails.mts | 10 + src/version2/models/screenSchemeDetails.ts | 10 - .../{screenSchemeId.ts => screenSchemeId.mts} | 0 .../{screenTypes.ts => screenTypes.mts} | 0 src/version2/models/screenWithTab.mts | 14 + src/version2/models/screenWithTab.ts | 14 - ...screenableField.ts => screenableField.mts} | 0 .../{screenableTab.ts => screenableTab.mts} | 0 ...AutoComplete.ts => searchAutoComplete.mts} | 0 src/version2/models/searchRequest.mts | 80 ++ src/version2/models/searchRequest.ts | 80 -- src/version2/models/searchResults.mts | 21 + src/version2/models/searchResults.ts | 21 - .../{securityLevel.ts => securityLevel.mts} | 0 src/version2/models/securityLevelMember.mts | 12 + src/version2/models/securityLevelMember.ts | 12 - src/version2/models/securityScheme.mts | 16 + src/version2/models/securityScheme.ts | 16 - ...curitySchemeId.ts => securitySchemeId.mts} | 0 src/version2/models/securitySchemeLevel.mts | 12 + src/version2/models/securitySchemeLevel.ts | 12 - ...ember.ts => securitySchemeLevelMember.mts} | 0 .../models/securitySchemeMembersRequest.mts | 7 + .../models/securitySchemeMembersRequest.ts | 7 - ...ects.ts => securitySchemeWithProjects.mts} | 0 src/version2/models/securitySchemes.mts | 7 + src/version2/models/securitySchemes.ts | 7 - ...erInformation.ts => serverInformation.mts} | 0 .../models/setDefaultLevelsRequest.mts | 7 + .../models/setDefaultLevelsRequest.ts | 7 - ...quest.ts => setDefaultPriorityRequest.mts} | 0 ...est.ts => setDefaultResolutionRequest.mts} | 0 src/version2/models/sharePermission.mts | 28 + src/version2/models/sharePermission.ts | 28 - ...ssionInput.ts => sharePermissionInput.mts} | 0 ...perty.ts => simpleApplicationProperty.mts} | 0 .../models/{simpleLink.ts => simpleLink.mts} | 0 .../simpleListWrapperApplicationRole.mts | 10 + .../simpleListWrapperApplicationRole.ts | 10 - .../models/simpleListWrapperGroupName.mts | 10 + .../models/simpleListWrapperGroupName.ts | 10 - src/version2/models/status.mts | 11 + src/version2/models/status.ts | 11 - .../{statusCategory.ts => statusCategory.mts} | 0 .../{statusCreate.ts => statusCreate.mts} | 0 src/version2/models/statusCreateRequest.mts | 9 + src/version2/models/statusCreateRequest.ts | 9 - src/version2/models/statusDetails.mts | 16 + src/version2/models/statusDetails.ts | 16 - src/version2/models/statusLayoutUpdate.mts | 10 + src/version2/models/statusLayoutUpdate.ts | 10 - .../{statusMapping.ts => statusMapping.mts} | 0 src/version2/models/statusMappingDTO.mts | 11 + src/version2/models/statusMappingDTO.ts | 11 - ...statusMigration.ts => statusMigration.mts} | 0 ...eAndPort.ts => statusReferenceAndPort.mts} | 0 src/version2/models/statusScope.mts | 8 + src/version2/models/statusScope.ts | 8 - .../{statusUpdate.ts => statusUpdate.mts} | 0 src/version2/models/statusUpdateRequest.mts | 7 + src/version2/models/statusUpdateRequest.ts | 7 - .../{suggestedIssue.ts => suggestedIssue.mts} | 0 src/version2/models/systemAvatars.mts | 7 + src/version2/models/systemAvatars.ts | 7 - src/version2/models/tabMetadata.mts | 9 + src/version2/models/tabMetadata.ts | 9 - ...ogressObject.ts => taskProgressObject.mts} | 0 ...ation.ts => timeTrackingConfiguration.mts} | 0 ...kingDetails.ts => timeTrackingDetails.mts} | 0 ...ngProvider.ts => timeTrackingProvider.mts} | 0 src/version2/models/transition.mts | 22 + src/version2/models/transition.ts | 22 - ...Details.ts => transitionScreenDetails.mts} | 0 src/version2/models/transitionUpdateDTO.mts | 31 + src/version2/models/transitionUpdateDTO.ts | 31 - src/version2/models/transitions.mts | 9 + src/version2/models/transitions.ts | 9 - ...ls.ts => uiModificationContextDetails.mts} | 0 src/version2/models/uiModificationDetails.mts | 17 + src/version2/models/uiModificationDetails.ts | 17 - ...fiers.ts => uiModificationIdentifiers.mts} | 0 ...UserEmail.ts => unrestrictedUserEmail.mts} | 0 ...etails.ts => updateCustomFieldDetails.mts} | 0 ...updateFieldConfigurationSchemeDetails.mts} | 0 ...ts => updateIssueSecurityLevelDetails.mts} | 0 ...s => updateIssueSecuritySchemeRequest.mts} | 0 ...ts => updateNotificationSchemeDetails.mts} | 0 ...tyDetails.ts => updatePriorityDetails.mts} | 0 ...ectDetails.ts => updateProjectDetails.mts} | 0 ...Details.ts => updateResolutionDetails.mts} | 0 ...reenDetails.ts => updateScreenDetails.mts} | 0 .../models/updateScreenSchemeDetails.mts | 10 + .../models/updateScreenSchemeDetails.ts | 10 - ...teScreenTypes.ts => updateScreenTypes.mts} | 0 .../models/updateUiModificationDetails.mts | 16 + .../models/updateUiModificationDetails.ts | 16 - ...teUserToGroup.ts => updateUserToGroup.mts} | 0 ...Category.ts => updatedProjectCategory.mts} | 0 src/version2/models/user.mts | 62 + src/version2/models/user.ts | 62 - .../{userAvatarUrls.ts => userAvatarUrls.mts} | 0 src/version2/models/userDetails.mts | 51 + src/version2/models/userDetails.ts | 51 - .../models/{userKey.ts => userKey.mts} | 0 src/version2/models/userList.mts | 18 + src/version2/models/userList.ts | 18 - .../{userMigration.ts => userMigration.mts} | 0 .../{userPickerUser.ts => userPickerUser.mts} | 0 ...eate.ts => validationOptionsForCreate.mts} | 0 ...date.ts => validationOptionsForUpdate.mts} | 0 src/version2/models/version.mts | 71 ++ src/version2/models/version.ts | 71 -- src/version2/models/versionIssueCounts.mts | 15 + src/version2/models/versionIssueCounts.ts | 15 - ...ssuesStatus.ts => versionIssuesStatus.mts} | 0 .../{versionMove.ts => versionMove.mts} | 0 ...nt.ts => versionUnresolvedIssuesCount.mts} | 0 ...Field.ts => versionUsageInCustomField.mts} | 0 .../models/{visibility.ts => visibility.mts} | 0 src/version2/models/votes.mts | 16 + src/version2/models/votes.ts | 16 - ...ingCollection.ts => warningCollection.mts} | 0 src/version2/models/watchers.mts | 13 + src/version2/models/watchers.ts | 13 - src/version2/models/webhook.mts | 26 + src/version2/models/webhook.ts | 26 - src/version2/models/webhookDetails.mts | 25 + src/version2/models/webhookDetails.ts | 25 - .../models/webhookRegistrationDetails.mts | 12 + .../models/webhookRegistrationDetails.ts | 12 - ...tionDate.ts => webhooksExpirationDate.mts} | 0 src/version2/models/workflow.mts | 30 + src/version2/models/workflow.ts | 30 - src/version2/models/workflowCapabilities.mts | 22 + src/version2/models/workflowCapabilities.ts | 22 - ...flowCondition.ts => workflowCondition.mts} | 0 src/version2/models/workflowCreate.mts | 16 + src/version2/models/workflowCreate.ts | 16 - src/version2/models/workflowCreateRequest.mts | 12 + src/version2/models/workflowCreateRequest.ts | 12 - .../models/workflowCreateResponse.mts | 10 + src/version2/models/workflowCreateResponse.ts | 10 - .../models/workflowElementReference.mts | 14 + .../models/workflowElementReference.ts | 14 - .../models/{workflowId.ts => workflowId.mts} | 0 .../{workflowLayout.ts => workflowLayout.mts} | 0 ...owOperations.ts => workflowOperations.mts} | 0 src/version2/models/workflowRead.mts | 10 + src/version2/models/workflowRead.ts | 10 - .../models/workflowReferenceStatus.mts | 12 + .../models/workflowReferenceStatus.ts | 12 - ...ation.ts => workflowRuleConfiguration.mts} | 0 src/version2/models/workflowRules.mts | 11 + src/version2/models/workflowRules.ts | 11 - ...RulesSearch.ts => workflowRulesSearch.mts} | 0 .../models/workflowRulesSearchDetails.mts | 11 + .../models/workflowRulesSearchDetails.ts | 11 - src/version2/models/workflowScheme.mts | 61 + src/version2/models/workflowScheme.ts | 61 - .../models/workflowSchemeAssociations.mts | 8 + .../models/workflowSchemeAssociations.ts | 8 - ...hemeIdName.ts => workflowSchemeIdName.mts} | 0 ...s => workflowSchemeProjectAssociation.mts} | 0 src/version2/models/workflowScope.mts | 8 + src/version2/models/workflowScope.ts | 8 - src/version2/models/workflowStatus.mts | 14 + src/version2/models/workflowStatus.ts | 14 - ...usAndPort.ts => workflowStatusAndPort.mts} | 0 ...atusLayout.ts => workflowStatusLayout.mts} | 0 ...erties.ts => workflowStatusProperties.mts} | 0 ...atusUpdate.ts => workflowStatusUpdate.mts} | 0 ...owTransition.ts => workflowTransition.mts} | 0 ...erty.ts => workflowTransitionProperty.mts} | 0 ...tionRule.ts => workflowTransitionRule.mts} | 0 .../models/workflowTransitionRules.mts | 13 + .../models/workflowTransitionRules.ts | 13 - .../models/workflowTransitionRulesDetails.mts | 8 + .../models/workflowTransitionRulesDetails.ts | 8 - .../models/workflowTransitionRulesUpdate.mts | 7 + .../models/workflowTransitionRulesUpdate.ts | 7 - ...kflowTransitionRulesUpdateErrorDetails.mts | 16 + ...rkflowTransitionRulesUpdateErrorDetails.ts | 16 - .../workflowTransitionRulesUpdateErrors.mts | 7 + .../workflowTransitionRulesUpdateErrors.ts | 7 - src/version2/models/workflowTransitions.mts | 31 + src/version2/models/workflowTransitions.ts | 31 - ...workflowTrigger.ts => workflowTrigger.mts} | 0 src/version2/models/workflowUpdate.mts | 24 + src/version2/models/workflowUpdate.ts | 24 - src/version2/models/workflowUpdateRequest.mts | 10 + src/version2/models/workflowUpdateRequest.ts | 10 - .../models/workflowUpdateResponse.mts | 11 + src/version2/models/workflowUpdateResponse.ts | 11 - .../models/workflowValidationError.mts | 14 + .../models/workflowValidationError.ts | 14 - .../models/workflowValidationErrorList.mts | 6 + .../models/workflowValidationErrorList.ts | 6 - .../workflowsWithTransitionRulesDetails.mts | 7 + .../workflowsWithTransitionRulesDetails.ts | 7 - src/version2/models/worklog.mts | 40 + src/version2/models/worklog.ts | 40 - ...logIdsRequest.ts => worklogIdsRequest.mts} | 0 src/version2/myself.mts | 234 ++++ src/version2/myself.ts | 234 ---- src/version2/parameters/addActorUsers.mts | 11 + src/version2/parameters/addActorUsers.ts | 11 - .../{addAttachment.ts => addAttachment.mts} | 0 src/version2/parameters/addComment.mts | 12 + src/version2/parameters/addComment.ts | 12 - ...tScreen.ts => addFieldToDefaultScreen.mts} | 0 src/version2/parameters/addGadget.mts | 6 + src/version2/parameters/addGadget.ts | 6 - .../parameters/addIssueTypesToContext.mts | 8 + .../parameters/addIssueTypesToContext.ts | 8 - .../addIssueTypesToIssueTypeScheme.mts | 6 + .../addIssueTypesToIssueTypeScheme.ts | 6 - .../parameters/addProjectRoleActorsToRole.mts | 9 + .../parameters/addProjectRoleActorsToRole.ts | 9 - src/version2/parameters/addScreenTab.mts | 6 + src/version2/parameters/addScreenTab.ts | 6 - src/version2/parameters/addScreenTabField.mts | 8 + src/version2/parameters/addScreenTabField.ts | 8 - src/version2/parameters/addSecurityLevel.mts | 6 + src/version2/parameters/addSecurityLevel.ts | 6 - .../parameters/addSecurityLevelMembers.mts | 8 + .../parameters/addSecurityLevelMembers.ts | 8 - .../parameters/addSharePermission.mts | 6 + src/version2/parameters/addSharePermission.ts | 6 - src/version2/parameters/addUserToGroup.mts | 11 + src/version2/parameters/addUserToGroup.ts | 11 - .../parameters/{addVote.ts => addVote.mts} | 0 .../{addWatcher.ts => addWatcher.mts} | 0 src/version2/parameters/addWorklog.mts | 39 + src/version2/parameters/addWorklog.ts | 39 - src/version2/parameters/analyseExpression.mts | 17 + src/version2/parameters/analyseExpression.ts | 17 - ...appendMappingsForIssueTypeScreenScheme.mts | 6 + .../appendMappingsForIssueTypeScreenScheme.ts | 6 - .../{archiveIssues.ts => archiveIssues.mts} | 0 ...eIssuesAsync.ts => archiveIssuesAsync.mts} | 0 .../{archiveProject.ts => archiveProject.mts} | 0 ...ssignFieldConfigurationSchemeToProject.mts | 3 + ...assignFieldConfigurationSchemeToProject.ts | 3 - src/version2/parameters/assignIssue.mts | 15 + src/version2/parameters/assignIssue.ts | 15 - .../assignIssueTypeSchemeToProject.mts | 3 + .../assignIssueTypeSchemeToProject.ts | 3 - .../assignIssueTypeScreenSchemeToProject.mts | 3 + .../assignIssueTypeScreenSchemeToProject.ts | 3 - .../parameters/assignPermissionScheme.mts | 27 + .../parameters/assignPermissionScheme.ts | 27 - .../assignProjectsToCustomFieldContext.mts | 8 + .../assignProjectsToCustomFieldContext.ts | 8 - .../parameters/assignSchemeToProject.mts | 3 + .../parameters/assignSchemeToProject.ts | 3 - .../parameters/associateSchemesToProjects.mts | 11 + .../parameters/associateSchemesToProjects.ts | 11 - .../parameters/bulkDeleteIssueProperty.mts | 6 + .../parameters/bulkDeleteIssueProperty.ts | 6 - .../parameters/bulkEditDashboards.mts | 13 + src/version2/parameters/bulkEditDashboards.ts | 13 - .../{bulkGetGroups.ts => bulkGetGroups.mts} | 0 .../{bulkGetUsers.ts => bulkGetUsers.mts} | 0 ...Migration.ts => bulkGetUsersMigration.mts} | 0 .../bulkSetIssuePropertiesByIssue.mts | 3 + .../bulkSetIssuePropertiesByIssue.ts | 3 - .../parameters/bulkSetIssueProperty.mts | 6 + .../parameters/bulkSetIssueProperty.ts | 6 - .../parameters/bulkSetIssuesProperties.mts | 3 + .../parameters/bulkSetIssuesProperties.ts | 3 - .../{cancelTask.ts => cancelTask.mts} | 0 ...geFilterOwner.ts => changeFilterOwner.mts} | 0 src/version2/parameters/copyDashboard.mts | 5 + src/version2/parameters/copyDashboard.ts | 5 - src/version2/parameters/createComponent.mts | 3 + src/version2/parameters/createComponent.ts | 3 - src/version2/parameters/createCustomField.mts | 3 + src/version2/parameters/createCustomField.ts | 3 - ...ontext.ts => createCustomFieldContext.mts} | 0 .../parameters/createCustomFieldOption.mts | 8 + .../parameters/createCustomFieldOption.ts | 8 - src/version2/parameters/createDashboard.mts | 6 + src/version2/parameters/createDashboard.ts | 6 - .../parameters/createFieldConfiguration.mts | 3 + .../parameters/createFieldConfiguration.ts | 3 - .../createFieldConfigurationScheme.mts | 3 + .../createFieldConfigurationScheme.ts | 3 - src/version2/parameters/createFilter.mts | 23 + src/version2/parameters/createFilter.ts | 23 - src/version2/parameters/createGroup.mts | 5 + src/version2/parameters/createGroup.ts | 5 - src/version2/parameters/createIssue.mts | 62 + src/version2/parameters/createIssue.ts | 62 - .../parameters/createIssueFieldOption.mts | 14 + .../parameters/createIssueFieldOption.ts | 14 - .../parameters/createIssueLinkType.mts | 3 + .../parameters/createIssueLinkType.ts | 3 - .../parameters/createIssueSecurityScheme.mts | 3 + .../parameters/createIssueSecurityScheme.ts | 3 - src/version2/parameters/createIssueType.mts | 3 + src/version2/parameters/createIssueType.ts | 3 - ...ypeAvatar.ts => createIssueTypeAvatar.mts} | 0 .../parameters/createIssueTypeScheme.mts | 3 + .../parameters/createIssueTypeScheme.ts | 3 - .../createIssueTypeScreenScheme.mts | 3 + .../parameters/createIssueTypeScreenScheme.ts | 3 - src/version2/parameters/createIssues.mts | 3 + src/version2/parameters/createIssues.ts | 3 - .../parameters/createNotificationScheme.mts | 3 + .../parameters/createNotificationScheme.ts | 3 - .../createOrUpdateRemoteIssueLink.mts | 6 + .../createOrUpdateRemoteIssueLink.ts | 6 - .../parameters/createPermissionGrant.mts | 16 + .../parameters/createPermissionGrant.ts | 16 - .../parameters/createPermissionScheme.mts | 25 + .../parameters/createPermissionScheme.ts | 25 - src/version2/parameters/createPriority.mts | 3 + src/version2/parameters/createPriority.ts | 3 - src/version2/parameters/createProject.mts | 3 + src/version2/parameters/createProject.ts | 3 - ...ojectAvatar.ts => createProjectAvatar.mts} | 0 .../parameters/createProjectCategory.mts | 3 + .../parameters/createProjectCategory.ts | 3 - src/version2/parameters/createProjectRole.mts | 3 + src/version2/parameters/createProjectRole.ts | 3 - src/version2/parameters/createResolution.mts | 5 + src/version2/parameters/createResolution.ts | 5 - src/version2/parameters/createScreen.mts | 3 + src/version2/parameters/createScreen.ts | 3 - .../parameters/createScreenScheme.mts | 3 + src/version2/parameters/createScreenScheme.ts | 3 - src/version2/parameters/createStatuses.mts | 3 + src/version2/parameters/createStatuses.ts | 3 - .../parameters/createUiModification.mts | 3 + .../parameters/createUiModification.ts | 3 - src/version2/parameters/createUser.mts | 3 + src/version2/parameters/createUser.ts | 3 - src/version2/parameters/createVersion.mts | 3 + src/version2/parameters/createVersion.ts | 3 - src/version2/parameters/createWorkflow.mts | 3 + src/version2/parameters/createWorkflow.ts | 3 - .../parameters/createWorkflowScheme.mts | 3 + .../parameters/createWorkflowScheme.ts | 3 - ...> createWorkflowSchemeDraftFromParent.mts} | 0 .../createWorkflowTransitionProperty.mts | 21 + .../createWorkflowTransitionProperty.ts | 21 - src/version2/parameters/createWorkflows.mts | 3 + src/version2/parameters/createWorkflows.ts | 3 - .../{deleteActor.ts => deleteActor.mts} | 0 ...donProperty.ts => deleteAddonProperty.mts} | 0 .../parameters/deleteAndReplaceVersion.mts | 15 + .../parameters/deleteAndReplaceVersion.ts | 15 - ...teAppProperty.ts => deleteAppProperty.mts} | 0 .../{deleteAvatar.ts => deleteAvatar.mts} | 0 .../{deleteComment.ts => deleteComment.mts} | 0 ...tProperty.ts => deleteCommentProperty.mts} | 0 ...deleteComponent.ts => deleteComponent.mts} | 0 ...teCustomField.ts => deleteCustomField.mts} | 0 ...ontext.ts => deleteCustomFieldContext.mts} | 0 ...dOption.ts => deleteCustomFieldOption.mts} | 0 ...deleteDashboard.ts => deleteDashboard.mts} | 0 ...rty.ts => deleteDashboardItemProperty.mts} | 0 ...tWorkflow.ts => deleteDefaultWorkflow.mts} | 0 ...flow.ts => deleteDraftDefaultWorkflow.mts} | 0 ...ping.ts => deleteDraftWorkflowMapping.mts} | 0 ...Filter.ts => deleteFavouriteForFilter.mts} | 0 ...ration.ts => deleteFieldConfiguration.mts} | 0 ....ts => deleteFieldConfigurationScheme.mts} | 0 .../{deleteFilter.ts => deleteFilter.mts} | 0 ...Workflow.ts => deleteInactiveWorkflow.mts} | 0 .../{deleteIssue.ts => deleteIssue.mts} | 0 ...ldOption.ts => deleteIssueFieldOption.mts} | 0 ...deleteIssueLink.ts => deleteIssueLink.mts} | 0 ...sueLinkType.ts => deleteIssueLinkType.mts} | 0 ...sueProperty.ts => deleteIssueProperty.mts} | 0 ...deleteIssueType.ts => deleteIssueType.mts} | 0 ...roperty.ts => deleteIssueTypeProperty.mts} | 0 ...ypeScheme.ts => deleteIssueTypeScheme.mts} | 0 ...eme.ts => deleteIssueTypeScreenScheme.mts} | 0 ...Scheme.ts => deleteNotificationScheme.mts} | 0 ...onScheme.ts => deletePermissionScheme.mts} | 0 ...ty.ts => deletePermissionSchemeEntity.mts} | 0 .../{deleteProject.ts => deleteProject.mts} | 0 ...sly.ts => deleteProjectAsynchronously.mts} | 0 ...ojectAvatar.ts => deleteProjectAvatar.mts} | 0 ...tProperty.ts => deleteProjectProperty.mts} | 0 ...teProjectRole.ts => deleteProjectRole.mts} | 0 ...ts => deleteProjectRoleActorsFromRole.mts} | 0 ...ts => deleteRemoteIssueLinkByGlobalId.mts} | 0 ...kById.ts => deleteRemoteIssueLinkById.mts} | 0 ...leteResolution.ts => deleteResolution.mts} | 0 .../{deleteScreen.ts => deleteScreen.mts} | 0 ...ScreenScheme.ts => deleteScreenScheme.mts} | 0 ...deleteScreenTab.ts => deleteScreenTab.mts} | 0 ...rityScheme.ts => deleteSecurityScheme.mts} | 0 ...ermission.ts => deleteSharePermission.mts} | 0 ...StatusesById.ts => deleteStatusesById.mts} | 0 ...dification.ts => deleteUiModification.mts} | 0 ...UserProperty.ts => deleteUserProperty.mts} | 0 src/version2/parameters/deleteWebhookById.mts | 3 + src/version2/parameters/deleteWebhookById.ts | 3 - ...owMapping.ts => deleteWorkflowMapping.mts} | 0 ...flowScheme.ts => deleteWorkflowScheme.mts} | 0 ...Draft.ts => deleteWorkflowSchemeDraft.mts} | 0 ...=> deleteWorkflowSchemeDraftIssueType.mts} | 0 ...e.ts => deleteWorkflowSchemeIssueType.mts} | 0 ...s => deleteWorkflowTransitionProperty.mts} | 0 ...teWorkflowTransitionRuleConfigurations.mts | 3 + ...eteWorkflowTransitionRuleConfigurations.ts | 3 - .../{deleteWorklog.ts => deleteWorklog.mts} | 0 ...gProperty.ts => deleteWorklogProperty.mts} | 0 src/version2/parameters/doTransition.mts | 6 + src/version2/parameters/doTransition.ts | 6 - src/version2/parameters/editIssue.mts | 31 + src/version2/parameters/editIssue.ts | 31 - .../parameters/evaluateJiraExpression.mts | 13 + .../parameters/evaluateJiraExpression.ts | 13 - ...umans.ts => expandAttachmentForHumans.mts} | 0 ...nes.ts => expandAttachmentForMachines.mts} | 0 .../parameters/exportArchivedIssues.mts | 14 + .../parameters/exportArchivedIssues.ts | 14 - ...gnableUsers.ts => findAssignableUsers.mts} | 0 ...leUsers.ts => findBulkAssignableUsers.mts} | 0 .../{findGroups.ts => findGroups.mts} | 0 ...KeysByQuery.ts => findUserKeysByQuery.mts} | 0 .../{findUsers.ts => findUsers.mts} | 0 ...ersAndGroups.ts => findUsersAndGroups.mts} | 0 ...ndUsersByQuery.ts => findUsersByQuery.mts} | 0 ...ersForPicker.ts => findUsersForPicker.mts} | 0 ...ons.ts => findUsersWithAllPermissions.mts} | 0 ...n.ts => findUsersWithBrowsePermission.mts} | 0 .../parameters/fullyUpdateProjectRole.mts | 9 + .../parameters/fullyUpdateProjectRole.ts | 9 - ...y.ts => getAccessibleProjectTypeByKey.mts} | 0 ...onProperties.ts => getAddonProperties.mts} | 0 ...tAddonProperty.ts => getAddonProperty.mts} | 0 ...tAllDashboards.ts => getAllDashboards.mts} | 0 ...ts => getAllFieldConfigurationSchemes.mts} | 0 ...tions.ts => getAllFieldConfigurations.mts} | 0 .../{getAllGadgets.ts => getAllGadgets.mts} | 0 ...Options.ts => getAllIssueFieldOptions.mts} | 0 ...eSchemes.ts => getAllIssueTypeSchemes.mts} | 0 .../{getAllLabels.ts => getAllLabels.mts} | 0 ...Schemes.ts => getAllPermissionSchemes.mts} | 0 ...ectAvatars.ts => getAllProjectAvatars.mts} | 0 ...TabFields.ts => getAllScreenTabFields.mts} | 0 ...tAllScreenTabs.ts => getAllScreenTabs.mts} | 0 .../{getAllStatuses.ts => getAllStatuses.mts} | 0 ...stemAvatars.ts => getAllSystemAvatars.mts} | 0 .../{getAllUsers.ts => getAllUsers.mts} | 0 ...UsersDefault.ts => getAllUsersDefault.mts} | 0 ...owSchemes.ts => getAllWorkflowSchemes.mts} | 0 ...eTypes.ts => getAlternativeIssueTypes.mts} | 0 ...Property.ts => getApplicationProperty.mts} | 0 ...licationRole.ts => getApplicationRole.mts} | 0 ...eme.ts => getAssignedPermissionScheme.mts} | 0 .../{getAttachment.ts => getAttachment.mts} | 0 ...entContent.ts => getAttachmentContent.mts} | 0 ...humbnail.ts => getAttachmentThumbnail.mts} | 0 ...getAuditRecords.ts => getAuditRecords.mts} | 0 .../parameters/getAutoCompletePost.mts | 3 + .../parameters/getAutoCompletePost.ts | 3 - ...Fields.ts => getAvailableScreenFields.mts} | 0 ...tarImageByID.ts => getAvatarImageByID.mts} | 0 ...geByOwner.ts => getAvatarImageByOwner.mts} | 0 ...mageByType.ts => getAvatarImageByType.mts} | 0 .../{getAvatars.ts => getAvatars.mts} | 0 .../parameters/getBulkPermissions.mts | 3 + src/version2/parameters/getBulkPermissions.ts | 3 - .../{getChangeLogs.ts => getChangeLogs.mts} | 0 .../parameters/getChangeLogsByIds.mts | 6 + src/version2/parameters/getChangeLogsByIds.ts | 6 - .../{getColumns.ts => getColumns.mts} | 0 .../{getComment.ts => getComment.mts} | 0 ...mentProperty.ts => getCommentProperty.mts} | 0 ...ertyKeys.ts => getCommentPropertyKeys.mts} | 0 .../{getComments.ts => getComments.mts} | 0 src/version2/parameters/getCommentsByIds.mts | 11 + src/version2/parameters/getCommentsByIds.ts | 11 - .../{getComponent.ts => getComponent.mts} | 0 ...ssues.ts => getComponentRelatedIssues.mts} | 0 ...xtsForField.ts => getContextsForField.mts} | 0 ...ateIssueMeta.ts => getCreateIssueMeta.mts} | 0 .../{getCurrentUser.ts => getCurrentUser.mts} | 0 ...ion.ts => getCustomFieldConfiguration.mts} | 0 ...mFieldContextsForProjectsAndIssueTypes.mts | 10 + ...omFieldContextsForProjectsAndIssueTypes.ts | 10 - ...ieldOption.ts => getCustomFieldOption.mts} | 0 .../{getDashboard.ts => getDashboard.mts} | 0 ...operty.ts => getDashboardItemProperty.mts} | 0 ...ys.ts => getDashboardItemPropertyKeys.mts} | 0 ...aginated.ts => getDashboardsPaginated.mts} | 0 ...tDefaultValues.ts => getDefaultValues.mts} | 0 ...aultWorkflow.ts => getDefaultWorkflow.mts} | 0 ...orkflow.ts => getDraftDefaultWorkflow.mts} | 0 ...tDraftWorkflow.ts => getDraftWorkflow.mts} | 0 ...ForApp.ts => getDynamicWebhooksForApp.mts} | 0 ...tEditIssueMeta.ts => getEditIssueMeta.mts} | 0 ...ailedWebhooks.ts => getFailedWebhooks.mts} | 0 ...riteFilters.ts => getFavouriteFilters.mts} | 0 ...orProject.ts => getFeaturesForProject.mts} | 0 ...=> getFieldAutoCompleteForQueryString.mts} | 0 ...tems.ts => getFieldConfigurationItems.mts} | 0 ...> getFieldConfigurationSchemeMappings.mts} | 0 ...ieldConfigurationSchemeProjectMapping.mts} | 0 ...ldsPaginated.ts => getFieldsPaginated.mts} | 0 .../{getFilter.ts => getFilter.mts} | 0 .../parameters/getFiltersPaginated.mts | 115 ++ .../parameters/getFiltersPaginated.ts | 115 -- .../{getHierarchy.ts => getHierarchy.mts} | 0 ...ce.ts => getIdsOfWorklogsDeletedSince.mts} | 0 ...e.ts => getIdsOfWorklogsModifiedSince.mts} | 0 .../parameters/getIsWatchingIssueBulk.mts | 3 + .../parameters/getIsWatchingIssueBulk.ts | 3 - src/version2/parameters/getIssue.mts | 70 ++ src/version2/parameters/getIssue.ts | 70 -- ...FieldOption.ts => getIssueFieldOption.mts} | 0 .../{getIssueLink.ts => getIssueLink.mts} | 0 ...tIssueLinkType.ts => getIssueLinkType.mts} | 0 .../parameters/getIssuePickerResource.mts | 23 + .../parameters/getIssuePickerResource.ts | 23 - ...tIssueProperty.ts => getIssueProperty.mts} | 0 ...opertyKeys.ts => getIssuePropertyKeys.mts} | 0 ...rityLevel.ts => getIssueSecurityLevel.mts} | 0 ...rs.ts => getIssueSecurityLevelMembers.mts} | 0 ...tyScheme.ts => getIssueSecurityScheme.mts} | 0 .../{getIssueType.ts => getIssueType.mts} | 0 ...ts => getIssueTypeMappingsForContexts.mts} | 0 ...peProperty.ts => getIssueTypeProperty.mts} | 0 ...tyKeys.ts => getIssueTypePropertyKeys.mts} | 0 ...s.ts => getIssueTypeSchemeForProjects.mts} | 0 ...ping.ts => getIssueTypeSchemesMapping.mts} | 0 ...s => getIssueTypeScreenSchemeMappings.mts} | 0 ...ueTypeScreenSchemeProjectAssociations.mts} | 0 ...hemes.ts => getIssueTypeScreenSchemes.mts} | 0 ...Project.ts => getIssueTypesForProject.mts} | 0 ...tIssueWatchers.ts => getIssueWatchers.mts} | 0 ...getIssueWorklog.ts => getIssueWorklog.mts} | 0 .../{getMyFilters.ts => getMyFilters.mts} | 0 ...tMyPermissions.ts => getMyPermissions.mts} | 0 ...ionScheme.ts => getNotificationScheme.mts} | 0 ...ts => getNotificationSchemeForProject.mts} | 0 ...etNotificationSchemeToProjectMappings.mts} | 0 ...nSchemes.ts => getNotificationSchemes.mts} | 0 ...ForContext.ts => getOptionsForContext.mts} | 0 ...ssionScheme.ts => getPermissionScheme.mts} | 0 ...eGrant.ts => getPermissionSchemeGrant.mts} | 0 ...rants.ts => getPermissionSchemeGrants.mts} | 0 .../parameters/getPermittedProjects.mts | 3 + .../parameters/getPermittedProjects.ts | 3 - ...computations.ts => getPrecomputations.mts} | 0 .../{getPreference.ts => getPreference.mts} | 0 .../{getPriority.ts => getPriority.mts} | 0 .../{getProject.ts => getProject.mts} | 0 ...goryById.ts => getProjectCategoryById.mts} | 0 ...Components.ts => getProjectComponents.mts} | 0 ...d.ts => getProjectComponentsPaginated.mts} | 0 ...apping.ts => getProjectContextMapping.mts} | 0 ...getProjectEmail.ts => getProjectEmail.mts} | 0 ...e.ts => getProjectIssueSecurityScheme.mts} | 0 ...jectProperty.ts => getProjectProperty.mts} | 0 ...ertyKeys.ts => getProjectPropertyKeys.mts} | 0 .../{getProjectRole.ts => getProjectRole.mts} | 0 ...ole.ts => getProjectRoleActorsForRole.mts} | 0 ...jectRoleById.ts => getProjectRoleById.mts} | 0 ...leDetails.ts => getProjectRoleDetails.mts} | 0 ...getProjectRoles.ts => getProjectRoles.mts} | 0 ...ctTypeByKey.ts => getProjectTypeByKey.mts} | 0 ...jectVersions.ts => getProjectVersions.mts} | 0 ...ted.ts => getProjectVersionsPaginated.mts} | 0 ...> getProjectsForIssueTypeScreenScheme.mts} | 0 .../{getRecent.ts => getRecent.mts} | 0 ...LinkById.ts => getRemoteIssueLinkById.mts} | 0 ...eIssueLinks.ts => getRemoteIssueLinks.mts} | 0 ...tScreenSchemes.ts => getScreenSchemes.mts} | 0 .../{getScreens.ts => getScreens.mts} | 0 ...eensForField.ts => getScreensForField.mts} | 0 ...Members.ts => getSecurityLevelMembers.mts} | 0 ...ecurityLevels.ts => getSecurityLevels.mts} | 0 ...ect.ts => getSecurityLevelsForProject.mts} | 0 ....ts => getSelectableIssueFieldOptions.mts} | 0 ...rePermission.ts => getSharePermission.mts} | 0 ...Permissions.ts => getSharePermissions.mts} | 0 .../{getStatus.ts => getStatus.mts} | 0 ...tatusCategory.ts => getStatusCategory.mts} | 0 ...getStatusesById.ts => getStatusesById.mts} | 0 .../parameters/{getTask.ts => getTask.mts} | 0 .../{getTransitions.ts => getTransitions.mts} | 0 ...nated.ts => getTrashedFieldsPaginated.mts} | 0 ...odifications.ts => getUiModifications.mts} | 0 .../parameters/{getUser.ts => getUser.mts} | 0 ...ltColumns.ts => getUserDefaultColumns.mts} | 0 .../{getUserEmail.ts => getUserEmail.mts} | 0 ...tUserEmailBulk.ts => getUserEmailBulk.mts} | 0 .../{getUserGroups.ts => getUserGroups.mts} | 0 ...getUserProperty.ts => getUserProperty.mts} | 0 ...ropertyKeys.ts => getUserPropertyKeys.mts} | 0 ...sersFromGroup.ts => getUsersFromGroup.mts} | 0 ...idProjectKey.ts => getValidProjectKey.mts} | 0 ...ProjectName.ts => getValidProjectName.mts} | 0 .../{getVersion.ts => getVersion.mts} | 0 ...dIssues.ts => getVersionRelatedIssues.mts} | 0 ...sues.ts => getVersionUnresolvedIssues.mts} | 0 ...ons.ts => getVisibleIssueFieldOptions.mts} | 0 .../parameters/{getVotes.ts => getVotes.mts} | 0 .../{getWorkflow.ts => getWorkflow.mts} | 0 ...orkflowScheme.ts => getWorkflowScheme.mts} | 0 ...emeDraft.ts => getWorkflowSchemeDraft.mts} | 0 ...ts => getWorkflowSchemeDraftIssueType.mts} | 0 ...Type.ts => getWorkflowSchemeIssueType.mts} | 0 ... getWorkflowSchemeProjectAssociations.mts} | 0 ...ts => getWorkflowTransitionProperties.mts} | 0 ...tWorkflowTransitionRuleConfigurations.mts} | 0 ...Paginated.ts => getWorkflowsPaginated.mts} | 0 .../{getWorklog.ts => getWorklog.mts} | 0 ...klogProperty.ts => getWorklogProperty.mts} | 0 ...ertyKeys.ts => getWorklogPropertyKeys.mts} | 0 src/version2/parameters/getWorklogsForIds.mts | 10 + src/version2/parameters/getWorklogsForIds.ts | 10 - src/version2/parameters/index.mts | 469 +++++++ src/version2/parameters/index.ts | 469 ------- src/version2/parameters/linkIssues.mts | 3 + src/version2/parameters/linkIssues.ts | 3 - src/version2/parameters/matchIssues.mts | 3 + src/version2/parameters/matchIssues.ts | 3 - .../{mergeVersions.ts => mergeVersions.mts} | 0 src/version2/parameters/migrateQueries.mts | 3 + src/version2/parameters/migrateQueries.ts | 3 - src/version2/parameters/movePriorities.mts | 3 + src/version2/parameters/movePriorities.ts | 3 - src/version2/parameters/moveResolutions.mts | 3 + src/version2/parameters/moveResolutions.ts | 3 - .../{moveScreenTab.ts => moveScreenTab.mts} | 0 .../parameters/moveScreenTabField.mts | 10 + src/version2/parameters/moveScreenTabField.ts | 10 - src/version2/parameters/moveVersion.mts | 6 + src/version2/parameters/moveVersion.ts | 6 - src/version2/parameters/notify.mts | 6 + src/version2/parameters/notify.ts | 6 - src/version2/parameters/parseJqlQueries.mts | 13 + src/version2/parameters/parseJqlQueries.ts | 13 - .../parameters/partialUpdateProjectRole.mts | 9 + .../parameters/partialUpdateProjectRole.ts | 9 - .../parameters/publishDraftWorkflowScheme.mts | 9 + .../parameters/publishDraftWorkflowScheme.ts | 9 - ...tAddonProperty.ts => putAddonProperty.mts} | 0 .../{putAppProperty.ts => putAppProperty.mts} | 0 src/version2/parameters/readWorkflows.mts | 18 + src/version2/parameters/readWorkflows.ts | 18 - src/version2/parameters/refreshWebhooks.mts | 3 + src/version2/parameters/refreshWebhooks.ts | 3 - .../parameters/registerDynamicWebhooks.mts | 3 + .../parameters/registerDynamicWebhooks.ts | 3 - src/version2/parameters/registerModules.mts | 3 + src/version2/parameters/registerModules.ts | 3 - ...moveAttachment.ts => removeAttachment.mts} | 0 .../removeCustomFieldContextFromProjects.mts | 8 + .../removeCustomFieldContextFromProjects.ts | 8 - .../{removeGadget.ts => removeGadget.mts} | 0 .../{removeGroup.ts => removeGroup.mts} | 0 ...=> removeIssueTypeFromIssueTypeScheme.mts} | 0 .../removeIssueTypesFromContext.mts | 8 + .../parameters/removeIssueTypesFromContext.ts | 8 - ...ypesFromGlobalFieldConfigurationScheme.mts | 6 + ...TypesFromGlobalFieldConfigurationScheme.ts | 6 - .../{removeLevel.ts => removeLevel.mts} | 0 ...emoveMappingsFromIssueTypeScreenScheme.mts | 6 + ...removeMappingsFromIssueTypeScreenScheme.ts | 6 - ...l.ts => removeMemberFromSecurityLevel.mts} | 0 .../{removeModules.ts => removeModules.mts} | 0 ...oveNotificationFromNotificationScheme.mts} | 0 ...movePreference.ts => removePreference.mts} | 0 ...tCategory.ts => removeProjectCategory.mts} | 0 ...enTabField.ts => removeScreenTabField.mts} | 0 .../{removeUser.ts => removeUser.mts} | 0 ...erFromGroup.ts => removeUserFromGroup.mts} | 0 .../{removeVote.ts => removeVote.mts} | 0 .../{removeWatcher.ts => removeWatcher.mts} | 0 src/version2/parameters/renameScreenTab.mts | 8 + src/version2/parameters/renameScreenTab.ts | 8 - .../parameters/reorderCustomFieldOptions.mts | 8 + .../parameters/reorderCustomFieldOptions.ts | 8 - .../reorderIssueTypesInIssueTypeScheme.mts | 6 + .../reorderIssueTypesInIssueTypeScheme.ts | 6 - .../parameters/replaceIssueFieldOption.mts | 28 + .../parameters/replaceIssueFieldOption.ts | 28 - .../{resetColumns.ts => resetColumns.mts} | 0 ...setUserColumns.ts => resetUserColumns.mts} | 0 .../parameters/{restore.ts => restore.mts} | 0 ...eCustomField.ts => restoreCustomField.mts} | 0 .../parameters/sanitiseJqlQueries.mts | 3 + src/version2/parameters/sanitiseJqlQueries.ts | 3 - .../parameters/{search.ts => search.mts} | 0 .../parameters/searchForIssuesUsingJql.mts | 79 ++ .../parameters/searchForIssuesUsingJql.ts | 79 -- .../searchForIssuesUsingJqlPost.mts | 3 + .../parameters/searchForIssuesUsingJqlPost.ts | 3 - ...archPriorities.ts => searchPriorities.mts} | 0 .../{searchProjects.ts => searchProjects.mts} | 0 ...=> searchProjectsUsingSecuritySchemes.mts} | 0 ...chResolutions.ts => searchResolutions.mts} | 0 ...tySchemes.ts => searchSecuritySchemes.mts} | 0 .../selectTimeTrackingImplementation.mts | 3 + .../selectTimeTrackingImplementation.ts | 3 - src/version2/parameters/setActors.mts | 11 + src/version2/parameters/setActors.ts | 11 - .../parameters/setApplicationProperty.mts | 14 + .../parameters/setApplicationProperty.ts | 14 - src/version2/parameters/setBanner.mts | 3 + src/version2/parameters/setBanner.ts | 3 - .../{setColumns.ts => setColumns.mts} | 0 ...mentProperty.ts => setCommentProperty.mts} | 0 ...operty.ts => setDashboardItemProperty.mts} | 0 src/version2/parameters/setDefaultLevels.mts | 3 + src/version2/parameters/setDefaultLevels.ts | 3 - .../parameters/setDefaultPriority.mts | 3 + src/version2/parameters/setDefaultPriority.ts | 3 - .../parameters/setDefaultResolution.mts | 3 + .../parameters/setDefaultResolution.ts | 3 - .../parameters/setDefaultShareScope.mts | 3 + .../parameters/setDefaultShareScope.ts | 3 - src/version2/parameters/setDefaultValues.mts | 6 + src/version2/parameters/setDefaultValues.ts | 6 - ...ForFilter.ts => setFavouriteForFilter.mts} | 0 .../setFieldConfigurationSchemeMapping.mts | 6 + .../setFieldConfigurationSchemeMapping.ts | 6 - ...tIssueProperty.ts => setIssueProperty.mts} | 0 ...peProperty.ts => setIssueTypeProperty.mts} | 0 .../{setPreference.ts => setPreference.mts} | 0 ...jectProperty.ts => setProjectProperty.mts} | 0 .../setSharedTimeTrackingConfiguration.mts | 3 + .../setSharedTimeTrackingConfiguration.ts | 3 - .../{setUserColumns.ts => setUserColumns.mts} | 0 ...setUserProperty.ts => setUserProperty.mts} | 0 .../setWorkflowSchemeDraftIssueType.mts | 22 + .../setWorkflowSchemeDraftIssueType.ts | 22 - .../parameters/setWorkflowSchemeIssueType.mts | 24 + .../parameters/setWorkflowSchemeIssueType.ts | 24 - ...klogProperty.ts => setWorklogProperty.mts} | 0 .../{storeAvatar.ts => storeAvatar.mts} | 0 .../parameters/toggleFeatureForProject.mts | 8 + .../parameters/toggleFeatureForProject.ts | 8 - ...ashCustomField.ts => trashCustomField.mts} | 0 ...unarchiveIssues.ts => unarchiveIssues.mts} | 0 src/version2/parameters/updateComment.mts | 22 + src/version2/parameters/updateComment.ts | 22 - src/version2/parameters/updateComponent.mts | 6 + src/version2/parameters/updateComponent.ts | 6 - src/version2/parameters/updateCustomField.mts | 6 + src/version2/parameters/updateCustomField.ts | 6 - .../updateCustomFieldConfiguration.mts | 6 + .../updateCustomFieldConfiguration.ts | 6 - .../parameters/updateCustomFieldContext.mts | 8 + .../parameters/updateCustomFieldContext.ts | 8 - .../parameters/updateCustomFieldOption.mts | 8 + .../parameters/updateCustomFieldOption.ts | 8 - .../parameters/updateCustomFieldValue.mts | 8 + .../parameters/updateCustomFieldValue.ts | 8 - src/version2/parameters/updateDashboard.mts | 6 + src/version2/parameters/updateDashboard.ts | 6 - ...cheme.ts => updateDefaultScreenScheme.mts} | 0 .../parameters/updateDefaultWorkflow.mts | 6 + .../parameters/updateDefaultWorkflow.ts | 6 - .../parameters/updateDraftDefaultWorkflow.mts | 6 + .../parameters/updateDraftDefaultWorkflow.ts | 6 - .../parameters/updateDraftWorkflowMapping.mts | 8 + .../parameters/updateDraftWorkflowMapping.ts | 8 - .../updateEntityPropertiesValue.mts | 22 + .../parameters/updateEntityPropertiesValue.ts | 22 - .../parameters/updateFieldConfiguration.mts | 6 + .../parameters/updateFieldConfiguration.ts | 6 - .../updateFieldConfigurationItems.mts | 6 + .../updateFieldConfigurationItems.ts | 6 - .../updateFieldConfigurationScheme.mts | 6 + .../updateFieldConfigurationScheme.ts | 6 - src/version2/parameters/updateFilter.mts | 25 + src/version2/parameters/updateFilter.ts | 25 - src/version2/parameters/updateGadget.mts | 8 + src/version2/parameters/updateGadget.ts | 8 - .../parameters/updateIssueFieldOption.mts | 16 + .../parameters/updateIssueFieldOption.ts | 16 - src/version2/parameters/updateIssueFields.mts | 8 + src/version2/parameters/updateIssueFields.ts | 8 - .../parameters/updateIssueLinkType.mts | 6 + .../parameters/updateIssueLinkType.ts | 6 - .../parameters/updateIssueSecurityScheme.mts | 6 + .../parameters/updateIssueSecurityScheme.ts | 6 - src/version2/parameters/updateIssueType.mts | 6 + src/version2/parameters/updateIssueType.ts | 6 - .../parameters/updateIssueTypeScheme.mts | 6 + .../parameters/updateIssueTypeScheme.ts | 6 - .../updateIssueTypeScreenScheme.mts | 6 + .../parameters/updateIssueTypeScreenScheme.ts | 6 - .../updateMultipleCustomFieldValues.mts | 6 + .../updateMultipleCustomFieldValues.ts | 6 - .../parameters/updateNotificationScheme.mts | 6 + .../parameters/updateNotificationScheme.ts | 6 - .../parameters/updatePermissionScheme.mts | 16 + .../parameters/updatePermissionScheme.ts | 16 - .../parameters/updatePrecomputations.mts | 3 + .../parameters/updatePrecomputations.ts | 3 - src/version2/parameters/updatePriority.mts | 6 + src/version2/parameters/updatePriority.ts | 6 - src/version2/parameters/updateProject.mts | 57 + src/version2/parameters/updateProject.ts | 57 - .../parameters/updateProjectAvatar.mts | 6 + .../parameters/updateProjectAvatar.ts | 6 - .../parameters/updateProjectCategory.mts | 5 + .../parameters/updateProjectCategory.ts | 5 - .../parameters/updateProjectEmail.mts | 6 + src/version2/parameters/updateProjectEmail.ts | 6 - .../parameters/updateRemoteIssueLink.mts | 8 + .../parameters/updateRemoteIssueLink.ts | 8 - src/version2/parameters/updateResolution.mts | 6 + src/version2/parameters/updateResolution.ts | 6 - src/version2/parameters/updateScreen.mts | 6 + src/version2/parameters/updateScreen.ts | 6 - .../parameters/updateScreenScheme.mts | 6 + src/version2/parameters/updateScreenScheme.ts | 6 - .../parameters/updateSecurityLevel.mts | 8 + .../parameters/updateSecurityLevel.ts | 8 - src/version2/parameters/updateStatuses.mts | 3 + src/version2/parameters/updateStatuses.ts | 3 - .../parameters/updateUiModification.mts | 6 + .../parameters/updateUiModification.ts | 6 - src/version2/parameters/updateVersion.mts | 6 + src/version2/parameters/updateVersion.ts | 6 - .../parameters/updateWorkflowMapping.mts | 8 + .../parameters/updateWorkflowMapping.ts | 8 - .../parameters/updateWorkflowScheme.mts | 9 + .../parameters/updateWorkflowScheme.ts | 9 - .../parameters/updateWorkflowSchemeDraft.mts | 6 + .../parameters/updateWorkflowSchemeDraft.ts | 6 - .../updateWorkflowTransitionProperty.mts | 21 + .../updateWorkflowTransitionProperty.ts | 21 - ...teWorkflowTransitionRuleConfigurations.mts | 3 + ...ateWorkflowTransitionRuleConfigurations.ts | 3 - src/version2/parameters/updateWorkflows.mts | 12 + src/version2/parameters/updateWorkflows.ts | 12 - src/version2/parameters/updateWorklog.mts | 35 + src/version2/parameters/updateWorklog.ts | 35 - .../parameters/validateCreateWorkflows.mts | 6 + .../parameters/validateCreateWorkflows.ts | 6 - ...teProjectKey.ts => validateProjectKey.mts} | 0 .../parameters/validateUpdateWorkflows.mts | 6 + .../parameters/validateUpdateWorkflows.ts | 6 - ...pabilities.ts => workflowCapabilities.mts} | 0 .../parameters/workflowRuleSearch.mts | 6 + src/version2/parameters/workflowRuleSearch.ts | 6 - src/version2/permissionSchemes.mts | 560 +++++++++ src/version2/permissionSchemes.ts | 560 --------- src/version2/permissions.mts | 236 ++++ src/version2/permissions.ts | 236 ---- src/version2/projectAvatars.mts | 180 +++ src/version2/projectAvatars.ts | 180 --- src/version2/projectCategories.mts | 174 +++ src/version2/projectCategories.ts | 174 --- src/version2/projectComponents.mts | 313 +++++ src/version2/projectComponents.ts | 313 ----- src/version2/projectEmail.mts | 77 ++ src/version2/projectEmail.ts | 77 -- src/version2/projectFeatures.mts | 58 + src/version2/projectFeatures.ts | 58 - src/version2/projectKeyAndNameValidation.mts | 118 ++ src/version2/projectKeyAndNameValidation.ts | 118 -- src/version2/projectPermissionSchemes.mts | 168 +++ src/version2/projectPermissionSchemes.ts | 168 --- src/version2/projectProperties.mts | 174 +++ src/version2/projectProperties.ts | 174 --- src/version2/projectRoleActors.mts | 249 ++++ src/version2/projectRoleActors.ts | 249 ---- src/version2/projectRoles.mts | 422 +++++++ src/version2/projectRoles.ts | 422 ------- src/version2/projectTypes.mts | 119 ++ src/version2/projectTypes.ts | 119 -- src/version2/projectVersions.mts | 439 +++++++ src/version2/projectVersions.ts | 439 ------- src/version2/projects.mts | 565 +++++++++ src/version2/projects.ts | 565 --------- src/version2/screenSchemes.mts | 160 +++ src/version2/screenSchemes.ts | 160 --- src/version2/screenTabFields.mts | 150 +++ src/version2/screenTabFields.ts | 150 --- src/version2/screenTabs.mts | 166 +++ src/version2/screenTabs.ts | 166 --- src/version2/screens.mts | 243 ++++ src/version2/screens.ts | 243 ---- src/version2/serverInfo.mts | 33 + src/version2/serverInfo.ts | 33 - src/version2/status.mts | 196 +++ src/version2/status.ts | 196 --- src/version2/tasks.mts | 87 ++ src/version2/tasks.ts | 87 -- src/version2/timeTracking.mts | 169 +++ src/version2/timeTracking.ts | 169 --- src/version2/uIModificationsApps.ts | 171 --- src/version2/uiModificationsApps.mts | 171 +++ src/version2/userProperties.mts | 190 +++ src/version2/userProperties.ts | 190 --- src/version2/userSearch.mts | 608 +++++++++ src/version2/userSearch.ts | 608 --------- src/version2/users.mts | 495 ++++++++ src/version2/users.ts | 495 -------- src/version2/webhooks.mts | 221 ++++ src/version2/webhooks.ts | 221 ---- src/version2/workflowSchemeDrafts.mts | 542 ++++++++ src/version2/workflowSchemeDrafts.ts | 542 -------- .../workflowSchemeProjectAssociations.mts | 91 ++ .../workflowSchemeProjectAssociations.ts | 91 -- src/version2/workflowSchemes.mts | 596 +++++++++ src/version2/workflowSchemes.ts | 596 --------- src/version2/workflowStatusCategories.mts | 68 + src/version2/workflowStatusCategories.ts | 68 - src/version2/workflowStatuses.mts | 73 ++ src/version2/workflowStatuses.ts | 73 -- src/version2/workflowTransitionProperties.mts | 198 +++ src/version2/workflowTransitionProperties.ts | 198 --- src/version2/workflowTransitionRules.mts | 195 +++ src/version2/workflowTransitionRules.ts | 195 --- src/version2/workflows.mts | 400 ++++++ src/version2/workflows.ts | 400 ------ src/version3/announcementBanner.mts | 61 + src/version3/announcementBanner.ts | 61 - src/version3/appMigration.mts | 114 ++ src/version3/appMigration.ts | 114 -- src/version3/appProperties.mts | 223 ++++ src/version3/appProperties.ts | 223 ---- src/version3/applicationRoles.mts | 68 + src/version3/applicationRoles.ts | 68 - src/version3/auditRecords.mts | 79 ++ src/version3/auditRecords.ts | 79 -- src/version3/avatars.mts | 332 +++++ src/version3/avatars.ts | 332 ----- src/version3/client/index.ts | 1 - src/version3/client/version3Client.mts | 176 +++ src/version3/client/version3Client.ts | 178 --- src/version3/dashboards.mts | 729 +++++++++++ src/version3/dashboards.ts | 728 ----------- src/version3/dynamicModules.mts | 90 ++ src/version3/dynamicModules.ts | 90 -- src/version3/filterSharing.mts | 255 ++++ src/version3/filterSharing.ts | 255 ---- src/version3/filters.mts | 629 +++++++++ src/version3/filters.ts | 629 --------- src/version3/groupAndUserPicker.mts | 110 ++ src/version3/groupAndUserPicker.ts | 110 -- src/version3/groups.mts | 281 +++++ src/version3/groups.ts | 281 ----- src/version3/index.mts | 90 ++ src/version3/index.ts | 90 -- src/version3/instanceInformation.mts | 29 + src/version3/instanceInformation.ts | 29 - src/version3/issueAttachments.mts | 444 +++++++ src/version3/issueAttachments.ts | 446 ------- src/version3/issueCommentProperties.mts | 196 +++ src/version3/issueCommentProperties.ts | 196 --- src/version3/issueComments.mts | 324 +++++ src/version3/issueComments.ts | 324 ----- .../issueCustomFieldConfigurationApps.mts | 113 ++ .../issueCustomFieldConfigurationApps.ts | 113 -- src/version3/issueCustomFieldContexts.mts | 724 +++++++++++ src/version3/issueCustomFieldContexts.ts | 724 ----------- src/version3/issueCustomFieldOptions.mts | 301 +++++ src/version3/issueCustomFieldOptions.ts | 301 ----- src/version3/issueCustomFieldOptionsApps.mts | 407 ++++++ src/version3/issueCustomFieldOptionsApps.ts | 407 ------ src/version3/issueCustomFieldValuesApps.mts | 85 ++ src/version3/issueCustomFieldValuesApps.ts | 85 -- src/version3/issueFieldConfigurations.mts | 644 ++++++++++ src/version3/issueFieldConfigurations.ts | 644 ---------- src/version3/issueFields.mts | 319 +++++ src/version3/issueFields.ts | 319 ----- src/version3/issueLinkTypes.mts | 198 +++ src/version3/issueLinkTypes.ts | 198 --- src/version3/issueLinks.mts | 149 +++ src/version3/issueLinks.ts | 149 --- src/version3/issueNavigatorSettings.mts | 76 ++ src/version3/issueNavigatorSettings.ts | 76 -- src/version3/issueNotificationSchemes.mts | 281 +++++ src/version3/issueNotificationSchemes.ts | 281 ----- src/version3/issuePriorities.mts | 236 ++++ src/version3/issuePriorities.ts | 236 ---- src/version3/issueProperties.mts | 509 ++++++++ src/version3/issueProperties.ts | 509 -------- src/version3/issueRemoteLinks.mts | 332 +++++ src/version3/issueRemoteLinks.ts | 332 ----- src/version3/issueResolutions.mts | 224 ++++ src/version3/issueResolutions.ts | 224 ---- src/version3/issueSearch.mts | 234 ++++ src/version3/issueSearch.ts | 234 ---- src/version3/issueSecurityLevel.mts | 91 ++ src/version3/issueSecurityLevel.ts | 91 -- src/version3/issueSecuritySchemes.mts | 604 +++++++++ src/version3/issueSecuritySchemes.ts | 604 --------- src/version3/issueTypeProperties.mts | 173 +++ src/version3/issueTypeProperties.ts | 173 --- src/version3/issueTypeSchemes.mts | 432 +++++++ src/version3/issueTypeSchemes.ts | 432 ------- src/version3/issueTypeScreenSchemes.mts | 436 +++++++ src/version3/issueTypeScreenSchemes.ts | 436 ------- src/version3/issueTypes.mts | 336 +++++ src/version3/issueTypes.ts | 336 ----- src/version3/issueVotes.mts | 139 ++ src/version3/issueVotes.ts | 139 -- src/version3/issueWatchers.mts | 211 ++++ src/version3/issueWatchers.ts | 211 ---- src/version3/issueWorklogProperties.mts | 197 +++ src/version3/issueWorklogProperties.ts | 197 --- src/version3/issueWorklogs.mts | 498 ++++++++ src/version3/issueWorklogs.ts | 498 -------- src/version3/issues.mts | 1119 +++++++++++++++++ src/version3/issues.ts | 1119 ----------------- src/version3/jQL.ts | 312 ----- src/version3/jiraExpressions.mts | 193 +++ src/version3/jiraExpressions.ts | 193 --- src/version3/jiraSettings.mts | 241 ++++ src/version3/jiraSettings.ts | 241 ---- src/version3/jql.mts | 312 +++++ src/version3/jqlFunctionsApps.mts | 82 ++ src/version3/jqlFunctionsApps.ts | 82 -- src/version3/labels.mts | 38 + src/version3/labels.ts | 38 - src/version3/licenseMetrics.mts | 88 ++ src/version3/licenseMetrics.ts | 88 -- .../models/{actorInput.ts => actorInput.mts} | 0 .../models/{actorsMap.ts => actorsMap.mts} | 0 .../models/{addField.ts => addField.mts} | 0 .../models/{addGroup.ts => addGroup.mts} | 0 .../models/addSecuritySchemeLevelsRequest.mts | 6 + .../models/addSecuritySchemeLevelsRequest.ts | 6 - ...ts => announcementBannerConfiguration.mts} | 0 ...announcementBannerConfigurationUpdate.mts} | 0 .../{application.ts => application.mts} | 0 ...ionProperty.ts => applicationProperty.mts} | 0 src/version3/models/applicationRole.mts | 36 + src/version3/models/applicationRole.ts | 36 - ...equest.ts => archiveIssueAsyncRequest.mts} | 0 ...eldConfigurationsWithIssueTypesRequest.mts | 7 + ...ieldConfigurationsWithIssueTypesRequest.ts | 7 - .../{associatedItem.ts => associatedItem.mts} | 0 src/version3/models/attachment.mts | 22 + src/version3/models/attachment.ts | 22 - ...iveEntry.ts => attachmentArchiveEntry.mts} | 0 src/version3/models/attachmentArchiveImpl.mts | 8 + src/version3/models/attachmentArchiveImpl.ts | 8 - ...e.ts => attachmentArchiveItemReadable.mts} | 0 .../attachmentArchiveMetadataReadable.mts | 15 + .../attachmentArchiveMetadataReadable.ts | 15 - src/version3/models/attachmentMetadata.mts | 29 + src/version3/models/attachmentMetadata.ts | 29 - ...mentSettings.ts => attachmentSettings.mts} | 0 src/version3/models/auditRecord.mts | 28 + src/version3/models/auditRecord.ts | 28 - src/version3/models/auditRecords.mts | 13 + src/version3/models/auditRecords.ts | 13 - ...ggestion.ts => autoCompleteSuggestion.mts} | 0 .../models/autoCompleteSuggestions.mts | 7 + .../models/autoCompleteSuggestions.ts | 7 - ...Gadget.ts => availableDashboardGadget.mts} | 0 .../availableDashboardGadgetsResponse.mts | 7 + .../availableDashboardGadgetsResponse.ts | 7 - src/version3/models/{avatar.ts => avatar.mts} | 0 .../models/{avatarUrls.ts => avatarUrls.mts} | 0 ...arWithDetails.ts => avatarWithDetails.mts} | 0 src/version3/models/avatars.mts | 9 + src/version3/models/avatars.ts | 9 - ...rDetails.ts => bulkChangeOwnerDetails.mts} | 0 .../bulkCustomFieldOptionCreateRequest.mts | 7 + .../bulkCustomFieldOptionCreateRequest.ts | 7 - .../bulkCustomFieldOptionUpdateRequest.mts | 7 + .../bulkCustomFieldOptionUpdateRequest.ts | 7 - ...eEntity.ts => bulkEditShareableEntity.mts} | 0 ...eIsWatching.ts => bulkIssueIsWatching.mts} | 0 .../models/bulkIssuePropertyUpdateRequest.mts | 18 + .../models/bulkIssuePropertyUpdateRequest.ts | 18 - .../models/bulkOperationErrorResult.mts | 7 + .../models/bulkOperationErrorResult.ts | 7 - src/version3/models/bulkPermissionGrants.mts | 9 + src/version3/models/bulkPermissionGrants.ts | 9 - .../models/bulkPermissionsRequest.mts | 11 + src/version3/models/bulkPermissionsRequest.ts | 11 - ...nts.ts => bulkProjectPermissionGrants.mts} | 0 ...missions.ts => bulkProjectPermissions.mts} | 0 .../{changeDetails.ts => changeDetails.mts} | 0 .../{changedValue.ts => changedValue.mts} | 0 src/version3/models/changedWorklog.mts | 11 + src/version3/models/changedWorklog.ts | 11 - src/version3/models/changedWorklogs.mts | 16 + src/version3/models/changedWorklogs.ts | 16 - src/version3/models/changelog.mts | 15 + src/version3/models/changelog.ts | 15 - .../models/{columnItem.ts => columnItem.mts} | 0 src/version3/models/comment.mts | 44 + src/version3/models/comment.ts | 44 - ...ssuesCount.ts => componentIssuesCount.mts} | 0 .../models/componentWithIssueCount.mts | 51 + .../models/componentWithIssueCount.ts | 51 - src/version3/models/configuration.mts | 27 + src/version3/models/configuration.ts | 27 - ...ldValue.ts => connectCustomFieldValue.mts} | 0 .../models/connectCustomFieldValues.mts | 7 + .../models/connectCustomFieldValues.ts | 7 - .../{connectModule.ts => connectModule.mts} | 0 src/version3/models/connectModules.mts | 9 + src/version3/models/connectModules.ts | 9 - .../models/connectWorkflowTransitionRule.mts | 12 + .../models/connectWorkflowTransitionRule.ts | 12 - .../models/containerForProjectFeatures.mts | 7 + .../models/containerForProjectFeatures.ts | 7 - .../models/containerForRegisteredWebhooks.mts | 7 + .../models/containerForRegisteredWebhooks.ts | 7 - ...bhookIDs.ts => containerForWebhookIDs.mts} | 0 .../containerOfWorkflowSchemeAssociations.mts | 7 + .../containerOfWorkflowSchemeAssociations.ts | 7 - ...e.ts => contextForProjectAndIssueType.mts} | 0 ...uration.ts => contextualConfiguration.mts} | 0 src/version3/models/convertedJQLQueries.mts | 9 + src/version3/models/convertedJQLQueries.ts | 9 - ...ontext.ts => createCustomFieldContext.mts} | 0 .../createIssueSecuritySchemeDetails.mts | 11 + .../createIssueSecuritySchemeDetails.ts | 11 - .../createNotificationSchemeDetails.mts | 11 + .../models/createNotificationSchemeDetails.ts | 11 - ...tyDetails.ts => createPriorityDetails.mts} | 0 ...ectDetails.ts => createProjectDetails.mts} | 0 ...Details.ts => createResolutionDetails.mts} | 0 .../models/createUiModificationDetails.mts | 13 + .../models/createUiModificationDetails.ts | 13 - ...Request.ts => createUpdateRoleRequest.mts} | 0 ...ndition.ts => createWorkflowCondition.mts} | 0 src/version3/models/createWorkflowDetails.mts | 29 + src/version3/models/createWorkflowDetails.ts | 29 - ...ils.ts => createWorkflowStatusDetails.mts} | 0 .../createWorkflowTransitionDetails.mts | 20 + .../models/createWorkflowTransitionDetails.ts | 20 - ...le.ts => createWorkflowTransitionRule.mts} | 0 .../createWorkflowTransitionRulesDetails.mts | 30 + .../createWorkflowTransitionRulesDetails.ts | 30 - ...createWorkflowTransitionScreenDetails.mts} | 0 src/version3/models/createdIssue.mts | 12 + src/version3/models/createdIssue.ts | 12 - src/version3/models/createdIssues.mts | 10 + src/version3/models/createdIssues.ts | 10 - ...tVariable.ts => customContextVariable.mts} | 0 .../models/customFieldConfigurations.mts | 7 + .../models/customFieldConfigurations.ts | 7 - ...FieldContext.ts => customFieldContext.mts} | 0 ....ts => customFieldContextDefaultValue.mts} | 0 .../customFieldContextDefaultValueUpdate.mts | 6 + .../customFieldContextDefaultValueUpdate.ts | 6 - ...Option.ts => customFieldContextOption.mts} | 0 ...s => customFieldContextProjectMapping.mts} | 0 ...ts => customFieldContextUpdateDetails.mts} | 0 .../customFieldCreatedContextOptionsList.mts | 7 + .../customFieldCreatedContextOptionsList.ts | 7 - .../models/customFieldDefinitionJson.mts | 61 + .../models/customFieldDefinitionJson.ts | 61 - ...omFieldOption.ts => customFieldOption.mts} | 0 ...nCreate.ts => customFieldOptionCreate.mts} | 0 ...nUpdate.ts => customFieldOptionUpdate.mts} | 0 ...lacement.ts => customFieldReplacement.mts} | 0 .../customFieldUpdatedContextOptionsList.mts | 7 + .../customFieldUpdatedContextOptionsList.ts | 7 - ...ueUpdate.ts => customFieldValueUpdate.mts} | 0 .../models/customFieldValueUpdateRequest.mts | 7 + .../models/customFieldValueUpdateRequest.ts | 7 - src/version3/models/dashboard.mts | 32 + src/version3/models/dashboard.ts | 32 - src/version3/models/dashboardDetails.mts | 13 + src/version3/models/dashboardDetails.ts | 13 - src/version3/models/dashboardGadget.mts | 16 + src/version3/models/dashboardGadget.ts | 16 - ...osition.ts => dashboardGadgetPosition.mts} | 0 .../models/dashboardGadgetResponse.mts | 7 + .../models/dashboardGadgetResponse.ts | 7 - .../models/dashboardGadgetSettings.mts | 19 + .../models/dashboardGadgetSettings.ts | 19 - .../models/dashboardGadgetUpdateRequest.mts | 10 + .../models/dashboardGadgetUpdateRequest.ts | 10 - src/version3/models/dashboardUser.mts | 16 + src/version3/models/dashboardUser.ts | 16 - ...dateRangeFilter.ts => dateRangeFilter.mts} | 0 ...ultLevelValue.ts => defaultLevelValue.mts} | 0 ...ultShareScope.ts => defaultShareScope.mts} | 0 ...defaultWorkflow.ts => defaultWorkflow.mts} | 0 .../models/deleteAndReplaceVersion.mts | 13 + .../models/deleteAndReplaceVersion.ts | 13 - src/version3/models/document.mts | 33 + src/version3/models/document.ts | 33 - .../{entityProperty.ts => entityProperty.mts} | 0 ...tyDetails.ts => entityPropertyDetails.mts} | 0 src/version3/models/{error.ts => error.mts} | 0 ...errorCollection.ts => errorCollection.mts} | 0 src/version3/models/errors.mts | 8 + src/version3/models/errors.ts | 8 - src/version3/models/eventNotification.mts | 39 + src/version3/models/eventNotification.ts | 39 - ...s => exportArchivedIssuesTaskProgress.mts} | 0 .../{failedWebhook.ts => failedWebhook.mts} | 0 src/version3/models/failedWebhooks.mts | 18 + src/version3/models/failedWebhooks.ts | 18 - src/version3/models/field.mts | 26 + src/version3/models/field.ts | 26 - ...onfiguration.ts => fieldConfiguration.mts} | 0 ...tails.ts => fieldConfigurationDetails.mts} | 0 ...ts => fieldConfigurationIssueTypeItem.mts} | 0 ...tionItem.ts => fieldConfigurationItem.mts} | 0 .../models/fieldConfigurationItemsDetails.mts | 7 + .../models/fieldConfigurationItemsDetails.ts | 7 - ...Scheme.ts => fieldConfigurationScheme.mts} | 0 ...ConfigurationSchemeProjectAssociation.mts} | 0 .../fieldConfigurationSchemeProjects.mts | 8 + .../fieldConfigurationSchemeProjects.ts | 8 - ... fieldConfigurationToIssueTypeMapping.mts} | 0 src/version3/models/fieldDetails.mts | 27 + src/version3/models/fieldDetails.ts | 27 - .../{fieldLastUsed.ts => fieldLastUsed.mts} | 0 ...eferenceData.ts => fieldReferenceData.mts} | 0 src/version3/models/fields.mts | 85 ++ src/version3/models/fields.ts | 85 -- src/version3/models/filter.mts | 40 + src/version3/models/filter.ts | 40 - src/version3/models/filterDetails.mts | 47 + src/version3/models/filterDetails.ts | 47 - src/version3/models/filterSubscription.mts | 10 + src/version3/models/filterSubscription.ts | 10 - .../models/filterSubscriptionsList.mts | 15 + .../models/filterSubscriptionsList.ts | 15 - .../models/{fixVersion.ts => fixVersion.mts} | 0 src/version3/models/foundGroup.mts | 15 + src/version3/models/foundGroup.ts | 15 - src/version3/models/foundGroups.mts | 13 + src/version3/models/foundGroups.ts | 13 - src/version3/models/foundUsers.mts | 13 + src/version3/models/foundUsers.ts | 13 - src/version3/models/foundUsersAndGroups.mts | 8 + src/version3/models/foundUsersAndGroups.ts | 8 - ...renceData.ts => functionReferenceData.mts} | 0 .../{globalScope.ts => globalScope.mts} | 0 src/version3/models/group.mts | 16 + src/version3/models/group.ts | 16 - .../{groupDetails.ts => groupDetails.mts} | 0 .../models/{groupLabel.ts => groupLabel.mts} | 0 .../models/{groupName.ts => groupName.mts} | 0 src/version3/models/hierarchy.mts | 7 + src/version3/models/hierarchy.ts | 7 - .../{hierarchyLevel.ts => hierarchyLevel.mts} | 0 src/version3/models/historyMetadata.mts | 24 + src/version3/models/historyMetadata.ts | 24 - ...pant.ts => historyMetadataParticipant.mts} | 0 src/version3/models/{icon.ts => icon.mts} | 0 src/version3/models/{id.ts => id.mts} | 0 .../models/{idOrKey.ts => idOrKey.mts} | 0 .../{includedFields.ts => includedFields.mts} | 0 src/version3/models/index.mts | 510 ++++++++ src/version3/models/index.ts | 511 -------- src/version3/models/issue.mts | 35 + src/version3/models/issue.ts | 35 - src/version3/models/issueArchivalSync.mts | 7 + src/version3/models/issueArchivalSync.ts | 7 - ...equest.ts => issueArchivalSyncRequest.mts} | 0 ...eChangelogIds.ts => issueChangelogIds.mts} | 0 ...Request.ts => issueCommentListRequest.mts} | 0 src/version3/models/issueCreateMetadata.mts | 9 + src/version3/models/issueCreateMetadata.ts | 9 - ...roperties.ts => issueEntityProperties.mts} | 0 ...> issueEntityPropertiesForMultiUpdate.mts} | 0 .../models/{issueEvent.ts => issueEvent.mts} | 0 src/version3/models/issueFieldOption.mts | 17 + src/version3/models/issueFieldOption.ts | 17 - .../models/issueFieldOptionConfiguration.mts | 6 + .../models/issueFieldOptionConfiguration.ts | 6 - .../models/issueFieldOptionCreate.mts | 13 + src/version3/models/issueFieldOptionCreate.ts | 13 - src/version3/models/issueFieldOptionScope.mts | 12 + src/version3/models/issueFieldOptionScope.ts | 12 - ...s => issueFilterForBulkPropertyDelete.mts} | 0 ...t.ts => issueFilterForBulkPropertySet.mts} | 0 src/version3/models/issueLink.mts | 13 + src/version3/models/issueLink.ts | 13 - .../{issueLinkType.ts => issueLinkType.mts} | 0 src/version3/models/issueLinkTypes.mts | 7 + src/version3/models/issueLinkTypes.ts | 7 - .../models/{issueList.ts => issueList.mts} | 0 src/version3/models/issueMatches.mts | 6 + src/version3/models/issueMatches.ts | 6 - src/version3/models/issueMatchesForJQL.mts | 7 + src/version3/models/issueMatchesForJQL.ts | 7 - .../models/issuePickerSuggestions.mts | 7 + src/version3/models/issuePickerSuggestions.ts | 7 - .../issuePickerSuggestionsIssueType.mts | 15 + .../models/issuePickerSuggestionsIssueType.ts | 15 - .../models/issueSecurityLevelMember.mts | 10 + .../models/issueSecurityLevelMember.ts | 10 - ...> issueSecuritySchemeToProjectMapping.mts} | 0 src/version3/models/issueTransition.mts | 28 + src/version3/models/issueTransition.ts | 28 - ...issueTypeCreate.ts => issueTypeCreate.mts} | 0 src/version3/models/issueTypeDetails.mts | 24 + src/version3/models/issueTypeDetails.ts | 24 - .../{issueTypeIds.ts => issueTypeIds.mts} | 0 ...dsToRemove.ts => issueTypeIdsToRemove.mts} | 0 .../{issueTypeInfo.ts => issueTypeInfo.mts} | 0 .../models/issueTypeIssueCreateMetadata.mts | 28 + .../models/issueTypeIssueCreateMetadata.ts | 28 - ...issueTypeScheme.ts => issueTypeScheme.mts} | 0 ...eDetails.ts => issueTypeSchemeDetails.mts} | 0 ...eTypeSchemeID.ts => issueTypeSchemeID.mts} | 0 ...eMapping.ts => issueTypeSchemeMapping.mts} | 0 ... => issueTypeSchemeProjectAssociation.mts} | 0 .../models/issueTypeSchemeProjects.mts | 8 + .../models/issueTypeSchemeProjects.ts | 8 - ...ls.ts => issueTypeSchemeUpdateDetails.mts} | 0 ...eenScheme.ts => issueTypeScreenScheme.mts} | 0 .../models/issueTypeScreenSchemeDetails.mts | 14 + .../models/issueTypeScreenSchemeDetails.ts | 14 - ...chemeId.ts => issueTypeScreenSchemeId.mts} | 0 ...eItem.ts => issueTypeScreenSchemeItem.mts} | 0 ...ng.ts => issueTypeScreenSchemeMapping.mts} | 0 .../issueTypeScreenSchemeMappingDetails.mts | 10 + .../issueTypeScreenSchemeMappingDetails.ts | 10 - ...sueTypeScreenSchemeProjectAssociation.mts} | 0 ...=> issueTypeScreenSchemeUpdateDetails.mts} | 0 .../models/issueTypeScreenSchemesProjects.mts | 8 + .../models/issueTypeScreenSchemesProjects.ts | 8 - ...pping.ts => issueTypeToContextMapping.mts} | 0 ...issueTypeUpdate.ts => issueTypeUpdate.mts} | 0 src/version3/models/issueTypeWithStatus.mts | 15 + src/version3/models/issueTypeWithStatus.ts | 15 - ...apping.ts => issueTypeWorkflowMapping.mts} | 0 ...pping.ts => issueTypesWorkflowMapping.mts} | 0 src/version3/models/issueUpdateDetails.mts | 24 + src/version3/models/issueUpdateDetails.ts | 24 - ...ateMetadata.ts => issueUpdateMetadata.mts} | 0 src/version3/models/issuesAndJQLQueries.mts | 7 + src/version3/models/issuesAndJQLQueries.ts | 7 - src/version3/models/issuesJqlMetaData.mts | 13 + src/version3/models/issuesJqlMetaData.ts | 13 - src/version3/models/issuesMeta.mts | 6 + src/version3/models/issuesMeta.ts | 6 - src/version3/models/issuesUpdate.mts | 5 + src/version3/models/issuesUpdate.ts | 5 - .../jQLPersonalDataMigrationRequest.mts | 5 + .../models/jQLPersonalDataMigrationRequest.ts | 5 - .../models/jQLQueryWithUnknownUsers.mts | 7 + .../models/jQLQueryWithUnknownUsers.ts | 7 - src/version3/models/jQLReferenceData.mts | 12 + src/version3/models/jQLReferenceData.ts | 12 - src/version3/models/jexpIssues.mts | 6 + src/version3/models/jexpIssues.ts | 6 - src/version3/models/jexpJqlIssues.mts | 19 + src/version3/models/jexpJqlIssues.ts | 19 - .../models/jiraExpressionAnalysis.mts | 18 + src/version3/models/jiraExpressionAnalysis.ts | 18 - ...lexity.ts => jiraExpressionComplexity.mts} | 0 .../models/jiraExpressionEvalContext.mts | 31 + .../models/jiraExpressionEvalContext.ts | 31 - .../models/jiraExpressionEvalRequest.mts | 7 + .../models/jiraExpressionEvalRequest.ts | 7 - .../jiraExpressionEvaluationMetaData.mts | 7 + .../jiraExpressionEvaluationMetaData.ts | 7 - ...lysis.ts => jiraExpressionForAnalysis.mts} | 0 src/version3/models/jiraExpressionResult.mts | 13 + src/version3/models/jiraExpressionResult.ts | 13 - ...r.ts => jiraExpressionValidationError.mts} | 0 .../models/jiraExpressionsAnalysis.mts | 7 + .../models/jiraExpressionsAnalysis.ts | 7 - .../models/jiraExpressionsComplexity.mts | 8 + .../models/jiraExpressionsComplexity.ts | 8 - ....ts => jiraExpressionsComplexityValue.mts} | 0 src/version3/models/jiraStatus.mts | 17 + src/version3/models/jiraStatus.ts | 17 - ...ation.ts => jqlFunctionPrecomputation.mts} | 0 ...ts => jqlFunctionPrecomputationUpdate.mts} | 0 ...jqlFunctionPrecomputationUpdateRequest.mts | 6 + .../jqlFunctionPrecomputationUpdateRequest.ts | 6 - src/version3/models/jqlQueriesToParse.mts | 5 + src/version3/models/jqlQueriesToParse.ts | 5 - src/version3/models/jqlQueriesToSanitize.mts | 7 + src/version3/models/jqlQueriesToSanitize.ts | 7 - src/version3/models/jqlQuery.mts | 8 + src/version3/models/jqlQuery.ts | 8 - src/version3/models/jqlQueryClause.mts | 2 + src/version3/models/jqlQueryClause.ts | 2 - src/version3/models/jqlQueryField.mts | 12 + src/version3/models/jqlQueryField.ts | 12 - ...rty.ts => jqlQueryFieldEntityProperty.mts} | 0 src/version3/models/jqlQueryOrderByClause.mts | 7 + src/version3/models/jqlQueryOrderByClause.ts | 7 - .../models/jqlQueryOrderByClauseElement.mts | 8 + .../models/jqlQueryOrderByClauseElement.ts | 8 - src/version3/models/jqlQueryToSanitize.mts | 13 + src/version3/models/jqlQueryToSanitize.ts | 13 - .../models/{jsonType.ts => jsonType.mts} | 0 src/version3/models/license.mts | 7 + src/version3/models/license.ts | 7 - .../{licenseMetric.ts => licenseMetric.mts} | 0 ...Application.ts => licensedApplication.mts} | 0 src/version3/models/linkGroup.mts | 11 + src/version3/models/linkGroup.ts | 11 - src/version3/models/linkIssueRequestJson.mts | 10 + src/version3/models/linkIssueRequestJson.ts | 10 - src/version3/models/linkedIssue.mts | 12 + src/version3/models/linkedIssue.ts | 12 - ...=> listWrapperCallbackApplicationRole.mts} | 0 ...me.ts => listWrapperCallbackGroupName.mts} | 0 src/version3/models/{locale.ts => locale.mts} | 0 src/version3/models/{mark.ts => mark.mts} | 0 .../models/{moveField.ts => moveField.mts} | 0 .../models/multiIssueEntityProperties.mts | 10 + .../models/multiIssueEntityProperties.ts | 10 - ...ts => multipleCustomFieldValuesUpdate.mts} | 0 ...multipleCustomFieldValuesUpdateDetails.mts | 6 + .../multipleCustomFieldValuesUpdateDetails.ts | 6 - src/version3/models/nestedResponse.mts | 6 + src/version3/models/nestedResponse.ts | 6 - .../{newUserDetails.ts => newUserDetails.mts} | 0 src/version3/models/notification.mts | 17 + src/version3/models/notification.ts | 17 - ...ficationEvent.ts => notificationEvent.mts} | 0 .../models/notificationRecipients.mts | 20 + src/version3/models/notificationRecipients.ts | 20 - .../notificationRecipientsRestrictions.mts | 12 + .../notificationRecipientsRestrictions.ts | 12 - src/version3/models/notificationScheme.mts | 18 + src/version3/models/notificationScheme.ts | 18 - ...> notificationSchemeAndProjectMapping.mts} | 0 ...otificationSchemeAndProjectMappingPage.mts | 19 + ...notificationSchemeAndProjectMappingPage.ts | 19 - .../models/notificationSchemeEvent.mts | 8 + .../models/notificationSchemeEvent.ts | 8 - .../models/notificationSchemeEventDetails.mts | 9 + .../models/notificationSchemeEventDetails.ts | 9 - ...d.ts => notificationSchemeEventTypeId.mts} | 0 ...onSchemeId.ts => notificationSchemeId.mts} | 0 ...notificationSchemeNotificationDetails.mts} | 0 ...s.ts => oldToNewSecurityLevelMappings.mts} | 0 ...erationMessage.ts => operationMessage.mts} | 0 src/version3/models/operations.mts | 7 + src/version3/models/operations.ts | 7 - ...tions.ts => orderOfCustomFieldOptions.mts} | 0 ...rOfIssueTypes.ts => orderOfIssueTypes.mts} | 0 .../pageBeanFieldConfigurationDetails.mts | 19 + .../pageBeanFieldConfigurationDetails.ts | 19 - src/version3/models/pageChangelog.mts | 19 + src/version3/models/pageChangelog.ts | 19 - src/version3/models/pageComment.mts | 19 + src/version3/models/pageComment.ts | 19 - .../models/pageComponentWithIssueCount.mts | 19 + .../models/pageComponentWithIssueCount.ts | 19 - .../pageContextForProjectAndIssueType.mts | 19 + .../pageContextForProjectAndIssueType.ts | 19 - .../models/pageContextualConfiguration.mts | 19 + .../models/pageContextualConfiguration.ts | 19 - .../models/pageCustomFieldContext.mts | 19 + src/version3/models/pageCustomFieldContext.ts | 19 - .../pageCustomFieldContextDefaultValue.mts | 19 + .../pageCustomFieldContextDefaultValue.ts | 19 - .../models/pageCustomFieldContextOption.mts | 19 + .../models/pageCustomFieldContextOption.ts | 19 - .../pageCustomFieldContextProjectMapping.mts | 19 + .../pageCustomFieldContextProjectMapping.ts | 19 - src/version3/models/pageDashboard.mts | 19 + src/version3/models/pageDashboard.ts | 19 - src/version3/models/pageField.mts | 19 + src/version3/models/pageField.ts | 19 - .../pageFieldConfigurationIssueTypeItem.mts | 19 + .../pageFieldConfigurationIssueTypeItem.ts | 19 - .../models/pageFieldConfigurationItem.mts | 19 + .../models/pageFieldConfigurationItem.ts | 19 - .../models/pageFieldConfigurationScheme.mts | 19 + .../models/pageFieldConfigurationScheme.ts | 19 - .../pageFieldConfigurationSchemeProjects.mts | 19 + .../pageFieldConfigurationSchemeProjects.ts | 19 - src/version3/models/pageFilterDetails.mts | 19 + src/version3/models/pageFilterDetails.ts | 19 - src/version3/models/pageGroupDetails.mts | 19 + src/version3/models/pageGroupDetails.ts | 19 - src/version3/models/pageIssueFieldOption.mts | 19 + src/version3/models/pageIssueFieldOption.ts | 19 - .../models/pageIssueSecurityLevelMember.mts | 19 + .../models/pageIssueSecurityLevelMember.ts | 19 - ...ageIssueSecuritySchemeToProjectMapping.mts | 19 + ...pageIssueSecuritySchemeToProjectMapping.ts | 19 - src/version3/models/pageIssueTypeScheme.mts | 19 + src/version3/models/pageIssueTypeScheme.ts | 19 - .../models/pageIssueTypeSchemeMapping.mts | 19 + .../models/pageIssueTypeSchemeMapping.ts | 19 - .../models/pageIssueTypeSchemeProjects.mts | 19 + .../models/pageIssueTypeSchemeProjects.ts | 19 - .../models/pageIssueTypeScreenScheme.mts | 19 + .../models/pageIssueTypeScreenScheme.ts | 19 - .../models/pageIssueTypeScreenSchemeItem.mts | 19 + .../models/pageIssueTypeScreenSchemeItem.ts | 19 - .../pageIssueTypeScreenSchemesProjects.mts | 19 + .../pageIssueTypeScreenSchemesProjects.ts | 19 - .../models/pageIssueTypeToContextMapping.mts | 19 + .../models/pageIssueTypeToContextMapping.ts | 19 - .../models/pageJqlFunctionPrecomputation.mts | 19 + .../models/pageJqlFunctionPrecomputation.ts | 19 - .../models/pageNotificationScheme.mts | 19 + src/version3/models/pageNotificationScheme.ts | 19 - src/version3/models/pageOfChangelogs.mts | 13 + src/version3/models/pageOfChangelogs.ts | 13 - src/version3/models/pageOfComments.mts | 13 + src/version3/models/pageOfComments.ts | 13 - src/version3/models/pageOfDashboards.mts | 17 + src/version3/models/pageOfDashboards.ts | 17 - src/version3/models/pageOfStatuses.mts | 18 + src/version3/models/pageOfStatuses.ts | 18 - src/version3/models/pageOfWorklogs.mts | 13 + src/version3/models/pageOfWorklogs.ts | 13 - src/version3/models/pagePriority.mts | 19 + src/version3/models/pagePriority.ts | 19 - src/version3/models/pageProject.mts | 19 + src/version3/models/pageProject.ts | 19 - src/version3/models/pageProjectDetails.mts | 19 + src/version3/models/pageProjectDetails.ts | 19 - src/version3/models/pageResolution.mts | 19 + src/version3/models/pageResolution.ts | 19 - src/version3/models/pageScreen.mts | 19 + src/version3/models/pageScreen.ts | 19 - src/version3/models/pageScreenScheme.mts | 19 + src/version3/models/pageScreenScheme.ts | 19 - src/version3/models/pageScreenWithTab.mts | 19 + src/version3/models/pageScreenWithTab.ts | 19 - src/version3/models/pageSecurityLevel.mts | 19 + src/version3/models/pageSecurityLevel.ts | 19 - .../models/pageSecurityLevelMember.mts | 19 + .../models/pageSecurityLevelMember.ts | 19 - .../models/pageSecuritySchemeWithProjects.mts | 19 + .../models/pageSecuritySchemeWithProjects.ts | 19 - .../models/{pageString.ts => pageString.mts} | 0 .../models/pageUiModificationDetails.mts | 19 + .../models/pageUiModificationDetails.ts | 19 - src/version3/models/pageUser.mts | 19 + src/version3/models/pageUser.ts | 19 - src/version3/models/pageUserDetails.mts | 19 + src/version3/models/pageUserDetails.ts | 19 - src/version3/models/pageUserKey.mts | 19 + src/version3/models/pageUserKey.ts | 19 - src/version3/models/pageVersion.mts | 19 + src/version3/models/pageVersion.ts | 19 - src/version3/models/pageWebhook.mts | 19 + src/version3/models/pageWebhook.ts | 19 - src/version3/models/pageWorkflow.mts | 19 + src/version3/models/pageWorkflow.ts | 19 - src/version3/models/pageWorkflowScheme.mts | 19 + src/version3/models/pageWorkflowScheme.ts | 19 - .../models/pageWorkflowTransitionRules.mts | 19 + .../models/pageWorkflowTransitionRules.ts | 19 - .../pagedListUserDetailsApplicationUser.mts | 18 + .../pagedListUserDetailsApplicationUser.ts | 18 - src/version3/models/parsedJqlQueries.mts | 7 + src/version3/models/parsedJqlQueries.ts | 7 - src/version3/models/parsedJqlQuery.mts | 10 + src/version3/models/parsedJqlQuery.ts | 10 - src/version3/models/permissionDetails.mts | 9 + src/version3/models/permissionDetails.ts | 9 - src/version3/models/permissionGrant.mts | 19 + src/version3/models/permissionGrant.ts | 19 - src/version3/models/permissionGrants.mts | 9 + src/version3/models/permissionGrants.ts | 9 - ...rmissionHolder.ts => permissionHolder.mts} | 0 src/version3/models/permissionScheme.mts | 22 + src/version3/models/permissionScheme.ts | 22 - src/version3/models/permissionSchemes.mts | 7 + src/version3/models/permissionSchemes.ts | 7 - .../{permissions.ts => permissions.mts} | 0 ...permissionsKeys.ts => permissionsKeys.mts} | 0 src/version3/models/permittedProjects.mts | 7 + src/version3/models/permittedProjects.ts | 7 - .../models/{priority.ts => priority.mts} | 0 .../models/{priorityId.ts => priorityId.mts} | 0 src/version3/models/project.mts | 88 ++ src/version3/models/project.ts | 88 -- src/version3/models/projectAvatars.mts | 9 + src/version3/models/projectAvatars.ts | 9 - ...projectCategory.ts => projectCategory.mts} | 0 src/version3/models/projectComponent.mts | 66 + src/version3/models/projectComponent.ts | 66 - src/version3/models/projectDetails.mts | 24 + src/version3/models/projectDetails.ts | 24 - ...mailAddress.ts => projectEmailAddress.mts} | 0 .../{projectFeature.ts => projectFeature.mts} | 0 ...est.ts => projectFeatureToggleRequest.mts} | 0 .../models/{projectId.ts => projectId.mts} | 0 ...ectIdentifier.ts => projectIdentifier.mts} | 0 ...tIdentifiers.ts => projectIdentifiers.mts} | 0 .../models/{projectIds.ts => projectIds.mts} | 0 .../{projectInsight.ts => projectInsight.mts} | 0 .../models/projectIssueCreateMetadata.mts | 19 + .../models/projectIssueCreateMetadata.ts | 19 - .../models/projectIssueSecurityLevels.mts | 7 + .../models/projectIssueSecurityLevels.ts | 7 - .../models/projectIssueTypeHierarchy.mts | 9 + .../models/projectIssueTypeHierarchy.ts | 9 - ...Mapping.ts => projectIssueTypeMapping.mts} | 0 .../models/projectIssueTypeMappings.mts | 7 + .../models/projectIssueTypeMappings.ts | 7 - src/version3/models/projectIssueTypes.mts | 8 + src/version3/models/projectIssueTypes.ts | 8 - .../projectIssueTypesHierarchyLevel.mts | 11 + .../models/projectIssueTypesHierarchyLevel.ts | 11 - ...PageInfo.ts => projectLandingPageInfo.mts} | 0 ...tPermissions.ts => projectPermissions.mts} | 0 src/version3/models/projectRole.mts | 27 + src/version3/models/projectRole.ts | 27 - ...sUpdate.ts => projectRoleActorsUpdate.mts} | 0 src/version3/models/projectRoleDetails.mts | 22 + src/version3/models/projectRoleDetails.ts | 22 - ...ojectRoleGroup.ts => projectRoleGroup.mts} | 0 ...projectRoleUser.ts => projectRoleUser.mts} | 0 .../{projectScope.ts => projectScope.mts} | 0 .../{projectType.ts => projectType.mts} | 0 .../{propertyKey.ts => propertyKey.mts} | 0 src/version3/models/propertyKeys.mts | 7 + src/version3/models/propertyKeys.ts | 7 - ...dWorkflowId.ts => publishedWorkflowId.mts} | 0 ...steredWebhook.ts => registeredWebhook.mts} | 0 src/version3/models/remoteIssueLink.mts | 16 + src/version3/models/remoteIssueLink.ts | 16 - ...ifies.ts => remoteIssueLinkIdentifies.mts} | 0 .../models/remoteIssueLinkRequest.mts | 23 + src/version3/models/remoteIssueLinkRequest.ts | 23 - src/version3/models/remoteObject.mts | 14 + src/version3/models/remoteObject.ts | 14 - .../models/removeOptionFromIssuesResult.mts | 9 + .../models/removeOptionFromIssuesResult.ts | 9 - ...iorities.ts => reorderIssuePriorities.mts} | 0 ....ts => reorderIssueResolutionsRequest.mts} | 0 .../models/{resolution.ts => resolution.mts} | 0 .../{resolutionId.ts => resolutionId.mts} | 0 ...Permission.ts => restrictedPermission.mts} | 0 .../models/{richText.ts => richText.mts} | 0 src/version3/models/roleActor.mts | 25 + src/version3/models/roleActor.ts | 25 - ...Configuration.ts => ruleConfiguration.mts} | 0 src/version3/models/sanitizedJqlQueries.mts | 7 + src/version3/models/sanitizedJqlQueries.ts | 7 - src/version3/models/sanitizedJqlQuery.mts | 12 + src/version3/models/sanitizedJqlQuery.ts | 12 - src/version3/models/scope.mts | 11 + src/version3/models/scope.ts | 11 - src/version3/models/screen.mts | 12 + src/version3/models/screen.ts | 12 - .../{screenDetails.ts => screenDetails.mts} | 0 .../models/{screenID.ts => screenID.mts} | 0 src/version3/models/screenScheme.mts | 14 + src/version3/models/screenScheme.ts | 14 - src/version3/models/screenSchemeDetails.mts | 10 + src/version3/models/screenSchemeDetails.ts | 10 - .../{screenSchemeId.ts => screenSchemeId.mts} | 0 .../{screenTypes.ts => screenTypes.mts} | 0 src/version3/models/screenWithTab.mts | 14 + src/version3/models/screenWithTab.ts | 14 - ...screenableField.ts => screenableField.mts} | 0 .../{screenableTab.ts => screenableTab.mts} | 0 ...Filter.ts => searchAutoCompleteFilter.mts} | 0 src/version3/models/searchRequest.mts | 80 ++ src/version3/models/searchRequest.ts | 80 -- src/version3/models/searchResults.mts | 21 + src/version3/models/searchResults.ts | 21 - .../{securityLevel.ts => securityLevel.mts} | 0 src/version3/models/securityLevelMember.mts | 12 + src/version3/models/securityLevelMember.ts | 12 - src/version3/models/securityScheme.mts | 16 + src/version3/models/securityScheme.ts | 16 - ...curitySchemeId.ts => securitySchemeId.mts} | 0 src/version3/models/securitySchemeLevel.mts | 12 + src/version3/models/securitySchemeLevel.ts | 12 - ...ember.ts => securitySchemeLevelMember.mts} | 0 .../models/securitySchemeMembersRequest.mts | 7 + .../models/securitySchemeMembersRequest.ts | 7 - ...ects.ts => securitySchemeWithProjects.mts} | 0 src/version3/models/securitySchemes.mts | 7 + src/version3/models/securitySchemes.ts | 7 - ...erInformation.ts => serverInformation.mts} | 0 .../models/setDefaultLevelsRequest.mts | 7 + .../models/setDefaultLevelsRequest.ts | 7 - ...quest.ts => setDefaultPriorityRequest.mts} | 0 ...est.ts => setDefaultResolutionRequest.mts} | 0 src/version3/models/sharePermission.mts | 28 + src/version3/models/sharePermission.ts | 28 - ...ssionInput.ts => sharePermissionInput.mts} | 0 ...perty.ts => simpleApplicationProperty.mts} | 0 ...ollection.ts => simpleErrorCollection.mts} | 0 .../models/{simpleLink.ts => simpleLink.mts} | 0 .../simpleListWrapperApplicationRole.mts | 10 + .../simpleListWrapperApplicationRole.ts | 10 - .../models/simpleListWrapperGroupName.mts | 10 + .../models/simpleListWrapperGroupName.ts | 10 - src/version3/models/status.mts | 11 + src/version3/models/status.ts | 11 - .../{statusCategory.ts => statusCategory.mts} | 0 .../{statusCreate.ts => statusCreate.mts} | 0 src/version3/models/statusCreateRequest.mts | 9 + src/version3/models/statusCreateRequest.ts | 9 - src/version3/models/statusDetails.mts | 16 + src/version3/models/statusDetails.ts | 16 - .../{statusMapping.ts => statusMapping.mts} | 0 src/version3/models/statusScope.mts | 8 + src/version3/models/statusScope.ts | 8 - .../{statusUpdate.ts => statusUpdate.mts} | 0 src/version3/models/statusUpdateRequest.mts | 7 + src/version3/models/statusUpdateRequest.ts | 7 - .../{suggestedIssue.ts => suggestedIssue.mts} | 0 src/version3/models/systemAvatars.mts | 7 + src/version3/models/systemAvatars.ts | 7 - ...ogressObject.ts => taskProgressObject.mts} | 0 ...skProgressRemoveOptionFromIssuesResult.mts | 30 + ...askProgressRemoveOptionFromIssuesResult.ts | 30 - ...ation.ts => timeTrackingConfiguration.mts} | 0 ...kingDetails.ts => timeTrackingDetails.mts} | 0 ...ngProvider.ts => timeTrackingProvider.mts} | 0 src/version3/models/transition.mts | 22 + src/version3/models/transition.ts | 22 - src/version3/models/transitions.mts | 9 + src/version3/models/transitions.ts | 9 - ...ls.ts => uiModificationContextDetails.mts} | 0 src/version3/models/uiModificationDetails.mts | 17 + src/version3/models/uiModificationDetails.ts | 17 - ...fiers.ts => uiModificationIdentifiers.mts} | 0 ...UserEmail.ts => unrestrictedUserEmail.mts} | 0 ...etails.ts => updateCustomFieldDetails.mts} | 0 ...updateFieldConfigurationSchemeDetails.mts} | 0 ...ts => updateIssueSecurityLevelDetails.mts} | 0 ...s => updateIssueSecuritySchemeRequest.mts} | 0 ...ts => updateNotificationSchemeDetails.mts} | 0 ...tyDetails.ts => updatePriorityDetails.mts} | 0 ...ectDetails.ts => updateProjectDetails.mts} | 0 ...Details.ts => updateResolutionDetails.mts} | 0 ...reenDetails.ts => updateScreenDetails.mts} | 0 .../models/updateScreenSchemeDetails.mts | 10 + .../models/updateScreenSchemeDetails.ts | 10 - ...teScreenTypes.ts => updateScreenTypes.mts} | 0 .../models/updateUiModificationDetails.mts | 16 + .../models/updateUiModificationDetails.ts | 16 - ...teUserToGroup.ts => updateUserToGroup.mts} | 0 ...Category.ts => updatedProjectCategory.mts} | 0 src/version3/models/user.mts | 62 + src/version3/models/user.ts | 62 - .../{userAvatarUrls.ts => userAvatarUrls.mts} | 0 src/version3/models/userDetails.mts | 51 + src/version3/models/userDetails.ts | 51 - .../models/{userKey.ts => userKey.mts} | 0 src/version3/models/userList.mts | 18 + src/version3/models/userList.ts | 18 - .../{userMigration.ts => userMigration.mts} | 0 .../{userPickerUser.ts => userPickerUser.mts} | 0 src/version3/models/version.mts | 70 ++ src/version3/models/version.ts | 70 -- src/version3/models/versionIssueCounts.mts | 15 + src/version3/models/versionIssueCounts.ts | 15 - ...ssuesStatus.ts => versionIssuesStatus.mts} | 0 .../{versionMove.ts => versionMove.mts} | 0 ...nt.ts => versionUnresolvedIssuesCount.mts} | 0 ...Field.ts => versionUsageInCustomField.mts} | 0 .../models/{visibility.ts => visibility.mts} | 0 src/version3/models/votes.mts | 16 + src/version3/models/votes.ts | 16 - src/version3/models/watchers.mts | 13 + src/version3/models/watchers.ts | 13 - src/version3/models/webhook.mts | 26 + src/version3/models/webhook.ts | 26 - src/version3/models/webhookDetails.mts | 25 + src/version3/models/webhookDetails.ts | 25 - .../models/webhookRegistrationDetails.mts | 12 + .../models/webhookRegistrationDetails.ts | 12 - ...tionDate.ts => webhooksExpirationDate.mts} | 0 src/version3/models/workflow.mts | 30 + src/version3/models/workflow.ts | 30 - ...flowCondition.ts => workflowCondition.mts} | 0 .../models/{workflowId.ts => workflowId.mts} | 0 ...owOperations.ts => workflowOperations.mts} | 0 src/version3/models/workflowRules.mts | 11 + src/version3/models/workflowRules.ts | 11 - ...RulesSearch.ts => workflowRulesSearch.mts} | 0 .../models/workflowRulesSearchDetails.mts | 11 + .../models/workflowRulesSearchDetails.ts | 11 - src/version3/models/workflowScheme.mts | 61 + src/version3/models/workflowScheme.ts | 61 - .../models/workflowSchemeAssociations.mts | 8 + .../models/workflowSchemeAssociations.ts | 8 - ...hemeIdName.ts => workflowSchemeIdName.mts} | 0 ...s => workflowSchemeProjectAssociation.mts} | 0 src/version3/models/workflowStatus.mts | 14 + src/version3/models/workflowStatus.ts | 14 - ...erties.ts => workflowStatusProperties.mts} | 0 ...owTransition.ts => workflowTransition.mts} | 0 ...erty.ts => workflowTransitionProperty.mts} | 0 ...tionRule.ts => workflowTransitionRule.mts} | 0 .../models/workflowTransitionRules.mts | 13 + .../models/workflowTransitionRules.ts | 13 - .../models/workflowTransitionRulesDetails.mts | 8 + .../models/workflowTransitionRulesDetails.ts | 8 - .../models/workflowTransitionRulesUpdate.mts | 7 + .../models/workflowTransitionRulesUpdate.ts | 7 - ...kflowTransitionRulesUpdateErrorDetails.mts | 16 + ...rkflowTransitionRulesUpdateErrorDetails.ts | 16 - .../workflowTransitionRulesUpdateErrors.mts | 7 + .../workflowTransitionRulesUpdateErrors.ts | 7 - .../workflowsWithTransitionRulesDetails.mts | 7 + .../workflowsWithTransitionRulesDetails.ts | 7 - src/version3/models/worklog.mts | 45 + src/version3/models/worklog.ts | 45 - ...logIdsRequest.ts => worklogIdsRequest.mts} | 0 src/version3/myself.mts | 230 ++++ src/version3/myself.ts | 230 ---- src/version3/parameters/addActorUsers.mts | 11 + src/version3/parameters/addActorUsers.ts | 11 - .../{addAttachment.ts => addAttachment.mts} | 0 src/version3/parameters/addComment.mts | 17 + src/version3/parameters/addComment.ts | 17 - ...tScreen.ts => addFieldToDefaultScreen.mts} | 0 src/version3/parameters/addGadget.mts | 6 + src/version3/parameters/addGadget.ts | 6 - .../parameters/addIssueTypesToContext.mts | 8 + .../parameters/addIssueTypesToContext.ts | 8 - .../addIssueTypesToIssueTypeScheme.mts | 6 + .../addIssueTypesToIssueTypeScheme.ts | 6 - .../parameters/addProjectRoleActorsToRole.mts | 9 + .../parameters/addProjectRoleActorsToRole.ts | 9 - src/version3/parameters/addScreenTab.mts | 6 + src/version3/parameters/addScreenTab.ts | 6 - src/version3/parameters/addScreenTabField.mts | 8 + src/version3/parameters/addScreenTabField.ts | 8 - src/version3/parameters/addSecurityLevel.mts | 6 + src/version3/parameters/addSecurityLevel.ts | 6 - .../parameters/addSecurityLevelMembers.mts | 8 + .../parameters/addSecurityLevelMembers.ts | 8 - .../parameters/addSharePermission.mts | 6 + src/version3/parameters/addSharePermission.ts | 6 - src/version3/parameters/addUserToGroup.mts | 11 + src/version3/parameters/addUserToGroup.ts | 11 - .../parameters/{addVote.ts => addVote.mts} | 0 .../{addWatcher.ts => addWatcher.mts} | 0 src/version3/parameters/addWorklog.mts | 45 + src/version3/parameters/addWorklog.ts | 45 - src/version3/parameters/analyseExpression.mts | 17 + src/version3/parameters/analyseExpression.ts | 17 - ...appendMappingsForIssueTypeScreenScheme.mts | 6 + .../appendMappingsForIssueTypeScreenScheme.ts | 6 - src/version3/parameters/archiveIssues.mts | 3 + src/version3/parameters/archiveIssues.ts | 3 - .../parameters/archiveIssuesAsync.mts | 3 + src/version3/parameters/archiveIssuesAsync.ts | 3 - .../{archiveProject.ts => archiveProject.mts} | 0 ...ssignFieldConfigurationSchemeToProject.mts | 3 + ...assignFieldConfigurationSchemeToProject.ts | 3 - src/version3/parameters/assignIssue.mts | 15 + src/version3/parameters/assignIssue.ts | 15 - .../assignIssueTypeSchemeToProject.mts | 3 + .../assignIssueTypeSchemeToProject.ts | 3 - .../assignIssueTypeScreenSchemeToProject.mts | 3 + .../assignIssueTypeScreenSchemeToProject.ts | 3 - .../parameters/assignPermissionScheme.mts | 28 + .../parameters/assignPermissionScheme.ts | 28 - .../assignProjectsToCustomFieldContext.mts | 8 + .../assignProjectsToCustomFieldContext.ts | 8 - .../parameters/assignSchemeToProject.mts | 3 + .../parameters/assignSchemeToProject.ts | 3 - .../parameters/associateSchemesToProjects.mts | 11 + .../parameters/associateSchemesToProjects.ts | 11 - .../parameters/bulkDeleteIssueProperty.mts | 6 + .../parameters/bulkDeleteIssueProperty.ts | 6 - .../parameters/bulkEditDashboards.mts | 13 + src/version3/parameters/bulkEditDashboards.ts | 13 - .../{bulkGetGroups.ts => bulkGetGroups.mts} | 0 .../{bulkGetUsers.ts => bulkGetUsers.mts} | 0 ...Migration.ts => bulkGetUsersMigration.mts} | 0 .../bulkSetIssuePropertiesByIssue.mts | 3 + .../bulkSetIssuePropertiesByIssue.ts | 3 - .../parameters/bulkSetIssueProperty.mts | 6 + .../parameters/bulkSetIssueProperty.ts | 6 - .../parameters/bulkSetIssuesProperties.mts | 3 + .../parameters/bulkSetIssuesProperties.ts | 3 - .../{cancelTask.ts => cancelTask.mts} | 0 ...geFilterOwner.ts => changeFilterOwner.mts} | 0 src/version3/parameters/copyDashboard.mts | 5 + src/version3/parameters/copyDashboard.ts | 5 - src/version3/parameters/createComponent.mts | 3 + src/version3/parameters/createComponent.ts | 3 - src/version3/parameters/createCustomField.mts | 3 + src/version3/parameters/createCustomField.ts | 3 - ...ontext.ts => createCustomFieldContext.mts} | 0 .../parameters/createCustomFieldOption.mts | 8 + .../parameters/createCustomFieldOption.ts | 8 - src/version3/parameters/createDashboard.mts | 6 + src/version3/parameters/createDashboard.ts | 6 - .../parameters/createFieldConfiguration.mts | 3 + .../parameters/createFieldConfiguration.ts | 3 - .../createFieldConfigurationScheme.mts | 3 + .../createFieldConfigurationScheme.ts | 3 - src/version3/parameters/createFilter.mts | 23 + src/version3/parameters/createFilter.ts | 23 - src/version3/parameters/createGroup.mts | 5 + src/version3/parameters/createGroup.ts | 5 - src/version3/parameters/createIssue.mts | 64 + src/version3/parameters/createIssue.ts | 64 - .../parameters/createIssueFieldOption.mts | 14 + .../parameters/createIssueFieldOption.ts | 14 - .../parameters/createIssueLinkType.mts | 3 + .../parameters/createIssueLinkType.ts | 3 - .../parameters/createIssueSecurityScheme.mts | 3 + .../parameters/createIssueSecurityScheme.ts | 3 - src/version3/parameters/createIssueType.mts | 3 + src/version3/parameters/createIssueType.ts | 3 - ...ypeAvatar.ts => createIssueTypeAvatar.mts} | 0 .../parameters/createIssueTypeScheme.mts | 3 + .../parameters/createIssueTypeScheme.ts | 3 - .../createIssueTypeScreenScheme.mts | 3 + .../parameters/createIssueTypeScreenScheme.ts | 3 - src/version3/parameters/createIssues.mts | 3 + src/version3/parameters/createIssues.ts | 3 - .../parameters/createNotificationScheme.mts | 3 + .../parameters/createNotificationScheme.ts | 3 - .../createOrUpdateRemoteIssueLink.mts | 6 + .../createOrUpdateRemoteIssueLink.ts | 6 - .../parameters/createPermissionGrant.mts | 16 + .../parameters/createPermissionGrant.ts | 16 - .../parameters/createPermissionScheme.mts | 14 + .../parameters/createPermissionScheme.ts | 14 - src/version3/parameters/createPriority.mts | 3 + src/version3/parameters/createPriority.ts | 3 - src/version3/parameters/createProject.mts | 3 + src/version3/parameters/createProject.ts | 3 - ...ojectAvatar.ts => createProjectAvatar.mts} | 0 .../parameters/createProjectCategory.mts | 3 + .../parameters/createProjectCategory.ts | 3 - src/version3/parameters/createProjectRole.mts | 3 + src/version3/parameters/createProjectRole.ts | 3 - src/version3/parameters/createResolution.mts | 5 + src/version3/parameters/createResolution.ts | 5 - src/version3/parameters/createScreen.mts | 3 + src/version3/parameters/createScreen.ts | 3 - .../parameters/createScreenScheme.mts | 3 + src/version3/parameters/createScreenScheme.ts | 3 - src/version3/parameters/createStatuses.mts | 3 + src/version3/parameters/createStatuses.ts | 3 - .../parameters/createUiModification.mts | 3 + .../parameters/createUiModification.ts | 3 - src/version3/parameters/createUser.mts | 3 + src/version3/parameters/createUser.ts | 3 - src/version3/parameters/createVersion.mts | 3 + src/version3/parameters/createVersion.ts | 3 - src/version3/parameters/createWorkflow.mts | 3 + src/version3/parameters/createWorkflow.ts | 3 - .../parameters/createWorkflowScheme.mts | 3 + .../parameters/createWorkflowScheme.ts | 3 - ...> createWorkflowSchemeDraftFromParent.mts} | 0 .../createWorkflowTransitionProperty.mts | 21 + .../createWorkflowTransitionProperty.ts | 21 - .../{deleteActor.ts => deleteActor.mts} | 0 ...donProperty.ts => deleteAddonProperty.mts} | 0 .../parameters/deleteAndReplaceVersion.mts | 6 + .../parameters/deleteAndReplaceVersion.ts | 6 - ...teAppProperty.ts => deleteAppProperty.mts} | 0 .../{deleteAvatar.ts => deleteAvatar.mts} | 0 .../{deleteComment.ts => deleteComment.mts} | 0 ...tProperty.ts => deleteCommentProperty.mts} | 0 ...deleteComponent.ts => deleteComponent.mts} | 0 ...teCustomField.ts => deleteCustomField.mts} | 0 ...ontext.ts => deleteCustomFieldContext.mts} | 0 ...dOption.ts => deleteCustomFieldOption.mts} | 0 ...deleteDashboard.ts => deleteDashboard.mts} | 0 ...rty.ts => deleteDashboardItemProperty.mts} | 0 ...tWorkflow.ts => deleteDefaultWorkflow.mts} | 0 ...flow.ts => deleteDraftDefaultWorkflow.mts} | 0 ...ping.ts => deleteDraftWorkflowMapping.mts} | 0 ...Filter.ts => deleteFavouriteForFilter.mts} | 0 ...ration.ts => deleteFieldConfiguration.mts} | 0 ....ts => deleteFieldConfigurationScheme.mts} | 0 .../{deleteFilter.ts => deleteFilter.mts} | 0 ...Workflow.ts => deleteInactiveWorkflow.mts} | 0 .../{deleteIssue.ts => deleteIssue.mts} | 0 ...ldOption.ts => deleteIssueFieldOption.mts} | 0 ...deleteIssueLink.ts => deleteIssueLink.mts} | 0 ...sueLinkType.ts => deleteIssueLinkType.mts} | 0 ...sueProperty.ts => deleteIssueProperty.mts} | 0 ...deleteIssueType.ts => deleteIssueType.mts} | 0 ...roperty.ts => deleteIssueTypeProperty.mts} | 0 ...ypeScheme.ts => deleteIssueTypeScheme.mts} | 0 ...eme.ts => deleteIssueTypeScreenScheme.mts} | 0 ...Scheme.ts => deleteNotificationScheme.mts} | 0 ...onScheme.ts => deletePermissionScheme.mts} | 0 ...ty.ts => deletePermissionSchemeEntity.mts} | 0 .../{deleteProject.ts => deleteProject.mts} | 0 ...sly.ts => deleteProjectAsynchronously.mts} | 0 ...ojectAvatar.ts => deleteProjectAvatar.mts} | 0 ...tProperty.ts => deleteProjectProperty.mts} | 0 ...teProjectRole.ts => deleteProjectRole.mts} | 0 ...ts => deleteProjectRoleActorsFromRole.mts} | 0 ...ts => deleteRemoteIssueLinkByGlobalId.mts} | 0 ...kById.ts => deleteRemoteIssueLinkById.mts} | 0 ...leteResolution.ts => deleteResolution.mts} | 0 .../{deleteScreen.ts => deleteScreen.mts} | 0 ...ScreenScheme.ts => deleteScreenScheme.mts} | 0 ...deleteScreenTab.ts => deleteScreenTab.mts} | 0 ...rityScheme.ts => deleteSecurityScheme.mts} | 0 ...ermission.ts => deleteSharePermission.mts} | 0 ...StatusesById.ts => deleteStatusesById.mts} | 0 ...dification.ts => deleteUiModification.mts} | 0 ...UserProperty.ts => deleteUserProperty.mts} | 0 src/version3/parameters/deleteWebhookById.mts | 3 + src/version3/parameters/deleteWebhookById.ts | 3 - ...owMapping.ts => deleteWorkflowMapping.mts} | 0 ...flowScheme.ts => deleteWorkflowScheme.mts} | 0 ...Draft.ts => deleteWorkflowSchemeDraft.mts} | 0 ...=> deleteWorkflowSchemeDraftIssueType.mts} | 0 ...e.ts => deleteWorkflowSchemeIssueType.mts} | 0 ...s => deleteWorkflowTransitionProperty.mts} | 0 ...teWorkflowTransitionRuleConfigurations.mts | 3 + ...eteWorkflowTransitionRuleConfigurations.ts | 3 - .../{deleteWorklog.ts => deleteWorklog.mts} | 0 ...gProperty.ts => deleteWorklogProperty.mts} | 0 src/version3/parameters/doTransition.mts | 6 + src/version3/parameters/doTransition.ts | 6 - src/version3/parameters/editIssue.mts | 31 + src/version3/parameters/editIssue.ts | 31 - .../parameters/evaluateJiraExpression.mts | 13 + .../parameters/evaluateJiraExpression.ts | 13 - ...umans.ts => expandAttachmentForHumans.mts} | 0 ...nes.ts => expandAttachmentForMachines.mts} | 0 .../parameters/exportArchivedIssues.mts | 14 + .../parameters/exportArchivedIssues.ts | 14 - ...gnableUsers.ts => findAssignableUsers.mts} | 0 ...leUsers.ts => findBulkAssignableUsers.mts} | 0 .../{findGroups.ts => findGroups.mts} | 0 ...KeysByQuery.ts => findUserKeysByQuery.mts} | 0 .../{findUsers.ts => findUsers.mts} | 0 ...ersAndGroups.ts => findUsersAndGroups.mts} | 0 ...ndUsersByQuery.ts => findUsersByQuery.mts} | 0 ...ersForPicker.ts => findUsersForPicker.mts} | 0 ...ons.ts => findUsersWithAllPermissions.mts} | 0 ...n.ts => findUsersWithBrowsePermission.mts} | 0 .../parameters/fullyUpdateProjectRole.mts | 9 + .../parameters/fullyUpdateProjectRole.ts | 9 - ...y.ts => getAccessibleProjectTypeByKey.mts} | 0 ...onProperties.ts => getAddonProperties.mts} | 0 ...tAddonProperty.ts => getAddonProperty.mts} | 0 ...tAllDashboards.ts => getAllDashboards.mts} | 0 ...ts => getAllFieldConfigurationSchemes.mts} | 0 ...tions.ts => getAllFieldConfigurations.mts} | 0 .../{getAllGadgets.ts => getAllGadgets.mts} | 0 ...Options.ts => getAllIssueFieldOptions.mts} | 0 ...eSchemes.ts => getAllIssueTypeSchemes.mts} | 0 .../{getAllLabels.ts => getAllLabels.mts} | 0 ...Schemes.ts => getAllPermissionSchemes.mts} | 0 ...ectAvatars.ts => getAllProjectAvatars.mts} | 0 ...TabFields.ts => getAllScreenTabFields.mts} | 0 ...tAllScreenTabs.ts => getAllScreenTabs.mts} | 0 .../{getAllStatuses.ts => getAllStatuses.mts} | 0 ...stemAvatars.ts => getAllSystemAvatars.mts} | 0 .../{getAllUsers.ts => getAllUsers.mts} | 0 ...UsersDefault.ts => getAllUsersDefault.mts} | 0 ...owSchemes.ts => getAllWorkflowSchemes.mts} | 0 ...eTypes.ts => getAlternativeIssueTypes.mts} | 0 ...Property.ts => getApplicationProperty.mts} | 0 ...licationRole.ts => getApplicationRole.mts} | 0 ...eme.ts => getAssignedPermissionScheme.mts} | 0 .../{getAttachment.ts => getAttachment.mts} | 0 ...entContent.ts => getAttachmentContent.mts} | 0 ...humbnail.ts => getAttachmentThumbnail.mts} | 0 ...getAuditRecords.ts => getAuditRecords.mts} | 0 .../parameters/getAutoCompletePost.mts | 3 + .../parameters/getAutoCompletePost.ts | 3 - ...Fields.ts => getAvailableScreenFields.mts} | 0 ...tarImageByID.ts => getAvatarImageByID.mts} | 0 ...geByOwner.ts => getAvatarImageByOwner.mts} | 0 ...mageByType.ts => getAvatarImageByType.mts} | 0 .../{getAvatars.ts => getAvatars.mts} | 0 .../parameters/getBulkPermissions.mts | 3 + src/version3/parameters/getBulkPermissions.ts | 3 - .../{getChangeLogs.ts => getChangeLogs.mts} | 0 .../parameters/getChangeLogsByIds.mts | 6 + src/version3/parameters/getChangeLogsByIds.ts | 6 - .../{getColumns.ts => getColumns.mts} | 0 .../{getComment.ts => getComment.mts} | 0 ...mentProperty.ts => getCommentProperty.mts} | 0 ...ertyKeys.ts => getCommentPropertyKeys.mts} | 0 .../{getComments.ts => getComments.mts} | 0 src/version3/parameters/getCommentsByIds.mts | 12 + src/version3/parameters/getCommentsByIds.ts | 12 - .../{getComponent.ts => getComponent.mts} | 0 ...ssues.ts => getComponentRelatedIssues.mts} | 0 ...xtsForField.ts => getContextsForField.mts} | 0 ...ateIssueMeta.ts => getCreateIssueMeta.mts} | 0 .../{getCurrentUser.ts => getCurrentUser.mts} | 0 ...ion.ts => getCustomFieldConfiguration.mts} | 0 ...mFieldContextsForProjectsAndIssueTypes.mts | 10 + ...omFieldContextsForProjectsAndIssueTypes.ts | 10 - ...ieldOption.ts => getCustomFieldOption.mts} | 0 .../{getDashboard.ts => getDashboard.mts} | 0 ...operty.ts => getDashboardItemProperty.mts} | 0 ...ys.ts => getDashboardItemPropertyKeys.mts} | 0 ...aginated.ts => getDashboardsPaginated.mts} | 0 ...tDefaultValues.ts => getDefaultValues.mts} | 0 ...aultWorkflow.ts => getDefaultWorkflow.mts} | 0 ...orkflow.ts => getDraftDefaultWorkflow.mts} | 0 ...tDraftWorkflow.ts => getDraftWorkflow.mts} | 0 ...ForApp.ts => getDynamicWebhooksForApp.mts} | 0 ...tEditIssueMeta.ts => getEditIssueMeta.mts} | 0 ...ailedWebhooks.ts => getFailedWebhooks.mts} | 0 ...riteFilters.ts => getFavouriteFilters.mts} | 0 ...orProject.ts => getFeaturesForProject.mts} | 0 ...=> getFieldAutoCompleteForQueryString.mts} | 0 ...tems.ts => getFieldConfigurationItems.mts} | 0 ...> getFieldConfigurationSchemeMappings.mts} | 0 ...ieldConfigurationSchemeProjectMapping.mts} | 0 ...ldsPaginated.ts => getFieldsPaginated.mts} | 0 .../{getFilter.ts => getFilter.mts} | 0 .../parameters/getFiltersPaginated.mts | 114 ++ .../parameters/getFiltersPaginated.ts | 114 -- .../{getHierarchy.ts => getHierarchy.mts} | 0 ...ce.ts => getIdsOfWorklogsDeletedSince.mts} | 0 ...e.ts => getIdsOfWorklogsModifiedSince.mts} | 0 .../parameters/getIsWatchingIssueBulk.mts | 3 + .../parameters/getIsWatchingIssueBulk.ts | 3 - src/version3/parameters/getIssue.mts | 72 ++ src/version3/parameters/getIssue.ts | 72 -- ...FieldOption.ts => getIssueFieldOption.mts} | 0 .../{getIssueLink.ts => getIssueLink.mts} | 0 ...tIssueLinkType.ts => getIssueLinkType.mts} | 0 .../parameters/getIssuePickerResource.mts | 23 + .../parameters/getIssuePickerResource.ts | 23 - ...tIssueProperty.ts => getIssueProperty.mts} | 0 ...opertyKeys.ts => getIssuePropertyKeys.mts} | 0 ...rityLevel.ts => getIssueSecurityLevel.mts} | 0 ...rs.ts => getIssueSecurityLevelMembers.mts} | 0 ...tyScheme.ts => getIssueSecurityScheme.mts} | 0 .../{getIssueType.ts => getIssueType.mts} | 0 ...ts => getIssueTypeMappingsForContexts.mts} | 0 ...peProperty.ts => getIssueTypeProperty.mts} | 0 ...tyKeys.ts => getIssueTypePropertyKeys.mts} | 0 ...s.ts => getIssueTypeSchemeForProjects.mts} | 0 ...ping.ts => getIssueTypeSchemesMapping.mts} | 0 ...s => getIssueTypeScreenSchemeMappings.mts} | 0 ...ueTypeScreenSchemeProjectAssociations.mts} | 0 ...hemes.ts => getIssueTypeScreenSchemes.mts} | 0 ...Project.ts => getIssueTypesForProject.mts} | 0 ...tIssueWatchers.ts => getIssueWatchers.mts} | 0 ...getIssueWorklog.ts => getIssueWorklog.mts} | 0 .../{getMyFilters.ts => getMyFilters.mts} | 0 ...tMyPermissions.ts => getMyPermissions.mts} | 0 ...ionScheme.ts => getNotificationScheme.mts} | 0 ...etNotificationSchemeToProjectMappings.mts} | 0 ...nSchemes.ts => getNotificationSchemes.mts} | 0 ...ForContext.ts => getOptionsForContext.mts} | 0 ...ssionScheme.ts => getPermissionScheme.mts} | 0 ...eGrant.ts => getPermissionSchemeGrant.mts} | 0 ...rants.ts => getPermissionSchemeGrants.mts} | 0 .../parameters/getPermittedProjects.mts | 3 + .../parameters/getPermittedProjects.ts | 3 - ...computations.ts => getPrecomputations.mts} | 0 .../{getPreference.ts => getPreference.mts} | 0 .../{getPriority.ts => getPriority.mts} | 0 .../{getProject.ts => getProject.mts} | 0 ...goryById.ts => getProjectCategoryById.mts} | 0 ...Components.ts => getProjectComponents.mts} | 0 ...d.ts => getProjectComponentsPaginated.mts} | 0 ...apping.ts => getProjectContextMapping.mts} | 0 ...getProjectEmail.ts => getProjectEmail.mts} | 0 ...e.ts => getProjectIssueSecurityScheme.mts} | 0 ...jectProperty.ts => getProjectProperty.mts} | 0 ...ertyKeys.ts => getProjectPropertyKeys.mts} | 0 .../{getProjectRole.ts => getProjectRole.mts} | 0 ...ole.ts => getProjectRoleActorsForRole.mts} | 0 ...jectRoleById.ts => getProjectRoleById.mts} | 0 ...leDetails.ts => getProjectRoleDetails.mts} | 0 ...getProjectRoles.ts => getProjectRoles.mts} | 0 ...ctTypeByKey.ts => getProjectTypeByKey.mts} | 0 ...jectVersions.ts => getProjectVersions.mts} | 0 ...ted.ts => getProjectVersionsPaginated.mts} | 0 ...> getProjectsForIssueTypeScreenScheme.mts} | 0 .../{getRecent.ts => getRecent.mts} | 0 ...LinkById.ts => getRemoteIssueLinkById.mts} | 0 ...eIssueLinks.ts => getRemoteIssueLinks.mts} | 0 ...tScreenSchemes.ts => getScreenSchemes.mts} | 0 .../{getScreens.ts => getScreens.mts} | 0 ...eensForField.ts => getScreensForField.mts} | 0 ...Members.ts => getSecurityLevelMembers.mts} | 0 ...ecurityLevels.ts => getSecurityLevels.mts} | 0 ...ect.ts => getSecurityLevelsForProject.mts} | 0 ....ts => getSelectableIssueFieldOptions.mts} | 0 ...rePermission.ts => getSharePermission.mts} | 0 ...Permissions.ts => getSharePermissions.mts} | 0 .../{getStatus.ts => getStatus.mts} | 0 ...tatusCategory.ts => getStatusCategory.mts} | 0 ...getStatusesById.ts => getStatusesById.mts} | 0 .../parameters/{getTask.ts => getTask.mts} | 0 .../{getTransitions.ts => getTransitions.mts} | 0 ...nated.ts => getTrashedFieldsPaginated.mts} | 0 ...odifications.ts => getUiModifications.mts} | 0 .../parameters/{getUser.ts => getUser.mts} | 0 ...ltColumns.ts => getUserDefaultColumns.mts} | 0 .../{getUserEmail.ts => getUserEmail.mts} | 0 ...tUserEmailBulk.ts => getUserEmailBulk.mts} | 0 .../{getUserGroups.ts => getUserGroups.mts} | 0 ...getUserProperty.ts => getUserProperty.mts} | 0 ...ropertyKeys.ts => getUserPropertyKeys.mts} | 0 ...sersFromGroup.ts => getUsersFromGroup.mts} | 0 ...idProjectKey.ts => getValidProjectKey.mts} | 0 ...ProjectName.ts => getValidProjectName.mts} | 0 .../{getVersion.ts => getVersion.mts} | 0 ...dIssues.ts => getVersionRelatedIssues.mts} | 0 ...sues.ts => getVersionUnresolvedIssues.mts} | 0 ...ons.ts => getVisibleIssueFieldOptions.mts} | 0 .../parameters/{getVotes.ts => getVotes.mts} | 0 .../{getWorkflow.ts => getWorkflow.mts} | 0 ...orkflowScheme.ts => getWorkflowScheme.mts} | 0 ...emeDraft.ts => getWorkflowSchemeDraft.mts} | 0 ...ts => getWorkflowSchemeDraftIssueType.mts} | 0 ...Type.ts => getWorkflowSchemeIssueType.mts} | 0 ... getWorkflowSchemeProjectAssociations.mts} | 0 ...ts => getWorkflowTransitionProperties.mts} | 0 ...tWorkflowTransitionRuleConfigurations.mts} | 0 ...Paginated.ts => getWorkflowsPaginated.mts} | 0 .../{getWorklog.ts => getWorklog.mts} | 0 ...klogProperty.ts => getWorklogProperty.mts} | 0 ...ertyKeys.ts => getWorklogPropertyKeys.mts} | 0 src/version3/parameters/getWorklogsForIds.mts | 10 + src/version3/parameters/getWorklogsForIds.ts | 10 - src/version3/parameters/index.mts | 462 +++++++ src/version3/parameters/index.ts | 462 ------- src/version3/parameters/linkIssues.mts | 3 + src/version3/parameters/linkIssues.ts | 3 - src/version3/parameters/matchIssues.mts | 3 + src/version3/parameters/matchIssues.ts | 3 - .../{mergeVersions.ts => mergeVersions.mts} | 0 src/version3/parameters/migrateQueries.mts | 3 + src/version3/parameters/migrateQueries.ts | 3 - src/version3/parameters/movePriorities.mts | 3 + src/version3/parameters/movePriorities.ts | 3 - src/version3/parameters/moveResolutions.mts | 3 + src/version3/parameters/moveResolutions.ts | 3 - .../{moveScreenTab.ts => moveScreenTab.mts} | 0 .../parameters/moveScreenTabField.mts | 10 + src/version3/parameters/moveScreenTabField.ts | 10 - src/version3/parameters/moveVersion.mts | 6 + src/version3/parameters/moveVersion.ts | 6 - src/version3/parameters/notify.mts | 6 + src/version3/parameters/notify.ts | 6 - src/version3/parameters/parseJqlQueries.mts | 13 + src/version3/parameters/parseJqlQueries.ts | 13 - .../parameters/partialUpdateProjectRole.mts | 9 + .../parameters/partialUpdateProjectRole.ts | 9 - .../parameters/publishDraftWorkflowScheme.mts | 9 + .../parameters/publishDraftWorkflowScheme.ts | 9 - ...tAddonProperty.ts => putAddonProperty.mts} | 0 .../{putAppProperty.ts => putAppProperty.mts} | 0 src/version3/parameters/refreshWebhooks.mts | 3 + src/version3/parameters/refreshWebhooks.ts | 3 - .../parameters/registerDynamicWebhooks.mts | 3 + .../parameters/registerDynamicWebhooks.ts | 3 - src/version3/parameters/registerModules.mts | 3 + src/version3/parameters/registerModules.ts | 3 - ...moveAttachment.ts => removeAttachment.mts} | 0 .../removeCustomFieldContextFromProjects.mts | 8 + .../removeCustomFieldContextFromProjects.ts | 8 - .../{removeGadget.ts => removeGadget.mts} | 0 .../{removeGroup.ts => removeGroup.mts} | 0 ...=> removeIssueTypeFromIssueTypeScheme.mts} | 0 .../removeIssueTypesFromContext.mts | 8 + .../parameters/removeIssueTypesFromContext.ts | 8 - ...ypesFromGlobalFieldConfigurationScheme.mts | 6 + ...TypesFromGlobalFieldConfigurationScheme.ts | 6 - .../{removeLevel.ts => removeLevel.mts} | 0 ...emoveMappingsFromIssueTypeScreenScheme.mts | 6 + ...removeMappingsFromIssueTypeScreenScheme.ts | 6 - ...l.ts => removeMemberFromSecurityLevel.mts} | 0 .../{removeModules.ts => removeModules.mts} | 0 ...oveNotificationFromNotificationScheme.mts} | 0 ...movePreference.ts => removePreference.mts} | 0 ...tCategory.ts => removeProjectCategory.mts} | 0 ...enTabField.ts => removeScreenTabField.mts} | 0 .../{removeUser.ts => removeUser.mts} | 0 ...erFromGroup.ts => removeUserFromGroup.mts} | 0 .../{removeVote.ts => removeVote.mts} | 0 .../{removeWatcher.ts => removeWatcher.mts} | 0 src/version3/parameters/renameScreenTab.mts | 8 + src/version3/parameters/renameScreenTab.ts | 8 - .../parameters/reorderCustomFieldOptions.mts | 8 + .../parameters/reorderCustomFieldOptions.ts | 8 - .../reorderIssueTypesInIssueTypeScheme.mts | 6 + .../reorderIssueTypesInIssueTypeScheme.ts | 6 - .../parameters/replaceIssueFieldOption.mts | 28 + .../parameters/replaceIssueFieldOption.ts | 28 - .../{resetColumns.ts => resetColumns.mts} | 0 ...setUserColumns.ts => resetUserColumns.mts} | 0 .../parameters/{restore.ts => restore.mts} | 0 ...eCustomField.ts => restoreCustomField.mts} | 0 .../parameters/sanitiseJqlQueries.mts | 3 + src/version3/parameters/sanitiseJqlQueries.ts | 3 - .../parameters/{search.ts => search.mts} | 0 .../parameters/searchForIssuesUsingJql.mts | 66 + .../parameters/searchForIssuesUsingJql.ts | 66 - .../searchForIssuesUsingJqlPost.mts | 3 + .../parameters/searchForIssuesUsingJqlPost.ts | 3 - ...archPriorities.ts => searchPriorities.mts} | 0 .../{searchProjects.ts => searchProjects.mts} | 0 ...=> searchProjectsUsingSecuritySchemes.mts} | 0 ...chResolutions.ts => searchResolutions.mts} | 0 ...tySchemes.ts => searchSecuritySchemes.mts} | 0 .../selectTimeTrackingImplementation.mts | 3 + .../selectTimeTrackingImplementation.ts | 3 - src/version3/parameters/setActors.mts | 11 + src/version3/parameters/setActors.ts | 11 - .../parameters/setApplicationProperty.mts | 14 + .../parameters/setApplicationProperty.ts | 14 - src/version3/parameters/setBanner.mts | 3 + src/version3/parameters/setBanner.ts | 3 - .../{setColumns.ts => setColumns.mts} | 0 ...mentProperty.ts => setCommentProperty.mts} | 0 ...operty.ts => setDashboardItemProperty.mts} | 0 src/version3/parameters/setDefaultLevels.mts | 3 + src/version3/parameters/setDefaultLevels.ts | 3 - .../parameters/setDefaultPriority.mts | 3 + src/version3/parameters/setDefaultPriority.ts | 3 - .../parameters/setDefaultResolution.mts | 3 + .../parameters/setDefaultResolution.ts | 3 - .../parameters/setDefaultShareScope.mts | 3 + .../parameters/setDefaultShareScope.ts | 3 - src/version3/parameters/setDefaultValues.mts | 6 + src/version3/parameters/setDefaultValues.ts | 6 - ...ForFilter.ts => setFavouriteForFilter.mts} | 0 .../setFieldConfigurationSchemeMapping.mts | 6 + .../setFieldConfigurationSchemeMapping.ts | 6 - ...tIssueProperty.ts => setIssueProperty.mts} | 0 ...peProperty.ts => setIssueTypeProperty.mts} | 0 .../{setPreference.ts => setPreference.mts} | 0 ...jectProperty.ts => setProjectProperty.mts} | 0 .../setSharedTimeTrackingConfiguration.mts | 3 + .../setSharedTimeTrackingConfiguration.ts | 3 - .../{setUserColumns.ts => setUserColumns.mts} | 0 ...setUserProperty.ts => setUserProperty.mts} | 0 .../setWorkflowSchemeDraftIssueType.mts | 24 + .../setWorkflowSchemeDraftIssueType.ts | 24 - .../parameters/setWorkflowSchemeIssueType.mts | 24 + .../parameters/setWorkflowSchemeIssueType.ts | 24 - ...klogProperty.ts => setWorklogProperty.mts} | 0 .../{storeAvatar.ts => storeAvatar.mts} | 0 .../parameters/toggleFeatureForProject.mts | 8 + .../parameters/toggleFeatureForProject.ts | 8 - ...ashCustomField.ts => trashCustomField.mts} | 0 src/version3/parameters/unarchiveIssues.mts | 3 + src/version3/parameters/unarchiveIssues.ts | 3 - src/version3/parameters/updateComment.mts | 22 + src/version3/parameters/updateComment.ts | 22 - src/version3/parameters/updateComponent.mts | 6 + src/version3/parameters/updateComponent.ts | 6 - src/version3/parameters/updateCustomField.mts | 6 + src/version3/parameters/updateCustomField.ts | 6 - .../updateCustomFieldConfiguration.mts | 6 + .../updateCustomFieldConfiguration.ts | 6 - .../parameters/updateCustomFieldContext.mts | 8 + .../parameters/updateCustomFieldContext.ts | 8 - .../parameters/updateCustomFieldOption.mts | 8 + .../parameters/updateCustomFieldOption.ts | 8 - .../parameters/updateCustomFieldValue.mts | 8 + .../parameters/updateCustomFieldValue.ts | 8 - src/version3/parameters/updateDashboard.mts | 6 + src/version3/parameters/updateDashboard.ts | 6 - ...cheme.ts => updateDefaultScreenScheme.mts} | 0 .../parameters/updateDefaultWorkflow.mts | 6 + .../parameters/updateDefaultWorkflow.ts | 6 - .../parameters/updateDraftDefaultWorkflow.mts | 6 + .../parameters/updateDraftDefaultWorkflow.ts | 6 - .../parameters/updateDraftWorkflowMapping.mts | 8 + .../parameters/updateDraftWorkflowMapping.ts | 8 - .../updateEntityPropertiesValue.mts | 22 + .../parameters/updateEntityPropertiesValue.ts | 22 - .../parameters/updateFieldConfiguration.mts | 6 + .../parameters/updateFieldConfiguration.ts | 6 - .../updateFieldConfigurationItems.mts | 6 + .../updateFieldConfigurationItems.ts | 6 - .../updateFieldConfigurationScheme.mts | 6 + .../updateFieldConfigurationScheme.ts | 6 - src/version3/parameters/updateFilter.mts | 26 + src/version3/parameters/updateFilter.ts | 26 - src/version3/parameters/updateGadget.mts | 8 + src/version3/parameters/updateGadget.ts | 8 - .../parameters/updateIssueFieldOption.mts | 16 + .../parameters/updateIssueFieldOption.ts | 16 - src/version3/parameters/updateIssueFields.mts | 8 + src/version3/parameters/updateIssueFields.ts | 8 - .../parameters/updateIssueLinkType.mts | 6 + .../parameters/updateIssueLinkType.ts | 6 - .../parameters/updateIssueSecurityScheme.mts | 6 + .../parameters/updateIssueSecurityScheme.ts | 6 - src/version3/parameters/updateIssueType.mts | 6 + src/version3/parameters/updateIssueType.ts | 6 - .../parameters/updateIssueTypeScheme.mts | 6 + .../parameters/updateIssueTypeScheme.ts | 6 - .../updateIssueTypeScreenScheme.mts | 6 + .../parameters/updateIssueTypeScreenScheme.ts | 6 - .../updateMultipleCustomFieldValues.mts | 6 + .../updateMultipleCustomFieldValues.ts | 6 - .../parameters/updateNotificationScheme.mts | 6 + .../parameters/updateNotificationScheme.ts | 6 - .../parameters/updatePermissionScheme.mts | 16 + .../parameters/updatePermissionScheme.ts | 16 - .../parameters/updatePrecomputations.mts | 3 + .../parameters/updatePrecomputations.ts | 3 - src/version3/parameters/updatePriority.mts | 6 + src/version3/parameters/updatePriority.ts | 6 - src/version3/parameters/updateProject.mts | 26 + src/version3/parameters/updateProject.ts | 26 - .../parameters/updateProjectAvatar.mts | 6 + .../parameters/updateProjectAvatar.ts | 6 - .../parameters/updateProjectCategory.mts | 5 + .../parameters/updateProjectCategory.ts | 5 - .../parameters/updateProjectEmail.mts | 6 + src/version3/parameters/updateProjectEmail.ts | 6 - .../parameters/updateRemoteIssueLink.mts | 8 + .../parameters/updateRemoteIssueLink.ts | 8 - src/version3/parameters/updateResolution.mts | 6 + src/version3/parameters/updateResolution.ts | 6 - src/version3/parameters/updateScreen.mts | 6 + src/version3/parameters/updateScreen.ts | 6 - .../parameters/updateScreenScheme.mts | 6 + src/version3/parameters/updateScreenScheme.ts | 6 - .../parameters/updateSecurityLevel.mts | 8 + .../parameters/updateSecurityLevel.ts | 8 - src/version3/parameters/updateStatuses.mts | 3 + src/version3/parameters/updateStatuses.ts | 3 - .../parameters/updateUiModification.mts | 6 + .../parameters/updateUiModification.ts | 6 - src/version3/parameters/updateVersion.mts | 6 + src/version3/parameters/updateVersion.ts | 6 - .../parameters/updateWorkflowMapping.mts | 8 + .../parameters/updateWorkflowMapping.ts | 8 - .../parameters/updateWorkflowScheme.mts | 9 + .../parameters/updateWorkflowScheme.ts | 9 - .../parameters/updateWorkflowSchemeDraft.mts | 6 + .../parameters/updateWorkflowSchemeDraft.ts | 6 - .../updateWorkflowTransitionProperty.mts | 21 + .../updateWorkflowTransitionProperty.ts | 21 - ...teWorkflowTransitionRuleConfigurations.mts | 3 + ...ateWorkflowTransitionRuleConfigurations.ts | 3 - src/version3/parameters/updateWorklog.mts | 41 + src/version3/parameters/updateWorklog.ts | 41 - ...teProjectKey.ts => validateProjectKey.mts} | 0 .../parameters/workflowRuleSearch.mts | 6 + src/version3/parameters/workflowRuleSearch.ts | 6 - src/version3/permissionSchemes.mts | 558 ++++++++ src/version3/permissionSchemes.ts | 558 -------- src/version3/permissions.mts | 236 ++++ src/version3/permissions.ts | 236 ---- src/version3/projectAvatars.mts | 202 +++ src/version3/projectAvatars.ts | 202 --- src/version3/projectCategories.mts | 167 +++ src/version3/projectCategories.ts | 167 --- src/version3/projectComponents.mts | 296 +++++ src/version3/projectComponents.ts | 296 ----- src/version3/projectEmail.mts | 77 ++ src/version3/projectEmail.ts | 77 -- src/version3/projectFeatures.mts | 58 + src/version3/projectFeatures.ts | 58 - src/version3/projectKeyAndNameValidation.mts | 118 ++ src/version3/projectKeyAndNameValidation.ts | 118 -- src/version3/projectPermissionSchemes.mts | 168 +++ src/version3/projectPermissionSchemes.ts | 168 --- src/version3/projectProperties.mts | 174 +++ src/version3/projectProperties.ts | 174 --- src/version3/projectRoleActors.mts | 249 ++++ src/version3/projectRoleActors.ts | 249 ---- src/version3/projectRoles.mts | 422 +++++++ src/version3/projectRoles.ts | 422 ------- src/version3/projectTypes.mts | 119 ++ src/version3/projectTypes.ts | 119 -- src/version3/projectVersions.mts | 439 +++++++ src/version3/projectVersions.ts | 439 ------- src/version3/projects.mts | 514 ++++++++ src/version3/projects.ts | 514 -------- src/version3/screenSchemes.mts | 160 +++ src/version3/screenSchemes.ts | 160 --- src/version3/screenTabFields.mts | 150 +++ src/version3/screenTabFields.ts | 150 --- src/version3/screenTabs.mts | 166 +++ src/version3/screenTabs.ts | 166 --- src/version3/screens.mts | 243 ++++ src/version3/screens.ts | 243 ---- src/version3/serverInfo.mts | 33 + src/version3/serverInfo.ts | 33 - src/version3/status.mts | 196 +++ src/version3/status.ts | 196 --- src/version3/tasks.mts | 87 ++ src/version3/tasks.ts | 87 -- src/version3/timeTracking.mts | 169 +++ src/version3/timeTracking.ts | 169 --- src/version3/uIModificationsApps.ts | 171 --- src/version3/uiModificationsApps.mts | 171 +++ src/version3/userProperties.mts | 190 +++ src/version3/userProperties.ts | 190 --- src/version3/userSearch.mts | 608 +++++++++ src/version3/userSearch.ts | 608 --------- src/version3/users.mts | 493 ++++++++ src/version3/users.ts | 493 -------- src/version3/webhooks.mts | 221 ++++ src/version3/webhooks.ts | 221 ---- src/version3/workflowSchemeDrafts.mts | 542 ++++++++ src/version3/workflowSchemeDrafts.ts | 542 -------- .../workflowSchemeProjectAssociations.mts | 91 ++ .../workflowSchemeProjectAssociations.ts | 91 -- src/version3/workflowSchemes.mts | 596 +++++++++ src/version3/workflowSchemes.ts | 596 --------- src/version3/workflowStatusCategories.mts | 68 + src/version3/workflowStatusCategories.ts | 68 - src/version3/workflowStatuses.mts | 73 ++ src/version3/workflowStatuses.ts | 73 -- src/version3/workflowTransitionProperties.mts | 198 +++ src/version3/workflowTransitionProperties.ts | 198 --- src/version3/workflowTransitionRules.mts | 189 +++ src/version3/workflowTransitionRules.ts | 189 --- src/version3/workflows.mts | 142 +++ src/version3/workflows.ts | 142 --- .../agile/{sprint.test.ts => sprint.test.mts} | 0 .../{constants.ts => constants.mts} | 0 tests/integration/{index.ts => index.mts} | 0 ...pEnvironment.ts => cleanupEnvironment.mts} | 0 ...AgileProject.ts => createAgileProject.mts} | 0 .../utils/{createIssue.ts => createIssue.mts} | 0 ...reProject.ts => createSoftwareProject.mts} | 0 ...AgileProject.ts => deleteAgileProject.mts} | 0 ...reProject.ts => deleteSoftwareProject.mts} | 0 .../utils/{getClient.ts => getClient.mts} | 0 .../integration/utils/{index.ts => index.mts} | 0 ...eEnvironment.ts => prepareEnvironment.mts} | 0 .../{avatars.test.ts => avatars.test.mts} | 0 ...dashboards.test.ts => dashboards.test.mts} | 0 .../{groups.test.ts => groups.test.mts} | 0 ...ents.test.ts => issueAttachments.test.mts} | 0 ...omments.test.ts => issueComments.test.mts} | 0 ...sueSearch.test.ts => issueSearch.test.mts} | 0 ...issueVotes.test.ts => issueVotes.test.mts} | 0 .../{issues.test.ts => issues.test.mts} | 0 ...ectRoles.test.ts => projectRoles.test.mts} | 0 .../{projects.test.ts => projects.test.mts} | 0 .../{avatars.test.ts => avatars.test.mts} | 0 ...dashboards.test.ts => dashboards.test.mts} | 0 .../{groups.test.ts => groups.test.mts} | 0 ...ents.test.ts => issueAttachments.test.mts} | 0 ...omments.test.ts => issueComments.test.mts} | 0 ...sueSearch.test.ts => issueSearch.test.mts} | 0 ...issueVotes.test.ts => issueVotes.test.mts} | 0 .../{issues.test.ts => issues.test.mts} | 0 ...ectRoles.test.ts => projectRoles.test.mts} | 0 .../{projects.test.ts => projects.test.mts} | 0 .../agile/{board.test.ts => board.test.mts} | 0 tests/unit/agile/client/agileClient.test.mts | 36 + .../agile/{issue.test.ts => issue.test.mts} | 0 .../agile/{sprint.test.ts => sprint.test.mts} | 0 ...baseClient.test.ts => baseClient.test.mts} | 0 tests/unit/createClient.test.ts | 47 - tests/unit/index.test.mts | 41 + tests/unit/index.test.ts | 81 -- .../client/serviceDeskClient.test.mts | 26 + ...test.ts => authenticationService.test.mts} | 0 ...igration.test.ts => appMigration.test.mts} | 0 .../version2/client/version2Client.test.mts | 179 +++ ...omments.test.ts => issueComments.test.mts} | 0 ...sueFields.test.ts => issueFields.test.mts} | 0 ...issueLinks.test.ts => issueLinks.test.mts} | 0 ...ities.test.ts => issuePriorities.test.mts} | 0 ...inks.test.ts => issueRemoteLinks.test.mts} | 0 tests/unit/version2/issueSearch.test.mts | 69 + tests/unit/version2/issueSearch.test.ts | 69 - ...issueVotes.test.ts => issueVotes.test.mts} | 0 ...eWatcher.test.ts => issueWatcher.test.mts} | 0 .../{issues.test.ts => issues.test.mts} | 0 .../{myself.test.ts => myself.test.mts} | 0 ...sions.test.ts => projectVersions.test.mts} | 0 ...uses.test.ts => workflowStatuses.test.mts} | 0 ...igration.test.ts => appMigration.test.mts} | 0 .../version3/client/version3Client.test.mts | 181 +++ ...omments.test.ts => issueComments.test.mts} | 0 ...sueFields.test.ts => issueFields.test.mts} | 0 ...issueLinks.test.ts => issueLinks.test.mts} | 0 ...ities.test.ts => issuePriorities.test.mts} | 0 ...inks.test.ts => issueRemoteLinks.test.mts} | 0 tests/unit/version3/issueSearch.test.mts | 69 + tests/unit/version3/issueSearch.test.ts | 69 - ...issueVotes.test.ts => issueVotes.test.mts} | 0 ...eWatcher.test.ts => issueWatcher.test.mts} | 0 .../{issues.test.ts => issues.test.mts} | 0 .../{myself.test.ts => myself.test.mts} | 0 ...sions.test.ts => projectVersions.test.mts} | 0 ...uses.test.ts => workflowStatuses.test.mts} | 0 tsconfig.json | 22 +- vitest.config.mts | 8 + 3814 files changed, 71523 insertions(+), 70320 deletions(-) rename examples/src/{addFixVersion.ts => addFixVersion.mts} (100%) rename examples/src/{addWorklog.ts => addWorklog.mts} (100%) rename examples/src/{basic.ts => basic.mts} (100%) rename examples/src/{credentials.ts => credentials.mts} (100%) rename examples/src/{getAllWorklogs.ts => getAllWorklogs.mts} (100%) rename examples/src/utils/{addWorklog.ts => addWorklog.mts} (100%) rename examples/src/utils/{createIssue.ts => createIssue.mts} (100%) rename examples/src/utils/{index.ts => index.mts} (100%) create mode 100644 rollup.config.ts create mode 100644 src/agile/backlog.mts delete mode 100644 src/agile/backlog.ts create mode 100644 src/agile/board.mts delete mode 100644 src/agile/board.ts create mode 100644 src/agile/builds.mts delete mode 100644 src/agile/builds.ts create mode 100644 src/agile/client/agileClient.mts delete mode 100644 src/agile/client/agileClient.ts delete mode 100644 src/agile/client/index.ts create mode 100644 src/agile/deployments.mts delete mode 100644 src/agile/deployments.ts create mode 100644 src/agile/developmentInformation.mts delete mode 100644 src/agile/developmentInformation.ts create mode 100644 src/agile/devopsComponents.mts delete mode 100644 src/agile/devopsComponents.ts create mode 100644 src/agile/epic.mts delete mode 100644 src/agile/epic.ts create mode 100644 src/agile/featureFlags.mts delete mode 100644 src/agile/featureFlags.ts create mode 100644 src/agile/index.mts delete mode 100644 src/agile/index.ts create mode 100644 src/agile/issue.mts delete mode 100644 src/agile/issue.ts rename src/agile/models/{avatarUrls.ts => avatarUrls.mts} (100%) create mode 100644 src/agile/models/board.mts delete mode 100644 src/agile/models/board.ts create mode 100644 src/agile/models/createBoard.mts delete mode 100644 src/agile/models/createBoard.ts rename src/agile/models/{epic.ts => epic.mts} (100%) rename src/agile/models/{existsByProperties.ts => existsByProperties.mts} (100%) create mode 100644 src/agile/models/fields.mts delete mode 100644 src/agile/models/fields.ts rename src/agile/models/{fixVersion.ts => fixVersion.mts} (100%) create mode 100644 src/agile/models/getAllBoards.mts delete mode 100644 src/agile/models/getAllBoards.ts rename src/agile/models/{getAllQuickFilters.ts => getAllQuickFilters.mts} (100%) create mode 100644 src/agile/models/getBoard.mts delete mode 100644 src/agile/models/getBoard.ts rename src/agile/models/{getBoardByFilterId.ts => getBoardByFilterId.mts} (100%) rename src/agile/models/{getBuildByKey.ts => getBuildByKey.mts} (100%) rename src/agile/models/{getComponentById.ts => getComponentById.mts} (100%) rename src/agile/models/{getConfiguration.ts => getConfiguration.mts} (100%) rename src/agile/models/{getDeploymentByKey.ts => getDeploymentByKey.mts} (100%) rename src/agile/models/{getDeploymentGatingStatusByKey.ts => getDeploymentGatingStatusByKey.mts} (100%) rename src/agile/models/{getFeatureFlagById.ts => getFeatureFlagById.mts} (100%) rename src/agile/models/{getFeaturesForBoard.ts => getFeaturesForBoard.mts} (100%) rename src/agile/models/{getIncidentById.ts => getIncidentById.mts} (100%) rename src/agile/models/{getLinkedWorkspaceById.ts => getLinkedWorkspaceById.mts} (100%) rename src/agile/models/{getLinkedWorkspaces.ts => getLinkedWorkspaces.mts} (100%) rename src/agile/models/{getQuickFilter.ts => getQuickFilter.mts} (100%) rename src/agile/models/{getRemoteLinkById.ts => getRemoteLinkById.mts} (100%) rename src/agile/models/{getReportsForBoard.ts => getReportsForBoard.mts} (100%) rename src/agile/models/{getRepository.ts => getRepository.mts} (100%) rename src/agile/models/{getReviewById.ts => getReviewById.mts} (100%) rename src/agile/models/{getVulnerabilityById.ts => getVulnerabilityById.mts} (100%) rename src/agile/models/{getWorkspaces.ts => getWorkspaces.mts} (100%) rename src/agile/models/{group.ts => group.mts} (100%) create mode 100644 src/agile/models/index.mts delete mode 100644 src/agile/models/index.ts create mode 100644 src/agile/models/issue.mts delete mode 100644 src/agile/models/issue.ts create mode 100644 src/agile/models/issueTransition.mts delete mode 100644 src/agile/models/issueTransition.ts rename src/agile/models/{issueType.ts => issueType.mts} (100%) rename src/agile/models/{jsonType.ts => jsonType.mts} (100%) rename src/agile/models/{linkGroup.ts => linkGroup.mts} (100%) rename src/agile/models/{linkedSecurityWorkspaceIds.ts => linkedSecurityWorkspaceIds.mts} (100%) rename src/agile/models/{linkedWorkspace.ts => linkedWorkspace.mts} (100%) create mode 100644 src/agile/models/operations.mts delete mode 100644 src/agile/models/operations.ts rename src/agile/models/{progress.ts => progress.mts} (100%) create mode 100644 src/agile/models/project.mts delete mode 100644 src/agile/models/project.ts create mode 100644 src/agile/models/projects.mts delete mode 100644 src/agile/models/projects.ts create mode 100644 src/agile/models/scope.mts delete mode 100644 src/agile/models/scope.ts create mode 100644 src/agile/models/searchResults.mts delete mode 100644 src/agile/models/searchResults.ts rename src/agile/models/{sprint.ts => sprint.mts} (100%) create mode 100644 src/agile/models/status.mts delete mode 100644 src/agile/models/status.ts rename src/agile/models/{statusCategory.ts => statusCategory.mts} (100%) rename src/agile/models/{storeDevelopmentInformation.ts => storeDevelopmentInformation.mts} (100%) rename src/agile/models/{submitBuilds.ts => submitBuilds.mts} (100%) rename src/agile/models/{submitComponents.ts => submitComponents.mts} (100%) rename src/agile/models/{submitDeployments.ts => submitDeployments.mts} (100%) rename src/agile/models/{submitEntity.ts => submitEntity.mts} (100%) rename src/agile/models/{submitFeatureFlags.ts => submitFeatureFlags.mts} (100%) rename src/agile/models/{submitOperationsWorkspaces.ts => submitOperationsWorkspaces.mts} (100%) rename src/agile/models/{submitRemoteLinks.ts => submitRemoteLinks.mts} (100%) rename src/agile/models/{submitVulnerabilities.ts => submitVulnerabilities.mts} (100%) rename src/agile/models/{submittedVulnerabilitiesResult.ts => submittedVulnerabilitiesResult.mts} (100%) rename src/agile/models/{toggleFeatures.ts => toggleFeatures.mts} (100%) create mode 100644 src/agile/models/user.mts delete mode 100644 src/agile/models/user.ts rename src/agile/models/{version.ts => version.mts} (100%) rename src/agile/models/{vulnerability.ts => vulnerability.mts} (100%) create mode 100644 src/agile/operations.mts delete mode 100644 src/agile/operations.ts rename src/agile/parameters/{createBoard.ts => createBoard.mts} (100%) rename src/agile/parameters/{createSprint.ts => createSprint.mts} (100%) rename src/agile/parameters/{deleteBoard.ts => deleteBoard.mts} (100%) rename src/agile/parameters/{deleteBoardProperty.ts => deleteBoardProperty.mts} (100%) rename src/agile/parameters/{deleteBuildByKey.ts => deleteBuildByKey.mts} (100%) rename src/agile/parameters/{deleteBuildsByProperty.ts => deleteBuildsByProperty.mts} (100%) rename src/agile/parameters/{deleteByProperties.ts => deleteByProperties.mts} (100%) rename src/agile/parameters/{deleteComponentById.ts => deleteComponentById.mts} (100%) rename src/agile/parameters/{deleteComponentsByProperty.ts => deleteComponentsByProperty.mts} (100%) rename src/agile/parameters/{deleteDeploymentByKey.ts => deleteDeploymentByKey.mts} (100%) rename src/agile/parameters/{deleteDeploymentsByProperty.ts => deleteDeploymentsByProperty.mts} (100%) rename src/agile/parameters/{deleteEntity.ts => deleteEntity.mts} (100%) rename src/agile/parameters/{deleteEntityByProperty.ts => deleteEntityByProperty.mts} (100%) rename src/agile/parameters/{deleteFeatureFlagById.ts => deleteFeatureFlagById.mts} (100%) rename src/agile/parameters/{deleteFeatureFlagsByProperty.ts => deleteFeatureFlagsByProperty.mts} (100%) rename src/agile/parameters/{deleteIncidentById.ts => deleteIncidentById.mts} (100%) rename src/agile/parameters/{deleteLinkedWorkspaces.ts => deleteLinkedWorkspaces.mts} (100%) rename src/agile/parameters/{deleteProperty.ts => deleteProperty.mts} (100%) rename src/agile/parameters/{deleteRemoteLinkById.ts => deleteRemoteLinkById.mts} (100%) rename src/agile/parameters/{deleteRemoteLinksByProperty.ts => deleteRemoteLinksByProperty.mts} (100%) rename src/agile/parameters/{deleteRepository.ts => deleteRepository.mts} (100%) rename src/agile/parameters/{deleteReviewById.ts => deleteReviewById.mts} (100%) rename src/agile/parameters/{deleteSprint.ts => deleteSprint.mts} (100%) rename src/agile/parameters/{deleteVulnerabilitiesByProperty.ts => deleteVulnerabilitiesByProperty.mts} (100%) rename src/agile/parameters/{deleteVulnerabilityById.ts => deleteVulnerabilityById.mts} (100%) rename src/agile/parameters/{deleteWorkspaces.ts => deleteWorkspaces.mts} (100%) rename src/agile/parameters/{estimateIssueForBoard.ts => estimateIssueForBoard.mts} (100%) rename src/agile/parameters/{existsByProperties.ts => existsByProperties.mts} (100%) rename src/agile/parameters/{getAllBoards.ts => getAllBoards.mts} (100%) rename src/agile/parameters/{getAllQuickFilters.ts => getAllQuickFilters.mts} (100%) rename src/agile/parameters/{getAllSprints.ts => getAllSprints.mts} (100%) rename src/agile/parameters/{getAllVersions.ts => getAllVersions.mts} (100%) rename src/agile/parameters/{getBoard.ts => getBoard.mts} (100%) rename src/agile/parameters/{getBoardByFilterId.ts => getBoardByFilterId.mts} (100%) create mode 100644 src/agile/parameters/getBoardIssuesForEpic.mts delete mode 100644 src/agile/parameters/getBoardIssuesForEpic.ts create mode 100644 src/agile/parameters/getBoardIssuesForSprint.mts delete mode 100644 src/agile/parameters/getBoardIssuesForSprint.ts rename src/agile/parameters/{getBoardProperty.ts => getBoardProperty.mts} (100%) rename src/agile/parameters/{getBoardPropertyKeys.ts => getBoardPropertyKeys.mts} (100%) rename src/agile/parameters/{getBuildByKey.ts => getBuildByKey.mts} (100%) rename src/agile/parameters/{getComponentById.ts => getComponentById.mts} (100%) rename src/agile/parameters/{getConfiguration.ts => getConfiguration.mts} (100%) rename src/agile/parameters/{getDeploymentByKey.ts => getDeploymentByKey.mts} (100%) rename src/agile/parameters/{getDeploymentGatingStatusByKey.ts => getDeploymentGatingStatusByKey.mts} (100%) rename src/agile/parameters/{getEpic.ts => getEpic.mts} (100%) rename src/agile/parameters/{getEpics.ts => getEpics.mts} (100%) rename src/agile/parameters/{getFeatureFlagById.ts => getFeatureFlagById.mts} (100%) rename src/agile/parameters/{getFeaturesForBoard.ts => getFeaturesForBoard.mts} (100%) rename src/agile/parameters/{getIncidentById.ts => getIncidentById.mts} (100%) rename src/agile/parameters/{getIssue.ts => getIssue.mts} (100%) rename src/agile/parameters/{getIssueEstimationForBoard.ts => getIssueEstimationForBoard.mts} (100%) create mode 100644 src/agile/parameters/getIssuesForBacklog.mts delete mode 100644 src/agile/parameters/getIssuesForBacklog.ts create mode 100644 src/agile/parameters/getIssuesForBoard.mts delete mode 100644 src/agile/parameters/getIssuesForBoard.ts create mode 100644 src/agile/parameters/getIssuesForEpic.mts delete mode 100644 src/agile/parameters/getIssuesForEpic.ts create mode 100644 src/agile/parameters/getIssuesForSprint.mts delete mode 100644 src/agile/parameters/getIssuesForSprint.ts create mode 100644 src/agile/parameters/getIssuesWithoutEpic.mts delete mode 100644 src/agile/parameters/getIssuesWithoutEpic.ts create mode 100644 src/agile/parameters/getIssuesWithoutEpicForBoard.mts delete mode 100644 src/agile/parameters/getIssuesWithoutEpicForBoard.ts rename src/agile/parameters/{getLinkedWorkspaceById.ts => getLinkedWorkspaceById.mts} (100%) rename src/agile/parameters/{getProjects.ts => getProjects.mts} (100%) rename src/agile/parameters/{getProjectsFull.ts => getProjectsFull.mts} (100%) rename src/agile/parameters/{getPropertiesKeys.ts => getPropertiesKeys.mts} (100%) rename src/agile/parameters/{getProperty.ts => getProperty.mts} (100%) rename src/agile/parameters/{getQuickFilter.ts => getQuickFilter.mts} (100%) rename src/agile/parameters/{getRemoteLinkById.ts => getRemoteLinkById.mts} (100%) rename src/agile/parameters/{getReportsForBoard.ts => getReportsForBoard.mts} (100%) rename src/agile/parameters/{getRepository.ts => getRepository.mts} (100%) rename src/agile/parameters/{getReviewById.ts => getReviewById.mts} (100%) rename src/agile/parameters/{getSprint.ts => getSprint.mts} (100%) rename src/agile/parameters/{getVulnerabilityById.ts => getVulnerabilityById.mts} (100%) rename src/agile/parameters/{getWorkspaces.ts => getWorkspaces.mts} (100%) create mode 100644 src/agile/parameters/index.mts delete mode 100644 src/agile/parameters/index.ts rename src/agile/parameters/{moveIssuesToBacklog.ts => moveIssuesToBacklog.mts} (100%) rename src/agile/parameters/{moveIssuesToBacklogForBoard.ts => moveIssuesToBacklogForBoard.mts} (100%) rename src/agile/parameters/{moveIssuesToBoard.ts => moveIssuesToBoard.mts} (100%) rename src/agile/parameters/{moveIssuesToEpic.ts => moveIssuesToEpic.mts} (100%) rename src/agile/parameters/{moveIssuesToSprintAndRank.ts => moveIssuesToSprintAndRank.mts} (100%) rename src/agile/parameters/{partiallyUpdateEpic.ts => partiallyUpdateEpic.mts} (100%) rename src/agile/parameters/{partiallyUpdateSprint.ts => partiallyUpdateSprint.mts} (100%) rename src/agile/parameters/{rankEpics.ts => rankEpics.mts} (100%) rename src/agile/parameters/{rankIssues.ts => rankIssues.mts} (100%) rename src/agile/parameters/{removeIssuesFromEpic.ts => removeIssuesFromEpic.mts} (100%) rename src/agile/parameters/{searchEpics.ts => searchEpics.mts} (100%) rename src/agile/parameters/{setBoardProperty.ts => setBoardProperty.mts} (100%) rename src/agile/parameters/{setProperty.ts => setProperty.mts} (100%) rename src/agile/parameters/{storeDevelopmentInformation.ts => storeDevelopmentInformation.mts} (100%) rename src/agile/parameters/{submitBuilds.ts => submitBuilds.mts} (100%) rename src/agile/parameters/{submitComponents.ts => submitComponents.mts} (100%) rename src/agile/parameters/{submitDeployments.ts => submitDeployments.mts} (100%) rename src/agile/parameters/{submitEntity.ts => submitEntity.mts} (100%) rename src/agile/parameters/{submitFeatureFlags.ts => submitFeatureFlags.mts} (100%) rename src/agile/parameters/{submitOperationsWorkspaces.ts => submitOperationsWorkspaces.mts} (100%) rename src/agile/parameters/{submitRemoteLinks.ts => submitRemoteLinks.mts} (100%) rename src/agile/parameters/{submitVulnerabilities.ts => submitVulnerabilities.mts} (100%) rename src/agile/parameters/{submitWorkspaces.ts => submitWorkspaces.mts} (100%) rename src/agile/parameters/{swapSprint.ts => swapSprint.mts} (100%) rename src/agile/parameters/{toggleFeatures.ts => toggleFeatures.mts} (100%) rename src/agile/parameters/{updateSprint.ts => updateSprint.mts} (100%) create mode 100644 src/agile/remoteLinks.mts delete mode 100644 src/agile/remoteLinks.ts create mode 100644 src/agile/securityInformation.mts delete mode 100644 src/agile/securityInformation.ts create mode 100644 src/agile/sprint.mts delete mode 100644 src/agile/sprint.ts create mode 100644 src/callback.mts delete mode 100644 src/callback.ts create mode 100644 src/clients/baseClient.mts delete mode 100644 src/clients/baseClient.ts create mode 100644 src/clients/client.mts delete mode 100644 src/clients/client.ts rename src/clients/{httpException.ts => httpException.mts} (100%) create mode 100644 src/clients/index.mts delete mode 100644 src/clients/index.ts create mode 100644 src/config.mts delete mode 100644 src/config.ts delete mode 100644 src/createClient.ts create mode 100644 src/index.mts delete mode 100644 src/index.ts rename src/{paginated.ts => paginated.mts} (100%) rename src/{paramSerializer.ts => paramSerializer.mts} (100%) create mode 100644 src/requestConfig.mts delete mode 100644 src/requestConfig.ts delete mode 100644 src/serviceDesk/client/index.ts create mode 100644 src/serviceDesk/client/serviceDeskClient.mts delete mode 100644 src/serviceDesk/client/serviceDeskClient.ts create mode 100644 src/serviceDesk/customer.mts delete mode 100644 src/serviceDesk/customer.ts create mode 100644 src/serviceDesk/index.mts delete mode 100644 src/serviceDesk/index.ts create mode 100644 src/serviceDesk/info.mts delete mode 100644 src/serviceDesk/info.ts create mode 100644 src/serviceDesk/insight.mts delete mode 100644 src/serviceDesk/insight.ts create mode 100644 src/serviceDesk/knowledgeBase.mts delete mode 100644 src/serviceDesk/knowledgeBase.ts rename src/serviceDesk/models/{additionalComment.ts => additionalComment.mts} (100%) create mode 100644 src/serviceDesk/models/approval.mts delete mode 100644 src/serviceDesk/models/approval.ts rename src/serviceDesk/models/{approvalDecisionRequest.ts => approvalDecisionRequest.mts} (100%) create mode 100644 src/serviceDesk/models/approver.mts delete mode 100644 src/serviceDesk/models/approver.ts create mode 100644 src/serviceDesk/models/article.mts delete mode 100644 src/serviceDesk/models/article.ts create mode 100644 src/serviceDesk/models/attachment.mts delete mode 100644 src/serviceDesk/models/attachment.ts create mode 100644 src/serviceDesk/models/attachmentCreate.mts delete mode 100644 src/serviceDesk/models/attachmentCreate.ts create mode 100644 src/serviceDesk/models/attachmentCreateResult.mts delete mode 100644 src/serviceDesk/models/attachmentCreateResult.ts rename src/serviceDesk/models/{attachmentLink.ts => attachmentLink.mts} (100%) rename src/serviceDesk/models/{avatarUrls.ts => avatarUrls.mts} (100%) create mode 100644 src/serviceDesk/models/comment.mts delete mode 100644 src/serviceDesk/models/comment.ts rename src/serviceDesk/models/{commentCreate.ts => commentCreate.mts} (100%) rename src/serviceDesk/models/{content.ts => content.mts} (100%) create mode 100644 src/serviceDesk/models/csatFeedbackFull.mts delete mode 100644 src/serviceDesk/models/csatFeedbackFull.ts rename src/serviceDesk/models/{customerCreate.ts => customerCreate.mts} (100%) create mode 100644 src/serviceDesk/models/customerRequest.mts delete mode 100644 src/serviceDesk/models/customerRequest.ts rename src/serviceDesk/models/{customerRequestAction.ts => customerRequestAction.mts} (100%) create mode 100644 src/serviceDesk/models/customerRequestActions.mts delete mode 100644 src/serviceDesk/models/customerRequestActions.ts create mode 100644 src/serviceDesk/models/customerRequestCreateMeta.mts delete mode 100644 src/serviceDesk/models/customerRequestCreateMeta.ts rename src/serviceDesk/models/{customerRequestFieldValue.ts => customerRequestFieldValue.mts} (100%) rename src/serviceDesk/models/{customerRequestLink.ts => customerRequestLink.mts} (100%) create mode 100644 src/serviceDesk/models/customerRequestStatus.mts delete mode 100644 src/serviceDesk/models/customerRequestStatus.ts rename src/serviceDesk/models/{customerTransition.ts => customerTransition.mts} (100%) create mode 100644 src/serviceDesk/models/customerTransitionExecution.mts delete mode 100644 src/serviceDesk/models/customerTransitionExecution.ts rename src/serviceDesk/models/{date.ts => date.mts} (100%) rename src/serviceDesk/models/{duration.ts => duration.mts} (100%) rename src/serviceDesk/models/{entityProperty.ts => entityProperty.mts} (100%) create mode 100644 src/serviceDesk/models/index.mts delete mode 100644 src/serviceDesk/models/index.ts rename src/serviceDesk/models/{insightWorkspace.ts => insightWorkspace.mts} (100%) create mode 100644 src/serviceDesk/models/issue.mts delete mode 100644 src/serviceDesk/models/issue.ts create mode 100644 src/serviceDesk/models/issueTransition.mts delete mode 100644 src/serviceDesk/models/issueTransition.ts rename src/serviceDesk/models/{jsonType.ts => jsonType.mts} (100%) create mode 100644 src/serviceDesk/models/organization.mts delete mode 100644 src/serviceDesk/models/organization.ts rename src/serviceDesk/models/{organizationCreate.ts => organizationCreate.mts} (100%) rename src/serviceDesk/models/{organizationServiceDeskUpdate.ts => organizationServiceDeskUpdate.mts} (100%) create mode 100644 src/serviceDesk/models/pagedApproval.mts delete mode 100644 src/serviceDesk/models/pagedApproval.ts create mode 100644 src/serviceDesk/models/pagedArticle.mts delete mode 100644 src/serviceDesk/models/pagedArticle.ts create mode 100644 src/serviceDesk/models/pagedAttachment.mts delete mode 100644 src/serviceDesk/models/pagedAttachment.ts create mode 100644 src/serviceDesk/models/pagedComment.mts delete mode 100644 src/serviceDesk/models/pagedComment.ts create mode 100644 src/serviceDesk/models/pagedCustomerRequest.mts delete mode 100644 src/serviceDesk/models/pagedCustomerRequest.ts create mode 100644 src/serviceDesk/models/pagedCustomerRequestStatus.mts delete mode 100644 src/serviceDesk/models/pagedCustomerRequestStatus.ts create mode 100644 src/serviceDesk/models/pagedCustomerTransition.mts delete mode 100644 src/serviceDesk/models/pagedCustomerTransition.ts create mode 100644 src/serviceDesk/models/pagedInsightWorkspace.mts delete mode 100644 src/serviceDesk/models/pagedInsightWorkspace.ts create mode 100644 src/serviceDesk/models/pagedIssue.mts delete mode 100644 src/serviceDesk/models/pagedIssue.ts rename src/serviceDesk/models/{pagedLink.ts => pagedLink.mts} (100%) create mode 100644 src/serviceDesk/models/pagedOrganization.mts delete mode 100644 src/serviceDesk/models/pagedOrganization.ts create mode 100644 src/serviceDesk/models/pagedQueue.mts delete mode 100644 src/serviceDesk/models/pagedQueue.ts create mode 100644 src/serviceDesk/models/pagedRequestType.mts delete mode 100644 src/serviceDesk/models/pagedRequestType.ts create mode 100644 src/serviceDesk/models/pagedRequestTypeGroup.mts delete mode 100644 src/serviceDesk/models/pagedRequestTypeGroup.ts create mode 100644 src/serviceDesk/models/pagedServiceDesk.mts delete mode 100644 src/serviceDesk/models/pagedServiceDesk.ts create mode 100644 src/serviceDesk/models/pagedSlaInformation.mts delete mode 100644 src/serviceDesk/models/pagedSlaInformation.ts create mode 100644 src/serviceDesk/models/pagedUser.mts delete mode 100644 src/serviceDesk/models/pagedUser.ts rename src/serviceDesk/models/{propertyKey.ts => propertyKey.mts} (100%) create mode 100644 src/serviceDesk/models/propertyKeys.mts delete mode 100644 src/serviceDesk/models/propertyKeys.ts create mode 100644 src/serviceDesk/models/queue.mts delete mode 100644 src/serviceDesk/models/queue.ts rename src/serviceDesk/models/{renderedValue.ts => renderedValue.mts} (100%) rename src/serviceDesk/models/{requestCreate.ts => requestCreate.mts} (100%) rename src/serviceDesk/models/{requestNotificationSubscription.ts => requestNotificationSubscription.mts} (100%) rename src/serviceDesk/models/{requestParticipantUpdate.ts => requestParticipantUpdate.mts} (100%) create mode 100644 src/serviceDesk/models/requestType.mts delete mode 100644 src/serviceDesk/models/requestType.ts rename src/serviceDesk/models/{requestTypeCreate.ts => requestTypeCreate.mts} (100%) create mode 100644 src/serviceDesk/models/requestTypeField.mts delete mode 100644 src/serviceDesk/models/requestTypeField.ts rename src/serviceDesk/models/{requestTypeFieldValue.ts => requestTypeFieldValue.mts} (100%) rename src/serviceDesk/models/{requestTypeGroup.ts => requestTypeGroup.mts} (100%) create mode 100644 src/serviceDesk/models/requestTypeIcon.mts delete mode 100644 src/serviceDesk/models/requestTypeIcon.ts rename src/serviceDesk/models/{requestTypeIconLink.ts => requestTypeIconLink.mts} (100%) rename src/serviceDesk/models/{selfLink.ts => selfLink.mts} (100%) create mode 100644 src/serviceDesk/models/serviceDesk.mts delete mode 100644 src/serviceDesk/models/serviceDesk.ts rename src/serviceDesk/models/{serviceDeskCustomer.ts => serviceDeskCustomer.mts} (100%) create mode 100644 src/serviceDesk/models/slaInformation.mts delete mode 100644 src/serviceDesk/models/slaInformation.ts create mode 100644 src/serviceDesk/models/slaInformationCompletedCycle.mts delete mode 100644 src/serviceDesk/models/slaInformationCompletedCycle.ts create mode 100644 src/serviceDesk/models/slaInformationOngoingCycle.mts delete mode 100644 src/serviceDesk/models/slaInformationOngoingCycle.ts create mode 100644 src/serviceDesk/models/softwareInfo.mts delete mode 100644 src/serviceDesk/models/softwareInfo.ts rename src/serviceDesk/models/{source.ts => source.mts} (100%) rename src/serviceDesk/models/{statusCategory.ts => statusCategory.mts} (100%) create mode 100644 src/serviceDesk/models/statusDetails.mts delete mode 100644 src/serviceDesk/models/statusDetails.ts create mode 100644 src/serviceDesk/models/user.mts delete mode 100644 src/serviceDesk/models/user.ts create mode 100644 src/serviceDesk/models/userDetails.mts delete mode 100644 src/serviceDesk/models/userDetails.ts rename src/serviceDesk/models/{userLink.ts => userLink.mts} (100%) rename src/serviceDesk/models/{usersOrganizationUpdate.ts => usersOrganizationUpdate.mts} (100%) create mode 100644 src/serviceDesk/organization.mts delete mode 100644 src/serviceDesk/organization.ts create mode 100644 src/serviceDesk/parameters/addCustomers.mts delete mode 100644 src/serviceDesk/parameters/addCustomers.ts create mode 100644 src/serviceDesk/parameters/addOrganization.mts delete mode 100644 src/serviceDesk/parameters/addOrganization.ts create mode 100644 src/serviceDesk/parameters/addRequestParticipants.mts delete mode 100644 src/serviceDesk/parameters/addRequestParticipants.ts create mode 100644 src/serviceDesk/parameters/addUsersToOrganization.mts delete mode 100644 src/serviceDesk/parameters/addUsersToOrganization.ts create mode 100644 src/serviceDesk/parameters/answerApproval.mts delete mode 100644 src/serviceDesk/parameters/answerApproval.ts rename src/serviceDesk/parameters/{attachTemporaryFile.ts => attachTemporaryFile.mts} (100%) create mode 100644 src/serviceDesk/parameters/createAttachment.mts delete mode 100644 src/serviceDesk/parameters/createAttachment.ts create mode 100644 src/serviceDesk/parameters/createCustomer.mts delete mode 100644 src/serviceDesk/parameters/createCustomer.ts create mode 100644 src/serviceDesk/parameters/createCustomerRequest.mts delete mode 100644 src/serviceDesk/parameters/createCustomerRequest.ts create mode 100644 src/serviceDesk/parameters/createOrganization.mts delete mode 100644 src/serviceDesk/parameters/createOrganization.ts create mode 100644 src/serviceDesk/parameters/createRequestComment.mts delete mode 100644 src/serviceDesk/parameters/createRequestComment.ts create mode 100644 src/serviceDesk/parameters/createRequestType.mts delete mode 100644 src/serviceDesk/parameters/createRequestType.ts rename src/serviceDesk/parameters/{deleteFeedback.ts => deleteFeedback.mts} (100%) rename src/serviceDesk/parameters/{deleteOrganization.ts => deleteOrganization.mts} (100%) rename src/serviceDesk/parameters/{deleteOrganizationProperty.ts => deleteOrganizationProperty.mts} (100%) rename src/serviceDesk/parameters/{deleteProperty.ts => deleteProperty.mts} (100%) rename src/serviceDesk/parameters/{deleteRequestType.ts => deleteRequestType.mts} (100%) rename src/serviceDesk/parameters/{getAllRequestTypes.ts => getAllRequestTypes.mts} (100%) rename src/serviceDesk/parameters/{getApprovalById.ts => getApprovalById.mts} (100%) rename src/serviceDesk/parameters/{getApprovals.ts => getApprovals.mts} (100%) rename src/serviceDesk/parameters/{getArticles.ts => getArticles.mts} (100%) rename src/serviceDesk/parameters/{getAttachmentContent.ts => getAttachmentContent.mts} (100%) rename src/serviceDesk/parameters/{getAttachmentThumbnail.ts => getAttachmentThumbnail.mts} (100%) rename src/serviceDesk/parameters/{getAttachmentsForRequest.ts => getAttachmentsForRequest.mts} (100%) rename src/serviceDesk/parameters/{getCommentAttachments.ts => getCommentAttachments.mts} (100%) rename src/serviceDesk/parameters/{getCustomerRequestByIdOrKey.ts => getCustomerRequestByIdOrKey.mts} (100%) rename src/serviceDesk/parameters/{getCustomerRequestStatus.ts => getCustomerRequestStatus.mts} (100%) rename src/serviceDesk/parameters/{getCustomerRequests.ts => getCustomerRequests.mts} (100%) rename src/serviceDesk/parameters/{getCustomerTransitions.ts => getCustomerTransitions.mts} (100%) rename src/serviceDesk/parameters/{getCustomers.ts => getCustomers.mts} (100%) rename src/serviceDesk/parameters/{getFeedback.ts => getFeedback.mts} (100%) rename src/serviceDesk/parameters/{getInsightWorkspaces.ts => getInsightWorkspaces.mts} (100%) rename src/serviceDesk/parameters/{getIssuesInQueue.ts => getIssuesInQueue.mts} (100%) rename src/serviceDesk/parameters/{getOrganization.ts => getOrganization.mts} (100%) rename src/serviceDesk/parameters/{getOrganizationProperty.ts => getOrganizationProperty.mts} (100%) rename src/serviceDesk/parameters/{getOrganizationPropertyKeys.ts => getOrganizationPropertyKeys.mts} (100%) rename src/serviceDesk/parameters/{getOrganizations.ts => getOrganizations.mts} (100%) rename src/serviceDesk/parameters/{getPropertiesKeys.ts => getPropertiesKeys.mts} (100%) rename src/serviceDesk/parameters/{getProperty.ts => getProperty.mts} (100%) rename src/serviceDesk/parameters/{getQueue.ts => getQueue.mts} (100%) rename src/serviceDesk/parameters/{getQueues.ts => getQueues.mts} (100%) rename src/serviceDesk/parameters/{getRequestCommentById.ts => getRequestCommentById.mts} (100%) rename src/serviceDesk/parameters/{getRequestComments.ts => getRequestComments.mts} (100%) rename src/serviceDesk/parameters/{getRequestParticipants.ts => getRequestParticipants.mts} (100%) rename src/serviceDesk/parameters/{getRequestTypeById.ts => getRequestTypeById.mts} (100%) rename src/serviceDesk/parameters/{getRequestTypeFields.ts => getRequestTypeFields.mts} (100%) rename src/serviceDesk/parameters/{getRequestTypeGroups.ts => getRequestTypeGroups.mts} (100%) rename src/serviceDesk/parameters/{getRequestTypes.ts => getRequestTypes.mts} (100%) rename src/serviceDesk/parameters/{getServiceDeskById.ts => getServiceDeskById.mts} (100%) rename src/serviceDesk/parameters/{getServiceDesks.ts => getServiceDesks.mts} (100%) rename src/serviceDesk/parameters/{getSlaInformation.ts => getSlaInformation.mts} (100%) rename src/serviceDesk/parameters/{getSlaInformationById.ts => getSlaInformationById.mts} (100%) rename src/serviceDesk/parameters/{getSubscriptionStatus.ts => getSubscriptionStatus.mts} (100%) rename src/serviceDesk/parameters/{getUsersInOrganization.ts => getUsersInOrganization.mts} (100%) create mode 100644 src/serviceDesk/parameters/index.mts delete mode 100644 src/serviceDesk/parameters/index.ts create mode 100644 src/serviceDesk/parameters/performCustomerTransition.mts delete mode 100644 src/serviceDesk/parameters/performCustomerTransition.ts create mode 100644 src/serviceDesk/parameters/postFeedback.mts delete mode 100644 src/serviceDesk/parameters/postFeedback.ts create mode 100644 src/serviceDesk/parameters/removeCustomers.mts delete mode 100644 src/serviceDesk/parameters/removeCustomers.ts create mode 100644 src/serviceDesk/parameters/removeOrganization.mts delete mode 100644 src/serviceDesk/parameters/removeOrganization.ts create mode 100644 src/serviceDesk/parameters/removeRequestParticipants.mts delete mode 100644 src/serviceDesk/parameters/removeRequestParticipants.ts create mode 100644 src/serviceDesk/parameters/removeUsersFromOrganization.mts delete mode 100644 src/serviceDesk/parameters/removeUsersFromOrganization.ts rename src/serviceDesk/parameters/{setOrganizationProperty.ts => setOrganizationProperty.mts} (100%) rename src/serviceDesk/parameters/{setProperty.ts => setProperty.mts} (100%) rename src/serviceDesk/parameters/{subscribe.ts => subscribe.mts} (100%) rename src/serviceDesk/parameters/{unsubscribe.ts => unsubscribe.mts} (100%) create mode 100644 src/serviceDesk/request.mts delete mode 100644 src/serviceDesk/request.ts create mode 100644 src/serviceDesk/requestType.mts delete mode 100644 src/serviceDesk/requestType.ts create mode 100644 src/serviceDesk/serviceDesk.mts delete mode 100644 src/serviceDesk/serviceDesk.ts create mode 100644 src/services/authenticationService/authentications/createBasicAuthenticationToken.mts delete mode 100644 src/services/authenticationService/authentications/createBasicAuthenticationToken.ts create mode 100644 src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts delete mode 100644 src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts create mode 100644 src/services/authenticationService/authentications/createPATAuthentication.mts delete mode 100644 src/services/authenticationService/authentications/createPATAuthentication.ts create mode 100644 src/services/authenticationService/authentications/index.mts delete mode 100644 src/services/authenticationService/authentications/index.ts create mode 100644 src/services/authenticationService/base64Encoder.mts delete mode 100644 src/services/authenticationService/base64Encoder.ts create mode 100644 src/services/authenticationService/getAuthenticationToken.mts delete mode 100644 src/services/authenticationService/getAuthenticationToken.ts create mode 100644 src/services/authenticationService/index.mts delete mode 100644 src/services/authenticationService/index.ts rename src/{utilityTypes.ts => utilityTypes.mts} (100%) create mode 100644 src/version2/announcementBanner.mts delete mode 100644 src/version2/announcementBanner.ts create mode 100644 src/version2/appMigration.mts delete mode 100644 src/version2/appMigration.ts create mode 100644 src/version2/appProperties.mts delete mode 100644 src/version2/appProperties.ts create mode 100644 src/version2/applicationRoles.mts delete mode 100644 src/version2/applicationRoles.ts create mode 100644 src/version2/auditRecords.mts delete mode 100644 src/version2/auditRecords.ts create mode 100644 src/version2/avatars.mts delete mode 100644 src/version2/avatars.ts delete mode 100644 src/version2/client/index.ts create mode 100644 src/version2/client/version2Client.mts delete mode 100644 src/version2/client/version2Client.ts create mode 100644 src/version2/dashboards.mts delete mode 100644 src/version2/dashboards.ts create mode 100644 src/version2/dynamicModules.mts delete mode 100644 src/version2/dynamicModules.ts create mode 100644 src/version2/filterSharing.mts delete mode 100644 src/version2/filterSharing.ts create mode 100644 src/version2/filters.mts delete mode 100644 src/version2/filters.ts create mode 100644 src/version2/groupAndUserPicker.mts delete mode 100644 src/version2/groupAndUserPicker.ts create mode 100644 src/version2/groups.mts delete mode 100644 src/version2/groups.ts create mode 100644 src/version2/index.mts delete mode 100644 src/version2/index.ts create mode 100644 src/version2/issueAttachments.mts delete mode 100644 src/version2/issueAttachments.ts create mode 100644 src/version2/issueCommentProperties.mts delete mode 100644 src/version2/issueCommentProperties.ts create mode 100644 src/version2/issueComments.mts delete mode 100644 src/version2/issueComments.ts create mode 100644 src/version2/issueCustomFieldConfigurationApps.mts delete mode 100644 src/version2/issueCustomFieldConfigurationApps.ts create mode 100644 src/version2/issueCustomFieldContexts.mts delete mode 100644 src/version2/issueCustomFieldContexts.ts create mode 100644 src/version2/issueCustomFieldOptions.mts delete mode 100644 src/version2/issueCustomFieldOptions.ts create mode 100644 src/version2/issueCustomFieldOptionsApps.mts delete mode 100644 src/version2/issueCustomFieldOptionsApps.ts create mode 100644 src/version2/issueCustomFieldValuesApps.mts delete mode 100644 src/version2/issueCustomFieldValuesApps.ts create mode 100644 src/version2/issueFieldConfigurations.mts delete mode 100644 src/version2/issueFieldConfigurations.ts create mode 100644 src/version2/issueFields.mts delete mode 100644 src/version2/issueFields.ts create mode 100644 src/version2/issueLinkTypes.mts delete mode 100644 src/version2/issueLinkTypes.ts create mode 100644 src/version2/issueLinks.mts delete mode 100644 src/version2/issueLinks.ts create mode 100644 src/version2/issueNavigatorSettings.mts delete mode 100644 src/version2/issueNavigatorSettings.ts create mode 100644 src/version2/issueNotificationSchemes.mts delete mode 100644 src/version2/issueNotificationSchemes.ts create mode 100644 src/version2/issuePriorities.mts delete mode 100644 src/version2/issuePriorities.ts create mode 100644 src/version2/issueProperties.mts delete mode 100644 src/version2/issueProperties.ts create mode 100644 src/version2/issueRemoteLinks.mts delete mode 100644 src/version2/issueRemoteLinks.ts create mode 100644 src/version2/issueResolutions.mts delete mode 100644 src/version2/issueResolutions.ts create mode 100644 src/version2/issueSearch.mts delete mode 100644 src/version2/issueSearch.ts create mode 100644 src/version2/issueSecurityLevel.mts delete mode 100644 src/version2/issueSecurityLevel.ts create mode 100644 src/version2/issueSecuritySchemes.mts delete mode 100644 src/version2/issueSecuritySchemes.ts create mode 100644 src/version2/issueTypeProperties.mts delete mode 100644 src/version2/issueTypeProperties.ts create mode 100644 src/version2/issueTypeSchemes.mts delete mode 100644 src/version2/issueTypeSchemes.ts create mode 100644 src/version2/issueTypeScreenSchemes.mts delete mode 100644 src/version2/issueTypeScreenSchemes.ts create mode 100644 src/version2/issueTypes.mts delete mode 100644 src/version2/issueTypes.ts create mode 100644 src/version2/issueVotes.mts delete mode 100644 src/version2/issueVotes.ts create mode 100644 src/version2/issueWatchers.mts delete mode 100644 src/version2/issueWatchers.ts create mode 100644 src/version2/issueWorklogProperties.mts delete mode 100644 src/version2/issueWorklogProperties.ts create mode 100644 src/version2/issueWorklogs.mts delete mode 100644 src/version2/issueWorklogs.ts create mode 100644 src/version2/issues.mts delete mode 100644 src/version2/issues.ts delete mode 100644 src/version2/jQL.ts create mode 100644 src/version2/jiraExpressions.mts delete mode 100644 src/version2/jiraExpressions.ts create mode 100644 src/version2/jiraSettings.mts delete mode 100644 src/version2/jiraSettings.ts create mode 100644 src/version2/jql.mts create mode 100644 src/version2/jqlFunctionsApps.mts delete mode 100644 src/version2/jqlFunctionsApps.ts create mode 100644 src/version2/labels.mts delete mode 100644 src/version2/labels.ts create mode 100644 src/version2/licenseMetrics.mts delete mode 100644 src/version2/licenseMetrics.ts rename src/version2/models/{actorInput.ts => actorInput.mts} (100%) rename src/version2/models/{actorsMap.ts => actorsMap.mts} (100%) rename src/version2/models/{addField.ts => addField.mts} (100%) rename src/version2/models/{addGroup.ts => addGroup.mts} (100%) create mode 100644 src/version2/models/addSecuritySchemeLevelsRequest.mts delete mode 100644 src/version2/models/addSecuritySchemeLevelsRequest.ts rename src/version2/models/{announcementBannerConfiguration.ts => announcementBannerConfiguration.mts} (100%) rename src/version2/models/{announcementBannerConfigurationUpdate.ts => announcementBannerConfigurationUpdate.mts} (100%) rename src/version2/models/{application.ts => application.mts} (100%) rename src/version2/models/{applicationProperty.ts => applicationProperty.mts} (100%) create mode 100644 src/version2/models/applicationRole.mts delete mode 100644 src/version2/models/applicationRole.ts create mode 100644 src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts delete mode 100644 src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts rename src/version2/models/{associatedItem.ts => associatedItem.mts} (100%) create mode 100644 src/version2/models/attachment.mts delete mode 100644 src/version2/models/attachment.ts rename src/version2/models/{attachmentArchiveEntry.ts => attachmentArchiveEntry.mts} (100%) create mode 100644 src/version2/models/attachmentArchiveImpl.mts delete mode 100644 src/version2/models/attachmentArchiveImpl.ts rename src/version2/models/{attachmentArchiveItemReadable.ts => attachmentArchiveItemReadable.mts} (100%) create mode 100644 src/version2/models/attachmentArchiveMetadataReadable.mts delete mode 100644 src/version2/models/attachmentArchiveMetadataReadable.ts create mode 100644 src/version2/models/attachmentMetadata.mts delete mode 100644 src/version2/models/attachmentMetadata.ts rename src/version2/models/{attachmentSettings.ts => attachmentSettings.mts} (100%) create mode 100644 src/version2/models/auditRecord.mts delete mode 100644 src/version2/models/auditRecord.ts create mode 100644 src/version2/models/auditRecords.mts delete mode 100644 src/version2/models/auditRecords.ts rename src/version2/models/{autoCompleteSuggestion.ts => autoCompleteSuggestion.mts} (100%) create mode 100644 src/version2/models/autoCompleteSuggestions.mts delete mode 100644 src/version2/models/autoCompleteSuggestions.ts rename src/version2/models/{availableDashboardGadget.ts => availableDashboardGadget.mts} (100%) create mode 100644 src/version2/models/availableDashboardGadgetsResponse.mts delete mode 100644 src/version2/models/availableDashboardGadgetsResponse.ts rename src/version2/models/{availableWorkflowConnectRule.ts => availableWorkflowConnectRule.mts} (100%) rename src/version2/models/{availableWorkflowForgeRule.ts => availableWorkflowForgeRule.mts} (100%) rename src/version2/models/{availableWorkflowSystemRule.ts => availableWorkflowSystemRule.mts} (100%) rename src/version2/models/{availableWorkflowTriggerTypes.ts => availableWorkflowTriggerTypes.mts} (100%) create mode 100644 src/version2/models/availableWorkflowTriggers.mts delete mode 100644 src/version2/models/availableWorkflowTriggers.ts rename src/version2/models/{avatar.ts => avatar.mts} (100%) rename src/version2/models/{avatarUrls.ts => avatarUrls.mts} (100%) rename src/version2/models/{avatarWithDetails.ts => avatarWithDetails.mts} (100%) create mode 100644 src/version2/models/avatars.mts delete mode 100644 src/version2/models/avatars.ts rename src/version2/models/{bulkChangeOwnerDetails.ts => bulkChangeOwnerDetails.mts} (100%) create mode 100644 src/version2/models/bulkCustomFieldOptionCreateRequest.mts delete mode 100644 src/version2/models/bulkCustomFieldOptionCreateRequest.ts create mode 100644 src/version2/models/bulkCustomFieldOptionUpdateRequest.mts delete mode 100644 src/version2/models/bulkCustomFieldOptionUpdateRequest.ts rename src/version2/models/{bulkEditShareableEntity.ts => bulkEditShareableEntity.mts} (100%) rename src/version2/models/{bulkIssueIsWatching.ts => bulkIssueIsWatching.mts} (100%) create mode 100644 src/version2/models/bulkIssuePropertyUpdateRequest.mts delete mode 100644 src/version2/models/bulkIssuePropertyUpdateRequest.ts create mode 100644 src/version2/models/bulkOperationErrorResult.mts delete mode 100644 src/version2/models/bulkOperationErrorResult.ts create mode 100644 src/version2/models/bulkPermissionGrants.mts delete mode 100644 src/version2/models/bulkPermissionGrants.ts create mode 100644 src/version2/models/bulkPermissionsRequest.mts delete mode 100644 src/version2/models/bulkPermissionsRequest.ts rename src/version2/models/{bulkProjectPermissionGrants.ts => bulkProjectPermissionGrants.mts} (100%) rename src/version2/models/{bulkProjectPermissions.ts => bulkProjectPermissions.mts} (100%) rename src/version2/models/{changeDetails.ts => changeDetails.mts} (100%) rename src/version2/models/{changedValue.ts => changedValue.mts} (100%) create mode 100644 src/version2/models/changedWorklog.mts delete mode 100644 src/version2/models/changedWorklog.ts create mode 100644 src/version2/models/changedWorklogs.mts delete mode 100644 src/version2/models/changedWorklogs.ts create mode 100644 src/version2/models/changelog.mts delete mode 100644 src/version2/models/changelog.ts rename src/version2/models/{columnItem.ts => columnItem.mts} (100%) create mode 100644 src/version2/models/comment.mts delete mode 100644 src/version2/models/comment.ts rename src/version2/models/{componentIssuesCount.ts => componentIssuesCount.mts} (100%) create mode 100644 src/version2/models/componentWithIssueCount.mts delete mode 100644 src/version2/models/componentWithIssueCount.ts create mode 100644 src/version2/models/conditionGroupConfiguration.mts delete mode 100644 src/version2/models/conditionGroupConfiguration.ts create mode 100644 src/version2/models/conditionGroupUpdate.mts delete mode 100644 src/version2/models/conditionGroupUpdate.ts create mode 100644 src/version2/models/configuration.mts delete mode 100644 src/version2/models/configuration.ts rename src/version2/models/{connectCustomFieldValue.ts => connectCustomFieldValue.mts} (100%) create mode 100644 src/version2/models/connectCustomFieldValues.mts delete mode 100644 src/version2/models/connectCustomFieldValues.ts rename src/version2/models/{connectModule.ts => connectModule.mts} (100%) create mode 100644 src/version2/models/connectModules.mts delete mode 100644 src/version2/models/connectModules.ts create mode 100644 src/version2/models/connectWorkflowTransitionRule.mts delete mode 100644 src/version2/models/connectWorkflowTransitionRule.ts create mode 100644 src/version2/models/containerForProjectFeatures.mts delete mode 100644 src/version2/models/containerForProjectFeatures.ts create mode 100644 src/version2/models/containerForRegisteredWebhooks.mts delete mode 100644 src/version2/models/containerForRegisteredWebhooks.ts rename src/version2/models/{containerForWebhookIDs.ts => containerForWebhookIDs.mts} (100%) create mode 100644 src/version2/models/containerOfWorkflowSchemeAssociations.mts delete mode 100644 src/version2/models/containerOfWorkflowSchemeAssociations.ts rename src/version2/models/{contextForProjectAndIssueType.ts => contextForProjectAndIssueType.mts} (100%) rename src/version2/models/{contextualConfiguration.ts => contextualConfiguration.mts} (100%) create mode 100644 src/version2/models/convertedJQLQueries.mts delete mode 100644 src/version2/models/convertedJQLQueries.ts rename src/version2/models/{createCustomFieldContext.ts => createCustomFieldContext.mts} (100%) create mode 100644 src/version2/models/createIssueSecuritySchemeDetails.mts delete mode 100644 src/version2/models/createIssueSecuritySchemeDetails.ts create mode 100644 src/version2/models/createNotificationSchemeDetails.mts delete mode 100644 src/version2/models/createNotificationSchemeDetails.ts rename src/version2/models/{createPriorityDetails.ts => createPriorityDetails.mts} (100%) rename src/version2/models/{createProjectDetails.ts => createProjectDetails.mts} (100%) rename src/version2/models/{createResolutionDetails.ts => createResolutionDetails.mts} (100%) create mode 100644 src/version2/models/createUiModificationDetails.mts delete mode 100644 src/version2/models/createUiModificationDetails.ts rename src/version2/models/{createUpdateRoleRequest.ts => createUpdateRoleRequest.mts} (100%) rename src/version2/models/{createWorkflowCondition.ts => createWorkflowCondition.mts} (100%) create mode 100644 src/version2/models/createWorkflowDetails.mts delete mode 100644 src/version2/models/createWorkflowDetails.ts rename src/version2/models/{createWorkflowStatusDetails.ts => createWorkflowStatusDetails.mts} (100%) create mode 100644 src/version2/models/createWorkflowTransitionDetails.mts delete mode 100644 src/version2/models/createWorkflowTransitionDetails.ts rename src/version2/models/{createWorkflowTransitionRule.ts => createWorkflowTransitionRule.mts} (100%) create mode 100644 src/version2/models/createWorkflowTransitionRulesDetails.mts delete mode 100644 src/version2/models/createWorkflowTransitionRulesDetails.ts rename src/version2/models/{createWorkflowTransitionScreenDetails.ts => createWorkflowTransitionScreenDetails.mts} (100%) create mode 100644 src/version2/models/createdIssue.mts delete mode 100644 src/version2/models/createdIssue.ts create mode 100644 src/version2/models/createdIssues.mts delete mode 100644 src/version2/models/createdIssues.ts rename src/version2/models/{customContextVariable.ts => customContextVariable.mts} (100%) create mode 100644 src/version2/models/customFieldConfigurations.mts delete mode 100644 src/version2/models/customFieldConfigurations.ts rename src/version2/models/{customFieldContext.ts => customFieldContext.mts} (100%) rename src/version2/models/{customFieldContextDefaultValue.ts => customFieldContextDefaultValue.mts} (100%) create mode 100644 src/version2/models/customFieldContextDefaultValueUpdate.mts delete mode 100644 src/version2/models/customFieldContextDefaultValueUpdate.ts rename src/version2/models/{customFieldContextOption.ts => customFieldContextOption.mts} (100%) rename src/version2/models/{customFieldContextProjectMapping.ts => customFieldContextProjectMapping.mts} (100%) rename src/version2/models/{customFieldContextUpdateDetails.ts => customFieldContextUpdateDetails.mts} (100%) create mode 100644 src/version2/models/customFieldCreatedContextOptionsList.mts delete mode 100644 src/version2/models/customFieldCreatedContextOptionsList.ts create mode 100644 src/version2/models/customFieldDefinitionJson.mts delete mode 100644 src/version2/models/customFieldDefinitionJson.ts rename src/version2/models/{customFieldOption.ts => customFieldOption.mts} (100%) rename src/version2/models/{customFieldOptionCreate.ts => customFieldOptionCreate.mts} (100%) rename src/version2/models/{customFieldOptionUpdate.ts => customFieldOptionUpdate.mts} (100%) rename src/version2/models/{customFieldReplacement.ts => customFieldReplacement.mts} (100%) create mode 100644 src/version2/models/customFieldUpdatedContextOptionsList.mts delete mode 100644 src/version2/models/customFieldUpdatedContextOptionsList.ts rename src/version2/models/{customFieldValueUpdate.ts => customFieldValueUpdate.mts} (100%) create mode 100644 src/version2/models/customFieldValueUpdateDetails.mts delete mode 100644 src/version2/models/customFieldValueUpdateDetails.ts create mode 100644 src/version2/models/dashboard.mts delete mode 100644 src/version2/models/dashboard.ts create mode 100644 src/version2/models/dashboardDetails.mts delete mode 100644 src/version2/models/dashboardDetails.ts create mode 100644 src/version2/models/dashboardGadget.mts delete mode 100644 src/version2/models/dashboardGadget.ts rename src/version2/models/{dashboardGadgetPosition.ts => dashboardGadgetPosition.mts} (100%) create mode 100644 src/version2/models/dashboardGadgetResponse.mts delete mode 100644 src/version2/models/dashboardGadgetResponse.ts create mode 100644 src/version2/models/dashboardGadgetSettings.mts delete mode 100644 src/version2/models/dashboardGadgetSettings.ts create mode 100644 src/version2/models/dashboardGadgetUpdateRequest.mts delete mode 100644 src/version2/models/dashboardGadgetUpdateRequest.ts create mode 100644 src/version2/models/dashboardUser.mts delete mode 100644 src/version2/models/dashboardUser.ts rename src/version2/models/{dateRangeFilter.ts => dateRangeFilter.mts} (100%) rename src/version2/models/{defaultLevelValue.ts => defaultLevelValue.mts} (100%) rename src/version2/models/{defaultShareScope.ts => defaultShareScope.mts} (100%) rename src/version2/models/{defaultWorkflow.ts => defaultWorkflow.mts} (100%) rename src/version2/models/{documentVersion.ts => documentVersion.mts} (100%) rename src/version2/models/{entityProperty.ts => entityProperty.mts} (100%) rename src/version2/models/{entityPropertyDetails.ts => entityPropertyDetails.mts} (100%) rename src/version2/models/{error.ts => error.mts} (100%) rename src/version2/models/{errorCollection.ts => errorCollection.mts} (100%) create mode 100644 src/version2/models/errors.mts delete mode 100644 src/version2/models/errors.ts create mode 100644 src/version2/models/eventNotification.mts delete mode 100644 src/version2/models/eventNotification.ts rename src/version2/models/{exportArchivedIssuesTaskProgress.ts => exportArchivedIssuesTaskProgress.mts} (100%) rename src/version2/models/{failedWebhook.ts => failedWebhook.mts} (100%) create mode 100644 src/version2/models/failedWebhooks.mts delete mode 100644 src/version2/models/failedWebhooks.ts create mode 100644 src/version2/models/field.mts delete mode 100644 src/version2/models/field.ts rename src/version2/models/{fieldConfiguration.ts => fieldConfiguration.mts} (100%) rename src/version2/models/{fieldConfigurationDetails.ts => fieldConfigurationDetails.mts} (100%) rename src/version2/models/{fieldConfigurationIssueTypeItem.ts => fieldConfigurationIssueTypeItem.mts} (100%) rename src/version2/models/{fieldConfigurationItem.ts => fieldConfigurationItem.mts} (100%) create mode 100644 src/version2/models/fieldConfigurationItemsDetails.mts delete mode 100644 src/version2/models/fieldConfigurationItemsDetails.ts rename src/version2/models/{fieldConfigurationScheme.ts => fieldConfigurationScheme.mts} (100%) rename src/version2/models/{fieldConfigurationSchemeProjectAssociation.ts => fieldConfigurationSchemeProjectAssociation.mts} (100%) create mode 100644 src/version2/models/fieldConfigurationSchemeProjects.mts delete mode 100644 src/version2/models/fieldConfigurationSchemeProjects.ts rename src/version2/models/{fieldConfigurationToIssueTypeMapping.ts => fieldConfigurationToIssueTypeMapping.mts} (100%) create mode 100644 src/version2/models/fieldDetails.mts delete mode 100644 src/version2/models/fieldDetails.ts rename src/version2/models/{fieldLastUsed.ts => fieldLastUsed.mts} (100%) create mode 100644 src/version2/models/fieldMetadata.mts delete mode 100644 src/version2/models/fieldMetadata.ts rename src/version2/models/{fieldReferenceData.ts => fieldReferenceData.mts} (100%) create mode 100644 src/version2/models/fields.mts delete mode 100644 src/version2/models/fields.ts create mode 100644 src/version2/models/filter.mts delete mode 100644 src/version2/models/filter.ts create mode 100644 src/version2/models/filterDetails.mts delete mode 100644 src/version2/models/filterDetails.ts create mode 100644 src/version2/models/filterSubscription.mts delete mode 100644 src/version2/models/filterSubscription.ts create mode 100644 src/version2/models/filterSubscriptionsList.mts delete mode 100644 src/version2/models/filterSubscriptionsList.ts rename src/version2/models/{fixVersion.ts => fixVersion.mts} (100%) create mode 100644 src/version2/models/foundGroup.mts delete mode 100644 src/version2/models/foundGroup.ts create mode 100644 src/version2/models/foundGroups.mts delete mode 100644 src/version2/models/foundGroups.ts create mode 100644 src/version2/models/foundUsers.mts delete mode 100644 src/version2/models/foundUsers.ts create mode 100644 src/version2/models/foundUsersAndGroups.mts delete mode 100644 src/version2/models/foundUsersAndGroups.ts rename src/version2/models/{functionReferenceData.ts => functionReferenceData.mts} (100%) rename src/version2/models/{globalScope.ts => globalScope.mts} (100%) create mode 100644 src/version2/models/group.mts delete mode 100644 src/version2/models/group.ts rename src/version2/models/{groupDetails.ts => groupDetails.mts} (100%) rename src/version2/models/{groupLabel.ts => groupLabel.mts} (100%) rename src/version2/models/{groupName.ts => groupName.mts} (100%) create mode 100644 src/version2/models/hierarchy.mts delete mode 100644 src/version2/models/hierarchy.ts rename src/version2/models/{hierarchyLevel.ts => hierarchyLevel.mts} (100%) create mode 100644 src/version2/models/historyMetadata.mts delete mode 100644 src/version2/models/historyMetadata.ts rename src/version2/models/{historyMetadataParticipant.ts => historyMetadataParticipant.mts} (100%) rename src/version2/models/{icon.ts => icon.mts} (100%) rename src/version2/models/{id.ts => id.mts} (100%) rename src/version2/models/{idOrKey.ts => idOrKey.mts} (100%) rename src/version2/models/{includedFields.ts => includedFields.mts} (100%) create mode 100644 src/version2/models/index.mts delete mode 100644 src/version2/models/index.ts create mode 100644 src/version2/models/issue.mts delete mode 100644 src/version2/models/issue.ts create mode 100644 src/version2/models/issueArchivalSync.mts delete mode 100644 src/version2/models/issueArchivalSync.ts rename src/version2/models/{issueChangelogIds.ts => issueChangelogIds.mts} (100%) rename src/version2/models/{issueCommentListRequest.ts => issueCommentListRequest.mts} (100%) create mode 100644 src/version2/models/issueCreateMetadata.mts delete mode 100644 src/version2/models/issueCreateMetadata.ts rename src/version2/models/{issueEntityProperties.ts => issueEntityProperties.mts} (100%) rename src/version2/models/{issueEntityPropertiesForMultiUpdate.ts => issueEntityPropertiesForMultiUpdate.mts} (100%) rename src/version2/models/{issueEvent.ts => issueEvent.mts} (100%) create mode 100644 src/version2/models/issueFieldOption.mts delete mode 100644 src/version2/models/issueFieldOption.ts create mode 100644 src/version2/models/issueFieldOptionConfiguration.mts delete mode 100644 src/version2/models/issueFieldOptionConfiguration.ts create mode 100644 src/version2/models/issueFieldOptionCreate.mts delete mode 100644 src/version2/models/issueFieldOptionCreate.ts create mode 100644 src/version2/models/issueFieldOptionScope.mts delete mode 100644 src/version2/models/issueFieldOptionScope.ts rename src/version2/models/{issueFilterForBulkPropertyDelete.ts => issueFilterForBulkPropertyDelete.mts} (100%) rename src/version2/models/{issueFilterForBulkPropertySet.ts => issueFilterForBulkPropertySet.mts} (100%) create mode 100644 src/version2/models/issueLink.mts delete mode 100644 src/version2/models/issueLink.ts rename src/version2/models/{issueLinkType.ts => issueLinkType.mts} (100%) create mode 100644 src/version2/models/issueLinkTypes.mts delete mode 100644 src/version2/models/issueLinkTypes.ts rename src/version2/models/{issueList.ts => issueList.mts} (100%) create mode 100644 src/version2/models/issueMatches.mts delete mode 100644 src/version2/models/issueMatches.ts create mode 100644 src/version2/models/issueMatchesForJQL.mts delete mode 100644 src/version2/models/issueMatchesForJQL.ts create mode 100644 src/version2/models/issuePickerSuggestions.mts delete mode 100644 src/version2/models/issuePickerSuggestions.ts create mode 100644 src/version2/models/issuePickerSuggestionsIssueType.mts delete mode 100644 src/version2/models/issuePickerSuggestionsIssueType.ts create mode 100644 src/version2/models/issueSecurityLevelMember.mts delete mode 100644 src/version2/models/issueSecurityLevelMember.ts rename src/version2/models/{issueSecuritySchemeToProjectMapping.ts => issueSecuritySchemeToProjectMapping.mts} (100%) create mode 100644 src/version2/models/issueTransition.mts delete mode 100644 src/version2/models/issueTransition.ts rename src/version2/models/{issueTypeCreate.ts => issueTypeCreate.mts} (100%) create mode 100644 src/version2/models/issueTypeDetails.mts delete mode 100644 src/version2/models/issueTypeDetails.ts rename src/version2/models/{issueTypeIds.ts => issueTypeIds.mts} (100%) rename src/version2/models/{issueTypeIdsToRemove.ts => issueTypeIdsToRemove.mts} (100%) rename src/version2/models/{issueTypeInfo.ts => issueTypeInfo.mts} (100%) create mode 100644 src/version2/models/issueTypeIssueCreateMetadata.mts delete mode 100644 src/version2/models/issueTypeIssueCreateMetadata.ts rename src/version2/models/{issueTypeScheme.ts => issueTypeScheme.mts} (100%) rename src/version2/models/{issueTypeSchemeDetails.ts => issueTypeSchemeDetails.mts} (100%) rename src/version2/models/{issueTypeSchemeID.ts => issueTypeSchemeID.mts} (100%) rename src/version2/models/{issueTypeSchemeMapping.ts => issueTypeSchemeMapping.mts} (100%) rename src/version2/models/{issueTypeSchemeProjectAssociation.ts => issueTypeSchemeProjectAssociation.mts} (100%) create mode 100644 src/version2/models/issueTypeSchemeProjects.mts delete mode 100644 src/version2/models/issueTypeSchemeProjects.ts rename src/version2/models/{issueTypeSchemeUpdateDetails.ts => issueTypeSchemeUpdateDetails.mts} (100%) rename src/version2/models/{issueTypeScreenScheme.ts => issueTypeScreenScheme.mts} (100%) create mode 100644 src/version2/models/issueTypeScreenSchemeDetails.mts delete mode 100644 src/version2/models/issueTypeScreenSchemeDetails.ts rename src/version2/models/{issueTypeScreenSchemeId.ts => issueTypeScreenSchemeId.mts} (100%) rename src/version2/models/{issueTypeScreenSchemeItem.ts => issueTypeScreenSchemeItem.mts} (100%) rename src/version2/models/{issueTypeScreenSchemeMapping.ts => issueTypeScreenSchemeMapping.mts} (100%) create mode 100644 src/version2/models/issueTypeScreenSchemeMappingDetails.mts delete mode 100644 src/version2/models/issueTypeScreenSchemeMappingDetails.ts rename src/version2/models/{issueTypeScreenSchemeProjectAssociation.ts => issueTypeScreenSchemeProjectAssociation.mts} (100%) rename src/version2/models/{issueTypeScreenSchemeUpdateDetails.ts => issueTypeScreenSchemeUpdateDetails.mts} (100%) create mode 100644 src/version2/models/issueTypeScreenSchemesProjects.mts delete mode 100644 src/version2/models/issueTypeScreenSchemesProjects.ts rename src/version2/models/{issueTypeToContextMapping.ts => issueTypeToContextMapping.mts} (100%) rename src/version2/models/{issueTypeUpdate.ts => issueTypeUpdate.mts} (100%) create mode 100644 src/version2/models/issueTypeWithStatus.mts delete mode 100644 src/version2/models/issueTypeWithStatus.ts rename src/version2/models/{issueTypeWorkflowMapping.ts => issueTypeWorkflowMapping.mts} (100%) rename src/version2/models/{issueTypesWorkflowMapping.ts => issueTypesWorkflowMapping.mts} (100%) create mode 100644 src/version2/models/issueUpdateDetails.mts delete mode 100644 src/version2/models/issueUpdateDetails.ts create mode 100644 src/version2/models/issueUpdateMetadata.mts delete mode 100644 src/version2/models/issueUpdateMetadata.ts create mode 100644 src/version2/models/issuesAndJQLQueries.mts delete mode 100644 src/version2/models/issuesAndJQLQueries.ts create mode 100644 src/version2/models/issuesJqlMetaData.mts delete mode 100644 src/version2/models/issuesJqlMetaData.ts create mode 100644 src/version2/models/issuesMeta.mts delete mode 100644 src/version2/models/issuesMeta.ts create mode 100644 src/version2/models/issuesUpdate.mts delete mode 100644 src/version2/models/issuesUpdate.ts create mode 100644 src/version2/models/jQLPersonalDataMigrationRequest.mts delete mode 100644 src/version2/models/jQLPersonalDataMigrationRequest.ts create mode 100644 src/version2/models/jQLQueryWithUnknownUsers.mts delete mode 100644 src/version2/models/jQLQueryWithUnknownUsers.ts create mode 100644 src/version2/models/jQLReferenceData.mts delete mode 100644 src/version2/models/jQLReferenceData.ts create mode 100644 src/version2/models/jexpIssues.mts delete mode 100644 src/version2/models/jexpIssues.ts create mode 100644 src/version2/models/jexpJqlIssues.mts delete mode 100644 src/version2/models/jexpJqlIssues.ts create mode 100644 src/version2/models/jiraExpressionAnalysis.mts delete mode 100644 src/version2/models/jiraExpressionAnalysis.ts rename src/version2/models/{jiraExpressionComplexity.ts => jiraExpressionComplexity.mts} (100%) create mode 100644 src/version2/models/jiraExpressionEvalContext.mts delete mode 100644 src/version2/models/jiraExpressionEvalContext.ts create mode 100644 src/version2/models/jiraExpressionEvalRequest.mts delete mode 100644 src/version2/models/jiraExpressionEvalRequest.ts create mode 100644 src/version2/models/jiraExpressionEvaluationMetaData.mts delete mode 100644 src/version2/models/jiraExpressionEvaluationMetaData.ts rename src/version2/models/{jiraExpressionForAnalysis.ts => jiraExpressionForAnalysis.mts} (100%) create mode 100644 src/version2/models/jiraExpressionResult.mts delete mode 100644 src/version2/models/jiraExpressionResult.ts rename src/version2/models/{jiraExpressionValidationError.ts => jiraExpressionValidationError.mts} (100%) create mode 100644 src/version2/models/jiraExpressionsAnalysis.mts delete mode 100644 src/version2/models/jiraExpressionsAnalysis.ts create mode 100644 src/version2/models/jiraExpressionsComplexity.mts delete mode 100644 src/version2/models/jiraExpressionsComplexity.ts rename src/version2/models/{jiraExpressionsComplexityValue.ts => jiraExpressionsComplexityValue.mts} (100%) create mode 100644 src/version2/models/jiraStatus.mts delete mode 100644 src/version2/models/jiraStatus.ts create mode 100644 src/version2/models/jiraWorkflow.mts delete mode 100644 src/version2/models/jiraWorkflow.ts create mode 100644 src/version2/models/jiraWorkflowStatus.mts delete mode 100644 src/version2/models/jiraWorkflowStatus.ts rename src/version2/models/{jqlFunctionPrecomputation.ts => jqlFunctionPrecomputation.mts} (100%) rename src/version2/models/{jqlFunctionPrecomputationUpdate.ts => jqlFunctionPrecomputationUpdate.mts} (100%) create mode 100644 src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts delete mode 100644 src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts create mode 100644 src/version2/models/jqlQueriesToParse.mts delete mode 100644 src/version2/models/jqlQueriesToParse.ts create mode 100644 src/version2/models/jqlQueriesToSanitize.mts delete mode 100644 src/version2/models/jqlQueriesToSanitize.ts create mode 100644 src/version2/models/jqlQuery.mts delete mode 100644 src/version2/models/jqlQuery.ts create mode 100644 src/version2/models/jqlQueryClause.mts delete mode 100644 src/version2/models/jqlQueryClause.ts create mode 100644 src/version2/models/jqlQueryField.mts delete mode 100644 src/version2/models/jqlQueryField.ts rename src/version2/models/{jqlQueryFieldEntityProperty.ts => jqlQueryFieldEntityProperty.mts} (100%) create mode 100644 src/version2/models/jqlQueryOrderByClause.mts delete mode 100644 src/version2/models/jqlQueryOrderByClause.ts create mode 100644 src/version2/models/jqlQueryOrderByClauseElement.mts delete mode 100644 src/version2/models/jqlQueryOrderByClauseElement.ts create mode 100644 src/version2/models/jqlQueryToSanitize.mts delete mode 100644 src/version2/models/jqlQueryToSanitize.ts rename src/version2/models/{jsonType.ts => jsonType.mts} (100%) create mode 100644 src/version2/models/license.mts delete mode 100644 src/version2/models/license.ts rename src/version2/models/{licenseMetric.ts => licenseMetric.mts} (100%) rename src/version2/models/{licensedApplication.ts => licensedApplication.mts} (100%) create mode 100644 src/version2/models/linkGroup.mts delete mode 100644 src/version2/models/linkGroup.ts create mode 100644 src/version2/models/linkIssueRequestJson.mts delete mode 100644 src/version2/models/linkIssueRequestJson.ts create mode 100644 src/version2/models/linkedIssue.mts delete mode 100644 src/version2/models/linkedIssue.ts rename src/version2/models/{listWrapperCallbackApplicationRole.ts => listWrapperCallbackApplicationRole.mts} (100%) rename src/version2/models/{listWrapperCallbackGroupName.ts => listWrapperCallbackGroupName.mts} (100%) rename src/version2/models/{locale.ts => locale.mts} (100%) rename src/version2/models/{moveField.ts => moveField.mts} (100%) create mode 100644 src/version2/models/multiIssueEntityProperties.mts delete mode 100644 src/version2/models/multiIssueEntityProperties.ts rename src/version2/models/{multipleCustomFieldValuesUpdate.ts => multipleCustomFieldValuesUpdate.mts} (100%) create mode 100644 src/version2/models/multipleCustomFieldValuesUpdateDetails.mts delete mode 100644 src/version2/models/multipleCustomFieldValuesUpdateDetails.ts create mode 100644 src/version2/models/nestedResponse.mts delete mode 100644 src/version2/models/nestedResponse.ts rename src/version2/models/{newUserDetails.ts => newUserDetails.mts} (100%) create mode 100644 src/version2/models/notification.mts delete mode 100644 src/version2/models/notification.ts rename src/version2/models/{notificationEvent.ts => notificationEvent.mts} (100%) create mode 100644 src/version2/models/notificationRecipients.mts delete mode 100644 src/version2/models/notificationRecipients.ts create mode 100644 src/version2/models/notificationRecipientsRestrictions.mts delete mode 100644 src/version2/models/notificationRecipientsRestrictions.ts create mode 100644 src/version2/models/notificationScheme.mts delete mode 100644 src/version2/models/notificationScheme.ts rename src/version2/models/{notificationSchemeAndProjectMapping.ts => notificationSchemeAndProjectMapping.mts} (100%) create mode 100644 src/version2/models/notificationSchemeAndProjectMappingPage.mts delete mode 100644 src/version2/models/notificationSchemeAndProjectMappingPage.ts create mode 100644 src/version2/models/notificationSchemeEvent.mts delete mode 100644 src/version2/models/notificationSchemeEvent.ts create mode 100644 src/version2/models/notificationSchemeEventDetails.mts delete mode 100644 src/version2/models/notificationSchemeEventDetails.ts rename src/version2/models/{notificationSchemeEventTypeId.ts => notificationSchemeEventTypeId.mts} (100%) rename src/version2/models/{notificationSchemeId.ts => notificationSchemeId.mts} (100%) rename src/version2/models/{notificationSchemeNotificationDetails.ts => notificationSchemeNotificationDetails.mts} (100%) rename src/version2/models/{oldToNewSecurityLevelMappings.ts => oldToNewSecurityLevelMappings.mts} (100%) rename src/version2/models/{operationMessage.ts => operationMessage.mts} (100%) create mode 100644 src/version2/models/operations.mts delete mode 100644 src/version2/models/operations.ts rename src/version2/models/{orderOfCustomFieldOptions.ts => orderOfCustomFieldOptions.mts} (100%) rename src/version2/models/{orderOfIssueTypes.ts => orderOfIssueTypes.mts} (100%) create mode 100644 src/version2/models/pageChangelog.mts delete mode 100644 src/version2/models/pageChangelog.ts create mode 100644 src/version2/models/pageComment.mts delete mode 100644 src/version2/models/pageComment.ts create mode 100644 src/version2/models/pageComponentWithIssueCount.mts delete mode 100644 src/version2/models/pageComponentWithIssueCount.ts create mode 100644 src/version2/models/pageContextForProjectAndIssueType.mts delete mode 100644 src/version2/models/pageContextForProjectAndIssueType.ts create mode 100644 src/version2/models/pageContextualConfiguration.mts delete mode 100644 src/version2/models/pageContextualConfiguration.ts create mode 100644 src/version2/models/pageCustomFieldContext.mts delete mode 100644 src/version2/models/pageCustomFieldContext.ts create mode 100644 src/version2/models/pageCustomFieldContextDefaultValue.mts delete mode 100644 src/version2/models/pageCustomFieldContextDefaultValue.ts create mode 100644 src/version2/models/pageCustomFieldContextOption.mts delete mode 100644 src/version2/models/pageCustomFieldContextOption.ts create mode 100644 src/version2/models/pageCustomFieldContextProjectMapping.mts delete mode 100644 src/version2/models/pageCustomFieldContextProjectMapping.ts create mode 100644 src/version2/models/pageDashboard.mts delete mode 100644 src/version2/models/pageDashboard.ts create mode 100644 src/version2/models/pageField.mts delete mode 100644 src/version2/models/pageField.ts create mode 100644 src/version2/models/pageFieldConfiguration.mts delete mode 100644 src/version2/models/pageFieldConfiguration.ts create mode 100644 src/version2/models/pageFieldConfigurationIssueTypeItem.mts delete mode 100644 src/version2/models/pageFieldConfigurationIssueTypeItem.ts create mode 100644 src/version2/models/pageFieldConfigurationItem.mts delete mode 100644 src/version2/models/pageFieldConfigurationItem.ts create mode 100644 src/version2/models/pageFieldConfigurationScheme.mts delete mode 100644 src/version2/models/pageFieldConfigurationScheme.ts create mode 100644 src/version2/models/pageFieldConfigurationSchemeProjects.mts delete mode 100644 src/version2/models/pageFieldConfigurationSchemeProjects.ts create mode 100644 src/version2/models/pageFilterDetails.mts delete mode 100644 src/version2/models/pageFilterDetails.ts create mode 100644 src/version2/models/pageGroupDetails.mts delete mode 100644 src/version2/models/pageGroupDetails.ts create mode 100644 src/version2/models/pageIssueFieldOption.mts delete mode 100644 src/version2/models/pageIssueFieldOption.ts create mode 100644 src/version2/models/pageIssueSecurityLevelMember.mts delete mode 100644 src/version2/models/pageIssueSecurityLevelMember.ts create mode 100644 src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts delete mode 100644 src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts create mode 100644 src/version2/models/pageIssueTypeScheme.mts delete mode 100644 src/version2/models/pageIssueTypeScheme.ts create mode 100644 src/version2/models/pageIssueTypeSchemeMapping.mts delete mode 100644 src/version2/models/pageIssueTypeSchemeMapping.ts create mode 100644 src/version2/models/pageIssueTypeSchemeProjects.mts delete mode 100644 src/version2/models/pageIssueTypeSchemeProjects.ts create mode 100644 src/version2/models/pageIssueTypeScreenScheme.mts delete mode 100644 src/version2/models/pageIssueTypeScreenScheme.ts create mode 100644 src/version2/models/pageIssueTypeScreenSchemeItem.mts delete mode 100644 src/version2/models/pageIssueTypeScreenSchemeItem.ts create mode 100644 src/version2/models/pageIssueTypeScreenSchemesProjects.mts delete mode 100644 src/version2/models/pageIssueTypeScreenSchemesProjects.ts create mode 100644 src/version2/models/pageIssueTypeToContextMapping.mts delete mode 100644 src/version2/models/pageIssueTypeToContextMapping.ts create mode 100644 src/version2/models/pageJqlFunctionPrecomputation.mts delete mode 100644 src/version2/models/pageJqlFunctionPrecomputation.ts create mode 100644 src/version2/models/pageNotificationScheme.mts delete mode 100644 src/version2/models/pageNotificationScheme.ts create mode 100644 src/version2/models/pageOfChangelogs.mts delete mode 100644 src/version2/models/pageOfChangelogs.ts create mode 100644 src/version2/models/pageOfComments.mts delete mode 100644 src/version2/models/pageOfComments.ts create mode 100644 src/version2/models/pageOfDashboards.mts delete mode 100644 src/version2/models/pageOfDashboards.ts create mode 100644 src/version2/models/pageOfStatuses.mts delete mode 100644 src/version2/models/pageOfStatuses.ts create mode 100644 src/version2/models/pageOfWorklogs.mts delete mode 100644 src/version2/models/pageOfWorklogs.ts create mode 100644 src/version2/models/pagePriority.mts delete mode 100644 src/version2/models/pagePriority.ts create mode 100644 src/version2/models/pageProject.mts delete mode 100644 src/version2/models/pageProject.ts create mode 100644 src/version2/models/pageProjectDetails.mts delete mode 100644 src/version2/models/pageProjectDetails.ts create mode 100644 src/version2/models/pageResolution.mts delete mode 100644 src/version2/models/pageResolution.ts create mode 100644 src/version2/models/pageScreen.mts delete mode 100644 src/version2/models/pageScreen.ts create mode 100644 src/version2/models/pageScreenScheme.mts delete mode 100644 src/version2/models/pageScreenScheme.ts create mode 100644 src/version2/models/pageScreenWithTab.mts delete mode 100644 src/version2/models/pageScreenWithTab.ts create mode 100644 src/version2/models/pageSecurityLevel.mts delete mode 100644 src/version2/models/pageSecurityLevel.ts create mode 100644 src/version2/models/pageSecurityLevelMember.mts delete mode 100644 src/version2/models/pageSecurityLevelMember.ts create mode 100644 src/version2/models/pageSecuritySchemeWithProjects.mts delete mode 100644 src/version2/models/pageSecuritySchemeWithProjects.ts rename src/version2/models/{pageString.ts => pageString.mts} (100%) create mode 100644 src/version2/models/pageUiModificationDetails.mts delete mode 100644 src/version2/models/pageUiModificationDetails.ts create mode 100644 src/version2/models/pageUser.mts delete mode 100644 src/version2/models/pageUser.ts create mode 100644 src/version2/models/pageUserDetails.mts delete mode 100644 src/version2/models/pageUserDetails.ts create mode 100644 src/version2/models/pageUserKey.mts delete mode 100644 src/version2/models/pageUserKey.ts create mode 100644 src/version2/models/pageVersion.mts delete mode 100644 src/version2/models/pageVersion.ts create mode 100644 src/version2/models/pageWebhook.mts delete mode 100644 src/version2/models/pageWebhook.ts create mode 100644 src/version2/models/pageWorkflow.mts delete mode 100644 src/version2/models/pageWorkflow.ts create mode 100644 src/version2/models/pageWorkflowScheme.mts delete mode 100644 src/version2/models/pageWorkflowScheme.ts create mode 100644 src/version2/models/pageWorkflowTransitionRules.mts delete mode 100644 src/version2/models/pageWorkflowTransitionRules.ts create mode 100644 src/version2/models/pagedListUserDetailsApplicationUser.mts delete mode 100644 src/version2/models/pagedListUserDetailsApplicationUser.ts create mode 100644 src/version2/models/parsedJqlQueries.mts delete mode 100644 src/version2/models/parsedJqlQueries.ts create mode 100644 src/version2/models/parsedJqlQuery.mts delete mode 100644 src/version2/models/parsedJqlQuery.ts create mode 100644 src/version2/models/permissionDetails.mts delete mode 100644 src/version2/models/permissionDetails.ts create mode 100644 src/version2/models/permissionGrant.mts delete mode 100644 src/version2/models/permissionGrant.ts create mode 100644 src/version2/models/permissionGrants.mts delete mode 100644 src/version2/models/permissionGrants.ts rename src/version2/models/{permissionHolder.ts => permissionHolder.mts} (100%) create mode 100644 src/version2/models/permissionScheme.mts delete mode 100644 src/version2/models/permissionScheme.ts create mode 100644 src/version2/models/permissionSchemes.mts delete mode 100644 src/version2/models/permissionSchemes.ts rename src/version2/models/{permissions.ts => permissions.mts} (100%) rename src/version2/models/{permissionsKeys.ts => permissionsKeys.mts} (100%) create mode 100644 src/version2/models/permittedProjects.mts delete mode 100644 src/version2/models/permittedProjects.ts rename src/version2/models/{priority.ts => priority.mts} (100%) rename src/version2/models/{priorityId.ts => priorityId.mts} (100%) create mode 100644 src/version2/models/project.mts delete mode 100644 src/version2/models/project.ts rename src/version2/models/{projectAndIssueTypePair.ts => projectAndIssueTypePair.mts} (100%) create mode 100644 src/version2/models/projectAvatars.mts delete mode 100644 src/version2/models/projectAvatars.ts rename src/version2/models/{projectCategory.ts => projectCategory.mts} (100%) create mode 100644 src/version2/models/projectComponent.mts delete mode 100644 src/version2/models/projectComponent.ts create mode 100644 src/version2/models/projectDetails.mts delete mode 100644 src/version2/models/projectDetails.ts rename src/version2/models/{projectEmailAddress.ts => projectEmailAddress.mts} (100%) rename src/version2/models/{projectFeature.ts => projectFeature.mts} (100%) rename src/version2/models/{projectFeatureToggleRequest.ts => projectFeatureToggleRequest.mts} (100%) rename src/version2/models/{projectId.ts => projectId.mts} (100%) rename src/version2/models/{projectIdentifier.ts => projectIdentifier.mts} (100%) rename src/version2/models/{projectIdentifiers.ts => projectIdentifiers.mts} (100%) rename src/version2/models/{projectIds.ts => projectIds.mts} (100%) rename src/version2/models/{projectInsight.ts => projectInsight.mts} (100%) create mode 100644 src/version2/models/projectIssueCreateMetadata.mts delete mode 100644 src/version2/models/projectIssueCreateMetadata.ts create mode 100644 src/version2/models/projectIssueSecurityLevels.mts delete mode 100644 src/version2/models/projectIssueSecurityLevels.ts create mode 100644 src/version2/models/projectIssueTypeHierarchy.mts delete mode 100644 src/version2/models/projectIssueTypeHierarchy.ts rename src/version2/models/{projectIssueTypeMapping.ts => projectIssueTypeMapping.mts} (100%) create mode 100644 src/version2/models/projectIssueTypeMappings.mts delete mode 100644 src/version2/models/projectIssueTypeMappings.ts create mode 100644 src/version2/models/projectIssueTypes.mts delete mode 100644 src/version2/models/projectIssueTypes.ts create mode 100644 src/version2/models/projectIssueTypesHierarchyLevel.mts delete mode 100644 src/version2/models/projectIssueTypesHierarchyLevel.ts rename src/version2/models/{projectLandingPageInfo.ts => projectLandingPageInfo.mts} (100%) rename src/version2/models/{projectPermissions.ts => projectPermissions.mts} (100%) create mode 100644 src/version2/models/projectRole.mts delete mode 100644 src/version2/models/projectRole.ts rename src/version2/models/{projectRoleActorsUpdate.ts => projectRoleActorsUpdate.mts} (100%) create mode 100644 src/version2/models/projectRoleDetails.mts delete mode 100644 src/version2/models/projectRoleDetails.ts rename src/version2/models/{projectRoleGroup.ts => projectRoleGroup.mts} (100%) rename src/version2/models/{projectRoleUser.ts => projectRoleUser.mts} (100%) rename src/version2/models/{projectScope.ts => projectScope.mts} (100%) rename src/version2/models/{projectType.ts => projectType.mts} (100%) rename src/version2/models/{propertyKey.ts => propertyKey.mts} (100%) create mode 100644 src/version2/models/propertyKeys.mts delete mode 100644 src/version2/models/propertyKeys.ts rename src/version2/models/{publishedWorkflowId.ts => publishedWorkflowId.mts} (100%) rename src/version2/models/{registeredWebhook.ts => registeredWebhook.mts} (100%) create mode 100644 src/version2/models/remoteIssueLink.mts delete mode 100644 src/version2/models/remoteIssueLink.ts rename src/version2/models/{remoteIssueLinkIdentifies.ts => remoteIssueLinkIdentifies.mts} (100%) create mode 100644 src/version2/models/remoteIssueLinkRequest.mts delete mode 100644 src/version2/models/remoteIssueLinkRequest.ts create mode 100644 src/version2/models/remoteObject.mts delete mode 100644 src/version2/models/remoteObject.ts rename src/version2/models/{reorderIssuePriorities.ts => reorderIssuePriorities.mts} (100%) rename src/version2/models/{reorderIssueResolutionsRequest.ts => reorderIssueResolutionsRequest.mts} (100%) rename src/version2/models/{resolution.ts => resolution.mts} (100%) rename src/version2/models/{resolutionId.ts => resolutionId.mts} (100%) rename src/version2/models/{restrictedPermission.ts => restrictedPermission.mts} (100%) rename src/version2/models/{richText.ts => richText.mts} (100%) create mode 100644 src/version2/models/roleActor.mts delete mode 100644 src/version2/models/roleActor.ts rename src/version2/models/{ruleConfiguration.ts => ruleConfiguration.mts} (100%) create mode 100644 src/version2/models/sanitizedJqlQueries.mts delete mode 100644 src/version2/models/sanitizedJqlQueries.ts create mode 100644 src/version2/models/sanitizedJqlQuery.mts delete mode 100644 src/version2/models/sanitizedJqlQuery.ts create mode 100644 src/version2/models/scope.mts delete mode 100644 src/version2/models/scope.ts create mode 100644 src/version2/models/screen.mts delete mode 100644 src/version2/models/screen.ts rename src/version2/models/{screenDetails.ts => screenDetails.mts} (100%) create mode 100644 src/version2/models/screenScheme.mts delete mode 100644 src/version2/models/screenScheme.ts create mode 100644 src/version2/models/screenSchemeDetails.mts delete mode 100644 src/version2/models/screenSchemeDetails.ts rename src/version2/models/{screenSchemeId.ts => screenSchemeId.mts} (100%) rename src/version2/models/{screenTypes.ts => screenTypes.mts} (100%) create mode 100644 src/version2/models/screenWithTab.mts delete mode 100644 src/version2/models/screenWithTab.ts rename src/version2/models/{screenableField.ts => screenableField.mts} (100%) rename src/version2/models/{screenableTab.ts => screenableTab.mts} (100%) rename src/version2/models/{searchAutoComplete.ts => searchAutoComplete.mts} (100%) create mode 100644 src/version2/models/searchRequest.mts delete mode 100644 src/version2/models/searchRequest.ts create mode 100644 src/version2/models/searchResults.mts delete mode 100644 src/version2/models/searchResults.ts rename src/version2/models/{securityLevel.ts => securityLevel.mts} (100%) create mode 100644 src/version2/models/securityLevelMember.mts delete mode 100644 src/version2/models/securityLevelMember.ts create mode 100644 src/version2/models/securityScheme.mts delete mode 100644 src/version2/models/securityScheme.ts rename src/version2/models/{securitySchemeId.ts => securitySchemeId.mts} (100%) create mode 100644 src/version2/models/securitySchemeLevel.mts delete mode 100644 src/version2/models/securitySchemeLevel.ts rename src/version2/models/{securitySchemeLevelMember.ts => securitySchemeLevelMember.mts} (100%) create mode 100644 src/version2/models/securitySchemeMembersRequest.mts delete mode 100644 src/version2/models/securitySchemeMembersRequest.ts rename src/version2/models/{securitySchemeWithProjects.ts => securitySchemeWithProjects.mts} (100%) create mode 100644 src/version2/models/securitySchemes.mts delete mode 100644 src/version2/models/securitySchemes.ts rename src/version2/models/{serverInformation.ts => serverInformation.mts} (100%) create mode 100644 src/version2/models/setDefaultLevelsRequest.mts delete mode 100644 src/version2/models/setDefaultLevelsRequest.ts rename src/version2/models/{setDefaultPriorityRequest.ts => setDefaultPriorityRequest.mts} (100%) rename src/version2/models/{setDefaultResolutionRequest.ts => setDefaultResolutionRequest.mts} (100%) create mode 100644 src/version2/models/sharePermission.mts delete mode 100644 src/version2/models/sharePermission.ts rename src/version2/models/{sharePermissionInput.ts => sharePermissionInput.mts} (100%) rename src/version2/models/{simpleApplicationProperty.ts => simpleApplicationProperty.mts} (100%) rename src/version2/models/{simpleLink.ts => simpleLink.mts} (100%) create mode 100644 src/version2/models/simpleListWrapperApplicationRole.mts delete mode 100644 src/version2/models/simpleListWrapperApplicationRole.ts create mode 100644 src/version2/models/simpleListWrapperGroupName.mts delete mode 100644 src/version2/models/simpleListWrapperGroupName.ts create mode 100644 src/version2/models/status.mts delete mode 100644 src/version2/models/status.ts rename src/version2/models/{statusCategory.ts => statusCategory.mts} (100%) rename src/version2/models/{statusCreate.ts => statusCreate.mts} (100%) create mode 100644 src/version2/models/statusCreateRequest.mts delete mode 100644 src/version2/models/statusCreateRequest.ts create mode 100644 src/version2/models/statusDetails.mts delete mode 100644 src/version2/models/statusDetails.ts create mode 100644 src/version2/models/statusLayoutUpdate.mts delete mode 100644 src/version2/models/statusLayoutUpdate.ts rename src/version2/models/{statusMapping.ts => statusMapping.mts} (100%) create mode 100644 src/version2/models/statusMappingDTO.mts delete mode 100644 src/version2/models/statusMappingDTO.ts rename src/version2/models/{statusMigration.ts => statusMigration.mts} (100%) rename src/version2/models/{statusReferenceAndPort.ts => statusReferenceAndPort.mts} (100%) create mode 100644 src/version2/models/statusScope.mts delete mode 100644 src/version2/models/statusScope.ts rename src/version2/models/{statusUpdate.ts => statusUpdate.mts} (100%) create mode 100644 src/version2/models/statusUpdateRequest.mts delete mode 100644 src/version2/models/statusUpdateRequest.ts rename src/version2/models/{suggestedIssue.ts => suggestedIssue.mts} (100%) create mode 100644 src/version2/models/systemAvatars.mts delete mode 100644 src/version2/models/systemAvatars.ts create mode 100644 src/version2/models/tabMetadata.mts delete mode 100644 src/version2/models/tabMetadata.ts rename src/version2/models/{taskProgressObject.ts => taskProgressObject.mts} (100%) rename src/version2/models/{timeTrackingConfiguration.ts => timeTrackingConfiguration.mts} (100%) rename src/version2/models/{timeTrackingDetails.ts => timeTrackingDetails.mts} (100%) rename src/version2/models/{timeTrackingProvider.ts => timeTrackingProvider.mts} (100%) create mode 100644 src/version2/models/transition.mts delete mode 100644 src/version2/models/transition.ts rename src/version2/models/{transitionScreenDetails.ts => transitionScreenDetails.mts} (100%) create mode 100644 src/version2/models/transitionUpdateDTO.mts delete mode 100644 src/version2/models/transitionUpdateDTO.ts create mode 100644 src/version2/models/transitions.mts delete mode 100644 src/version2/models/transitions.ts rename src/version2/models/{uiModificationContextDetails.ts => uiModificationContextDetails.mts} (100%) create mode 100644 src/version2/models/uiModificationDetails.mts delete mode 100644 src/version2/models/uiModificationDetails.ts rename src/version2/models/{uiModificationIdentifiers.ts => uiModificationIdentifiers.mts} (100%) rename src/version2/models/{unrestrictedUserEmail.ts => unrestrictedUserEmail.mts} (100%) rename src/version2/models/{updateCustomFieldDetails.ts => updateCustomFieldDetails.mts} (100%) rename src/version2/models/{updateFieldConfigurationSchemeDetails.ts => updateFieldConfigurationSchemeDetails.mts} (100%) rename src/version2/models/{updateIssueSecurityLevelDetails.ts => updateIssueSecurityLevelDetails.mts} (100%) rename src/version2/models/{updateIssueSecuritySchemeRequest.ts => updateIssueSecuritySchemeRequest.mts} (100%) rename src/version2/models/{updateNotificationSchemeDetails.ts => updateNotificationSchemeDetails.mts} (100%) rename src/version2/models/{updatePriorityDetails.ts => updatePriorityDetails.mts} (100%) rename src/version2/models/{updateProjectDetails.ts => updateProjectDetails.mts} (100%) rename src/version2/models/{updateResolutionDetails.ts => updateResolutionDetails.mts} (100%) rename src/version2/models/{updateScreenDetails.ts => updateScreenDetails.mts} (100%) create mode 100644 src/version2/models/updateScreenSchemeDetails.mts delete mode 100644 src/version2/models/updateScreenSchemeDetails.ts rename src/version2/models/{updateScreenTypes.ts => updateScreenTypes.mts} (100%) create mode 100644 src/version2/models/updateUiModificationDetails.mts delete mode 100644 src/version2/models/updateUiModificationDetails.ts rename src/version2/models/{updateUserToGroup.ts => updateUserToGroup.mts} (100%) rename src/version2/models/{updatedProjectCategory.ts => updatedProjectCategory.mts} (100%) create mode 100644 src/version2/models/user.mts delete mode 100644 src/version2/models/user.ts rename src/version2/models/{userAvatarUrls.ts => userAvatarUrls.mts} (100%) create mode 100644 src/version2/models/userDetails.mts delete mode 100644 src/version2/models/userDetails.ts rename src/version2/models/{userKey.ts => userKey.mts} (100%) create mode 100644 src/version2/models/userList.mts delete mode 100644 src/version2/models/userList.ts rename src/version2/models/{userMigration.ts => userMigration.mts} (100%) rename src/version2/models/{userPickerUser.ts => userPickerUser.mts} (100%) rename src/version2/models/{validationOptionsForCreate.ts => validationOptionsForCreate.mts} (100%) rename src/version2/models/{validationOptionsForUpdate.ts => validationOptionsForUpdate.mts} (100%) create mode 100644 src/version2/models/version.mts delete mode 100644 src/version2/models/version.ts create mode 100644 src/version2/models/versionIssueCounts.mts delete mode 100644 src/version2/models/versionIssueCounts.ts rename src/version2/models/{versionIssuesStatus.ts => versionIssuesStatus.mts} (100%) rename src/version2/models/{versionMove.ts => versionMove.mts} (100%) rename src/version2/models/{versionUnresolvedIssuesCount.ts => versionUnresolvedIssuesCount.mts} (100%) rename src/version2/models/{versionUsageInCustomField.ts => versionUsageInCustomField.mts} (100%) rename src/version2/models/{visibility.ts => visibility.mts} (100%) create mode 100644 src/version2/models/votes.mts delete mode 100644 src/version2/models/votes.ts rename src/version2/models/{warningCollection.ts => warningCollection.mts} (100%) create mode 100644 src/version2/models/watchers.mts delete mode 100644 src/version2/models/watchers.ts create mode 100644 src/version2/models/webhook.mts delete mode 100644 src/version2/models/webhook.ts create mode 100644 src/version2/models/webhookDetails.mts delete mode 100644 src/version2/models/webhookDetails.ts create mode 100644 src/version2/models/webhookRegistrationDetails.mts delete mode 100644 src/version2/models/webhookRegistrationDetails.ts rename src/version2/models/{webhooksExpirationDate.ts => webhooksExpirationDate.mts} (100%) create mode 100644 src/version2/models/workflow.mts delete mode 100644 src/version2/models/workflow.ts create mode 100644 src/version2/models/workflowCapabilities.mts delete mode 100644 src/version2/models/workflowCapabilities.ts rename src/version2/models/{workflowCondition.ts => workflowCondition.mts} (100%) create mode 100644 src/version2/models/workflowCreate.mts delete mode 100644 src/version2/models/workflowCreate.ts create mode 100644 src/version2/models/workflowCreateRequest.mts delete mode 100644 src/version2/models/workflowCreateRequest.ts create mode 100644 src/version2/models/workflowCreateResponse.mts delete mode 100644 src/version2/models/workflowCreateResponse.ts create mode 100644 src/version2/models/workflowElementReference.mts delete mode 100644 src/version2/models/workflowElementReference.ts rename src/version2/models/{workflowId.ts => workflowId.mts} (100%) rename src/version2/models/{workflowLayout.ts => workflowLayout.mts} (100%) rename src/version2/models/{workflowOperations.ts => workflowOperations.mts} (100%) create mode 100644 src/version2/models/workflowRead.mts delete mode 100644 src/version2/models/workflowRead.ts create mode 100644 src/version2/models/workflowReferenceStatus.mts delete mode 100644 src/version2/models/workflowReferenceStatus.ts rename src/version2/models/{workflowRuleConfiguration.ts => workflowRuleConfiguration.mts} (100%) create mode 100644 src/version2/models/workflowRules.mts delete mode 100644 src/version2/models/workflowRules.ts rename src/version2/models/{workflowRulesSearch.ts => workflowRulesSearch.mts} (100%) create mode 100644 src/version2/models/workflowRulesSearchDetails.mts delete mode 100644 src/version2/models/workflowRulesSearchDetails.ts create mode 100644 src/version2/models/workflowScheme.mts delete mode 100644 src/version2/models/workflowScheme.ts create mode 100644 src/version2/models/workflowSchemeAssociations.mts delete mode 100644 src/version2/models/workflowSchemeAssociations.ts rename src/version2/models/{workflowSchemeIdName.ts => workflowSchemeIdName.mts} (100%) rename src/version2/models/{workflowSchemeProjectAssociation.ts => workflowSchemeProjectAssociation.mts} (100%) create mode 100644 src/version2/models/workflowScope.mts delete mode 100644 src/version2/models/workflowScope.ts create mode 100644 src/version2/models/workflowStatus.mts delete mode 100644 src/version2/models/workflowStatus.ts rename src/version2/models/{workflowStatusAndPort.ts => workflowStatusAndPort.mts} (100%) rename src/version2/models/{workflowStatusLayout.ts => workflowStatusLayout.mts} (100%) rename src/version2/models/{workflowStatusProperties.ts => workflowStatusProperties.mts} (100%) rename src/version2/models/{workflowStatusUpdate.ts => workflowStatusUpdate.mts} (100%) rename src/version2/models/{workflowTransition.ts => workflowTransition.mts} (100%) rename src/version2/models/{workflowTransitionProperty.ts => workflowTransitionProperty.mts} (100%) rename src/version2/models/{workflowTransitionRule.ts => workflowTransitionRule.mts} (100%) create mode 100644 src/version2/models/workflowTransitionRules.mts delete mode 100644 src/version2/models/workflowTransitionRules.ts create mode 100644 src/version2/models/workflowTransitionRulesDetails.mts delete mode 100644 src/version2/models/workflowTransitionRulesDetails.ts create mode 100644 src/version2/models/workflowTransitionRulesUpdate.mts delete mode 100644 src/version2/models/workflowTransitionRulesUpdate.ts create mode 100644 src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts delete mode 100644 src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts create mode 100644 src/version2/models/workflowTransitionRulesUpdateErrors.mts delete mode 100644 src/version2/models/workflowTransitionRulesUpdateErrors.ts create mode 100644 src/version2/models/workflowTransitions.mts delete mode 100644 src/version2/models/workflowTransitions.ts rename src/version2/models/{workflowTrigger.ts => workflowTrigger.mts} (100%) create mode 100644 src/version2/models/workflowUpdate.mts delete mode 100644 src/version2/models/workflowUpdate.ts create mode 100644 src/version2/models/workflowUpdateRequest.mts delete mode 100644 src/version2/models/workflowUpdateRequest.ts create mode 100644 src/version2/models/workflowUpdateResponse.mts delete mode 100644 src/version2/models/workflowUpdateResponse.ts create mode 100644 src/version2/models/workflowValidationError.mts delete mode 100644 src/version2/models/workflowValidationError.ts create mode 100644 src/version2/models/workflowValidationErrorList.mts delete mode 100644 src/version2/models/workflowValidationErrorList.ts create mode 100644 src/version2/models/workflowsWithTransitionRulesDetails.mts delete mode 100644 src/version2/models/workflowsWithTransitionRulesDetails.ts create mode 100644 src/version2/models/worklog.mts delete mode 100644 src/version2/models/worklog.ts rename src/version2/models/{worklogIdsRequest.ts => worklogIdsRequest.mts} (100%) create mode 100644 src/version2/myself.mts delete mode 100644 src/version2/myself.ts create mode 100644 src/version2/parameters/addActorUsers.mts delete mode 100644 src/version2/parameters/addActorUsers.ts rename src/version2/parameters/{addAttachment.ts => addAttachment.mts} (100%) create mode 100644 src/version2/parameters/addComment.mts delete mode 100644 src/version2/parameters/addComment.ts rename src/version2/parameters/{addFieldToDefaultScreen.ts => addFieldToDefaultScreen.mts} (100%) create mode 100644 src/version2/parameters/addGadget.mts delete mode 100644 src/version2/parameters/addGadget.ts create mode 100644 src/version2/parameters/addIssueTypesToContext.mts delete mode 100644 src/version2/parameters/addIssueTypesToContext.ts create mode 100644 src/version2/parameters/addIssueTypesToIssueTypeScheme.mts delete mode 100644 src/version2/parameters/addIssueTypesToIssueTypeScheme.ts create mode 100644 src/version2/parameters/addProjectRoleActorsToRole.mts delete mode 100644 src/version2/parameters/addProjectRoleActorsToRole.ts create mode 100644 src/version2/parameters/addScreenTab.mts delete mode 100644 src/version2/parameters/addScreenTab.ts create mode 100644 src/version2/parameters/addScreenTabField.mts delete mode 100644 src/version2/parameters/addScreenTabField.ts create mode 100644 src/version2/parameters/addSecurityLevel.mts delete mode 100644 src/version2/parameters/addSecurityLevel.ts create mode 100644 src/version2/parameters/addSecurityLevelMembers.mts delete mode 100644 src/version2/parameters/addSecurityLevelMembers.ts create mode 100644 src/version2/parameters/addSharePermission.mts delete mode 100644 src/version2/parameters/addSharePermission.ts create mode 100644 src/version2/parameters/addUserToGroup.mts delete mode 100644 src/version2/parameters/addUserToGroup.ts rename src/version2/parameters/{addVote.ts => addVote.mts} (100%) rename src/version2/parameters/{addWatcher.ts => addWatcher.mts} (100%) create mode 100644 src/version2/parameters/addWorklog.mts delete mode 100644 src/version2/parameters/addWorklog.ts create mode 100644 src/version2/parameters/analyseExpression.mts delete mode 100644 src/version2/parameters/analyseExpression.ts create mode 100644 src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts delete mode 100644 src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts rename src/version2/parameters/{archiveIssues.ts => archiveIssues.mts} (100%) rename src/version2/parameters/{archiveIssuesAsync.ts => archiveIssuesAsync.mts} (100%) rename src/version2/parameters/{archiveProject.ts => archiveProject.mts} (100%) create mode 100644 src/version2/parameters/assignFieldConfigurationSchemeToProject.mts delete mode 100644 src/version2/parameters/assignFieldConfigurationSchemeToProject.ts create mode 100644 src/version2/parameters/assignIssue.mts delete mode 100644 src/version2/parameters/assignIssue.ts create mode 100644 src/version2/parameters/assignIssueTypeSchemeToProject.mts delete mode 100644 src/version2/parameters/assignIssueTypeSchemeToProject.ts create mode 100644 src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts delete mode 100644 src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts create mode 100644 src/version2/parameters/assignPermissionScheme.mts delete mode 100644 src/version2/parameters/assignPermissionScheme.ts create mode 100644 src/version2/parameters/assignProjectsToCustomFieldContext.mts delete mode 100644 src/version2/parameters/assignProjectsToCustomFieldContext.ts create mode 100644 src/version2/parameters/assignSchemeToProject.mts delete mode 100644 src/version2/parameters/assignSchemeToProject.ts create mode 100644 src/version2/parameters/associateSchemesToProjects.mts delete mode 100644 src/version2/parameters/associateSchemesToProjects.ts create mode 100644 src/version2/parameters/bulkDeleteIssueProperty.mts delete mode 100644 src/version2/parameters/bulkDeleteIssueProperty.ts create mode 100644 src/version2/parameters/bulkEditDashboards.mts delete mode 100644 src/version2/parameters/bulkEditDashboards.ts rename src/version2/parameters/{bulkGetGroups.ts => bulkGetGroups.mts} (100%) rename src/version2/parameters/{bulkGetUsers.ts => bulkGetUsers.mts} (100%) rename src/version2/parameters/{bulkGetUsersMigration.ts => bulkGetUsersMigration.mts} (100%) create mode 100644 src/version2/parameters/bulkSetIssuePropertiesByIssue.mts delete mode 100644 src/version2/parameters/bulkSetIssuePropertiesByIssue.ts create mode 100644 src/version2/parameters/bulkSetIssueProperty.mts delete mode 100644 src/version2/parameters/bulkSetIssueProperty.ts create mode 100644 src/version2/parameters/bulkSetIssuesProperties.mts delete mode 100644 src/version2/parameters/bulkSetIssuesProperties.ts rename src/version2/parameters/{cancelTask.ts => cancelTask.mts} (100%) rename src/version2/parameters/{changeFilterOwner.ts => changeFilterOwner.mts} (100%) create mode 100644 src/version2/parameters/copyDashboard.mts delete mode 100644 src/version2/parameters/copyDashboard.ts create mode 100644 src/version2/parameters/createComponent.mts delete mode 100644 src/version2/parameters/createComponent.ts create mode 100644 src/version2/parameters/createCustomField.mts delete mode 100644 src/version2/parameters/createCustomField.ts rename src/version2/parameters/{createCustomFieldContext.ts => createCustomFieldContext.mts} (100%) create mode 100644 src/version2/parameters/createCustomFieldOption.mts delete mode 100644 src/version2/parameters/createCustomFieldOption.ts create mode 100644 src/version2/parameters/createDashboard.mts delete mode 100644 src/version2/parameters/createDashboard.ts create mode 100644 src/version2/parameters/createFieldConfiguration.mts delete mode 100644 src/version2/parameters/createFieldConfiguration.ts create mode 100644 src/version2/parameters/createFieldConfigurationScheme.mts delete mode 100644 src/version2/parameters/createFieldConfigurationScheme.ts create mode 100644 src/version2/parameters/createFilter.mts delete mode 100644 src/version2/parameters/createFilter.ts create mode 100644 src/version2/parameters/createGroup.mts delete mode 100644 src/version2/parameters/createGroup.ts create mode 100644 src/version2/parameters/createIssue.mts delete mode 100644 src/version2/parameters/createIssue.ts create mode 100644 src/version2/parameters/createIssueFieldOption.mts delete mode 100644 src/version2/parameters/createIssueFieldOption.ts create mode 100644 src/version2/parameters/createIssueLinkType.mts delete mode 100644 src/version2/parameters/createIssueLinkType.ts create mode 100644 src/version2/parameters/createIssueSecurityScheme.mts delete mode 100644 src/version2/parameters/createIssueSecurityScheme.ts create mode 100644 src/version2/parameters/createIssueType.mts delete mode 100644 src/version2/parameters/createIssueType.ts rename src/version2/parameters/{createIssueTypeAvatar.ts => createIssueTypeAvatar.mts} (100%) create mode 100644 src/version2/parameters/createIssueTypeScheme.mts delete mode 100644 src/version2/parameters/createIssueTypeScheme.ts create mode 100644 src/version2/parameters/createIssueTypeScreenScheme.mts delete mode 100644 src/version2/parameters/createIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/createIssues.mts delete mode 100644 src/version2/parameters/createIssues.ts create mode 100644 src/version2/parameters/createNotificationScheme.mts delete mode 100644 src/version2/parameters/createNotificationScheme.ts create mode 100644 src/version2/parameters/createOrUpdateRemoteIssueLink.mts delete mode 100644 src/version2/parameters/createOrUpdateRemoteIssueLink.ts create mode 100644 src/version2/parameters/createPermissionGrant.mts delete mode 100644 src/version2/parameters/createPermissionGrant.ts create mode 100644 src/version2/parameters/createPermissionScheme.mts delete mode 100644 src/version2/parameters/createPermissionScheme.ts create mode 100644 src/version2/parameters/createPriority.mts delete mode 100644 src/version2/parameters/createPriority.ts create mode 100644 src/version2/parameters/createProject.mts delete mode 100644 src/version2/parameters/createProject.ts rename src/version2/parameters/{createProjectAvatar.ts => createProjectAvatar.mts} (100%) create mode 100644 src/version2/parameters/createProjectCategory.mts delete mode 100644 src/version2/parameters/createProjectCategory.ts create mode 100644 src/version2/parameters/createProjectRole.mts delete mode 100644 src/version2/parameters/createProjectRole.ts create mode 100644 src/version2/parameters/createResolution.mts delete mode 100644 src/version2/parameters/createResolution.ts create mode 100644 src/version2/parameters/createScreen.mts delete mode 100644 src/version2/parameters/createScreen.ts create mode 100644 src/version2/parameters/createScreenScheme.mts delete mode 100644 src/version2/parameters/createScreenScheme.ts create mode 100644 src/version2/parameters/createStatuses.mts delete mode 100644 src/version2/parameters/createStatuses.ts create mode 100644 src/version2/parameters/createUiModification.mts delete mode 100644 src/version2/parameters/createUiModification.ts create mode 100644 src/version2/parameters/createUser.mts delete mode 100644 src/version2/parameters/createUser.ts create mode 100644 src/version2/parameters/createVersion.mts delete mode 100644 src/version2/parameters/createVersion.ts create mode 100644 src/version2/parameters/createWorkflow.mts delete mode 100644 src/version2/parameters/createWorkflow.ts create mode 100644 src/version2/parameters/createWorkflowScheme.mts delete mode 100644 src/version2/parameters/createWorkflowScheme.ts rename src/version2/parameters/{createWorkflowSchemeDraftFromParent.ts => createWorkflowSchemeDraftFromParent.mts} (100%) create mode 100644 src/version2/parameters/createWorkflowTransitionProperty.mts delete mode 100644 src/version2/parameters/createWorkflowTransitionProperty.ts create mode 100644 src/version2/parameters/createWorkflows.mts delete mode 100644 src/version2/parameters/createWorkflows.ts rename src/version2/parameters/{deleteActor.ts => deleteActor.mts} (100%) rename src/version2/parameters/{deleteAddonProperty.ts => deleteAddonProperty.mts} (100%) create mode 100644 src/version2/parameters/deleteAndReplaceVersion.mts delete mode 100644 src/version2/parameters/deleteAndReplaceVersion.ts rename src/version2/parameters/{deleteAppProperty.ts => deleteAppProperty.mts} (100%) rename src/version2/parameters/{deleteAvatar.ts => deleteAvatar.mts} (100%) rename src/version2/parameters/{deleteComment.ts => deleteComment.mts} (100%) rename src/version2/parameters/{deleteCommentProperty.ts => deleteCommentProperty.mts} (100%) rename src/version2/parameters/{deleteComponent.ts => deleteComponent.mts} (100%) rename src/version2/parameters/{deleteCustomField.ts => deleteCustomField.mts} (100%) rename src/version2/parameters/{deleteCustomFieldContext.ts => deleteCustomFieldContext.mts} (100%) rename src/version2/parameters/{deleteCustomFieldOption.ts => deleteCustomFieldOption.mts} (100%) rename src/version2/parameters/{deleteDashboard.ts => deleteDashboard.mts} (100%) rename src/version2/parameters/{deleteDashboardItemProperty.ts => deleteDashboardItemProperty.mts} (100%) rename src/version2/parameters/{deleteDefaultWorkflow.ts => deleteDefaultWorkflow.mts} (100%) rename src/version2/parameters/{deleteDraftDefaultWorkflow.ts => deleteDraftDefaultWorkflow.mts} (100%) rename src/version2/parameters/{deleteDraftWorkflowMapping.ts => deleteDraftWorkflowMapping.mts} (100%) rename src/version2/parameters/{deleteFavouriteForFilter.ts => deleteFavouriteForFilter.mts} (100%) rename src/version2/parameters/{deleteFieldConfiguration.ts => deleteFieldConfiguration.mts} (100%) rename src/version2/parameters/{deleteFieldConfigurationScheme.ts => deleteFieldConfigurationScheme.mts} (100%) rename src/version2/parameters/{deleteFilter.ts => deleteFilter.mts} (100%) rename src/version2/parameters/{deleteInactiveWorkflow.ts => deleteInactiveWorkflow.mts} (100%) rename src/version2/parameters/{deleteIssue.ts => deleteIssue.mts} (100%) rename src/version2/parameters/{deleteIssueFieldOption.ts => deleteIssueFieldOption.mts} (100%) rename src/version2/parameters/{deleteIssueLink.ts => deleteIssueLink.mts} (100%) rename src/version2/parameters/{deleteIssueLinkType.ts => deleteIssueLinkType.mts} (100%) rename src/version2/parameters/{deleteIssueProperty.ts => deleteIssueProperty.mts} (100%) rename src/version2/parameters/{deleteIssueType.ts => deleteIssueType.mts} (100%) rename src/version2/parameters/{deleteIssueTypeProperty.ts => deleteIssueTypeProperty.mts} (100%) rename src/version2/parameters/{deleteIssueTypeScheme.ts => deleteIssueTypeScheme.mts} (100%) rename src/version2/parameters/{deleteIssueTypeScreenScheme.ts => deleteIssueTypeScreenScheme.mts} (100%) rename src/version2/parameters/{deleteNotificationScheme.ts => deleteNotificationScheme.mts} (100%) rename src/version2/parameters/{deletePermissionScheme.ts => deletePermissionScheme.mts} (100%) rename src/version2/parameters/{deletePermissionSchemeEntity.ts => deletePermissionSchemeEntity.mts} (100%) rename src/version2/parameters/{deleteProject.ts => deleteProject.mts} (100%) rename src/version2/parameters/{deleteProjectAsynchronously.ts => deleteProjectAsynchronously.mts} (100%) rename src/version2/parameters/{deleteProjectAvatar.ts => deleteProjectAvatar.mts} (100%) rename src/version2/parameters/{deleteProjectProperty.ts => deleteProjectProperty.mts} (100%) rename src/version2/parameters/{deleteProjectRole.ts => deleteProjectRole.mts} (100%) rename src/version2/parameters/{deleteProjectRoleActorsFromRole.ts => deleteProjectRoleActorsFromRole.mts} (100%) rename src/version2/parameters/{deleteRemoteIssueLinkByGlobalId.ts => deleteRemoteIssueLinkByGlobalId.mts} (100%) rename src/version2/parameters/{deleteRemoteIssueLinkById.ts => deleteRemoteIssueLinkById.mts} (100%) rename src/version2/parameters/{deleteResolution.ts => deleteResolution.mts} (100%) rename src/version2/parameters/{deleteScreen.ts => deleteScreen.mts} (100%) rename src/version2/parameters/{deleteScreenScheme.ts => deleteScreenScheme.mts} (100%) rename src/version2/parameters/{deleteScreenTab.ts => deleteScreenTab.mts} (100%) rename src/version2/parameters/{deleteSecurityScheme.ts => deleteSecurityScheme.mts} (100%) rename src/version2/parameters/{deleteSharePermission.ts => deleteSharePermission.mts} (100%) rename src/version2/parameters/{deleteStatusesById.ts => deleteStatusesById.mts} (100%) rename src/version2/parameters/{deleteUiModification.ts => deleteUiModification.mts} (100%) rename src/version2/parameters/{deleteUserProperty.ts => deleteUserProperty.mts} (100%) create mode 100644 src/version2/parameters/deleteWebhookById.mts delete mode 100644 src/version2/parameters/deleteWebhookById.ts rename src/version2/parameters/{deleteWorkflowMapping.ts => deleteWorkflowMapping.mts} (100%) rename src/version2/parameters/{deleteWorkflowScheme.ts => deleteWorkflowScheme.mts} (100%) rename src/version2/parameters/{deleteWorkflowSchemeDraft.ts => deleteWorkflowSchemeDraft.mts} (100%) rename src/version2/parameters/{deleteWorkflowSchemeDraftIssueType.ts => deleteWorkflowSchemeDraftIssueType.mts} (100%) rename src/version2/parameters/{deleteWorkflowSchemeIssueType.ts => deleteWorkflowSchemeIssueType.mts} (100%) rename src/version2/parameters/{deleteWorkflowTransitionProperty.ts => deleteWorkflowTransitionProperty.mts} (100%) create mode 100644 src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts delete mode 100644 src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts rename src/version2/parameters/{deleteWorklog.ts => deleteWorklog.mts} (100%) rename src/version2/parameters/{deleteWorklogProperty.ts => deleteWorklogProperty.mts} (100%) create mode 100644 src/version2/parameters/doTransition.mts delete mode 100644 src/version2/parameters/doTransition.ts create mode 100644 src/version2/parameters/editIssue.mts delete mode 100644 src/version2/parameters/editIssue.ts create mode 100644 src/version2/parameters/evaluateJiraExpression.mts delete mode 100644 src/version2/parameters/evaluateJiraExpression.ts rename src/version2/parameters/{expandAttachmentForHumans.ts => expandAttachmentForHumans.mts} (100%) rename src/version2/parameters/{expandAttachmentForMachines.ts => expandAttachmentForMachines.mts} (100%) create mode 100644 src/version2/parameters/exportArchivedIssues.mts delete mode 100644 src/version2/parameters/exportArchivedIssues.ts rename src/version2/parameters/{findAssignableUsers.ts => findAssignableUsers.mts} (100%) rename src/version2/parameters/{findBulkAssignableUsers.ts => findBulkAssignableUsers.mts} (100%) rename src/version2/parameters/{findGroups.ts => findGroups.mts} (100%) rename src/version2/parameters/{findUserKeysByQuery.ts => findUserKeysByQuery.mts} (100%) rename src/version2/parameters/{findUsers.ts => findUsers.mts} (100%) rename src/version2/parameters/{findUsersAndGroups.ts => findUsersAndGroups.mts} (100%) rename src/version2/parameters/{findUsersByQuery.ts => findUsersByQuery.mts} (100%) rename src/version2/parameters/{findUsersForPicker.ts => findUsersForPicker.mts} (100%) rename src/version2/parameters/{findUsersWithAllPermissions.ts => findUsersWithAllPermissions.mts} (100%) rename src/version2/parameters/{findUsersWithBrowsePermission.ts => findUsersWithBrowsePermission.mts} (100%) create mode 100644 src/version2/parameters/fullyUpdateProjectRole.mts delete mode 100644 src/version2/parameters/fullyUpdateProjectRole.ts rename src/version2/parameters/{getAccessibleProjectTypeByKey.ts => getAccessibleProjectTypeByKey.mts} (100%) rename src/version2/parameters/{getAddonProperties.ts => getAddonProperties.mts} (100%) rename src/version2/parameters/{getAddonProperty.ts => getAddonProperty.mts} (100%) rename src/version2/parameters/{getAllDashboards.ts => getAllDashboards.mts} (100%) rename src/version2/parameters/{getAllFieldConfigurationSchemes.ts => getAllFieldConfigurationSchemes.mts} (100%) rename src/version2/parameters/{getAllFieldConfigurations.ts => getAllFieldConfigurations.mts} (100%) rename src/version2/parameters/{getAllGadgets.ts => getAllGadgets.mts} (100%) rename src/version2/parameters/{getAllIssueFieldOptions.ts => getAllIssueFieldOptions.mts} (100%) rename src/version2/parameters/{getAllIssueTypeSchemes.ts => getAllIssueTypeSchemes.mts} (100%) rename src/version2/parameters/{getAllLabels.ts => getAllLabels.mts} (100%) rename src/version2/parameters/{getAllPermissionSchemes.ts => getAllPermissionSchemes.mts} (100%) rename src/version2/parameters/{getAllProjectAvatars.ts => getAllProjectAvatars.mts} (100%) rename src/version2/parameters/{getAllScreenTabFields.ts => getAllScreenTabFields.mts} (100%) rename src/version2/parameters/{getAllScreenTabs.ts => getAllScreenTabs.mts} (100%) rename src/version2/parameters/{getAllStatuses.ts => getAllStatuses.mts} (100%) rename src/version2/parameters/{getAllSystemAvatars.ts => getAllSystemAvatars.mts} (100%) rename src/version2/parameters/{getAllUsers.ts => getAllUsers.mts} (100%) rename src/version2/parameters/{getAllUsersDefault.ts => getAllUsersDefault.mts} (100%) rename src/version2/parameters/{getAllWorkflowSchemes.ts => getAllWorkflowSchemes.mts} (100%) rename src/version2/parameters/{getAlternativeIssueTypes.ts => getAlternativeIssueTypes.mts} (100%) rename src/version2/parameters/{getApplicationProperty.ts => getApplicationProperty.mts} (100%) rename src/version2/parameters/{getApplicationRole.ts => getApplicationRole.mts} (100%) rename src/version2/parameters/{getAssignedPermissionScheme.ts => getAssignedPermissionScheme.mts} (100%) rename src/version2/parameters/{getAttachment.ts => getAttachment.mts} (100%) rename src/version2/parameters/{getAttachmentContent.ts => getAttachmentContent.mts} (100%) rename src/version2/parameters/{getAttachmentThumbnail.ts => getAttachmentThumbnail.mts} (100%) rename src/version2/parameters/{getAuditRecords.ts => getAuditRecords.mts} (100%) create mode 100644 src/version2/parameters/getAutoCompletePost.mts delete mode 100644 src/version2/parameters/getAutoCompletePost.ts rename src/version2/parameters/{getAvailableScreenFields.ts => getAvailableScreenFields.mts} (100%) rename src/version2/parameters/{getAvatarImageByID.ts => getAvatarImageByID.mts} (100%) rename src/version2/parameters/{getAvatarImageByOwner.ts => getAvatarImageByOwner.mts} (100%) rename src/version2/parameters/{getAvatarImageByType.ts => getAvatarImageByType.mts} (100%) rename src/version2/parameters/{getAvatars.ts => getAvatars.mts} (100%) create mode 100644 src/version2/parameters/getBulkPermissions.mts delete mode 100644 src/version2/parameters/getBulkPermissions.ts rename src/version2/parameters/{getChangeLogs.ts => getChangeLogs.mts} (100%) create mode 100644 src/version2/parameters/getChangeLogsByIds.mts delete mode 100644 src/version2/parameters/getChangeLogsByIds.ts rename src/version2/parameters/{getColumns.ts => getColumns.mts} (100%) rename src/version2/parameters/{getComment.ts => getComment.mts} (100%) rename src/version2/parameters/{getCommentProperty.ts => getCommentProperty.mts} (100%) rename src/version2/parameters/{getCommentPropertyKeys.ts => getCommentPropertyKeys.mts} (100%) rename src/version2/parameters/{getComments.ts => getComments.mts} (100%) create mode 100644 src/version2/parameters/getCommentsByIds.mts delete mode 100644 src/version2/parameters/getCommentsByIds.ts rename src/version2/parameters/{getComponent.ts => getComponent.mts} (100%) rename src/version2/parameters/{getComponentRelatedIssues.ts => getComponentRelatedIssues.mts} (100%) rename src/version2/parameters/{getContextsForField.ts => getContextsForField.mts} (100%) rename src/version2/parameters/{getCreateIssueMeta.ts => getCreateIssueMeta.mts} (100%) rename src/version2/parameters/{getCurrentUser.ts => getCurrentUser.mts} (100%) rename src/version2/parameters/{getCustomFieldConfiguration.ts => getCustomFieldConfiguration.mts} (100%) create mode 100644 src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts delete mode 100644 src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts rename src/version2/parameters/{getCustomFieldOption.ts => getCustomFieldOption.mts} (100%) rename src/version2/parameters/{getDashboard.ts => getDashboard.mts} (100%) rename src/version2/parameters/{getDashboardItemProperty.ts => getDashboardItemProperty.mts} (100%) rename src/version2/parameters/{getDashboardItemPropertyKeys.ts => getDashboardItemPropertyKeys.mts} (100%) rename src/version2/parameters/{getDashboardsPaginated.ts => getDashboardsPaginated.mts} (100%) rename src/version2/parameters/{getDefaultValues.ts => getDefaultValues.mts} (100%) rename src/version2/parameters/{getDefaultWorkflow.ts => getDefaultWorkflow.mts} (100%) rename src/version2/parameters/{getDraftDefaultWorkflow.ts => getDraftDefaultWorkflow.mts} (100%) rename src/version2/parameters/{getDraftWorkflow.ts => getDraftWorkflow.mts} (100%) rename src/version2/parameters/{getDynamicWebhooksForApp.ts => getDynamicWebhooksForApp.mts} (100%) rename src/version2/parameters/{getEditIssueMeta.ts => getEditIssueMeta.mts} (100%) rename src/version2/parameters/{getFailedWebhooks.ts => getFailedWebhooks.mts} (100%) rename src/version2/parameters/{getFavouriteFilters.ts => getFavouriteFilters.mts} (100%) rename src/version2/parameters/{getFeaturesForProject.ts => getFeaturesForProject.mts} (100%) rename src/version2/parameters/{getFieldAutoCompleteForQueryString.ts => getFieldAutoCompleteForQueryString.mts} (100%) rename src/version2/parameters/{getFieldConfigurationItems.ts => getFieldConfigurationItems.mts} (100%) rename src/version2/parameters/{getFieldConfigurationSchemeMappings.ts => getFieldConfigurationSchemeMappings.mts} (100%) rename src/version2/parameters/{getFieldConfigurationSchemeProjectMapping.ts => getFieldConfigurationSchemeProjectMapping.mts} (100%) rename src/version2/parameters/{getFieldsPaginated.ts => getFieldsPaginated.mts} (100%) rename src/version2/parameters/{getFilter.ts => getFilter.mts} (100%) create mode 100644 src/version2/parameters/getFiltersPaginated.mts delete mode 100644 src/version2/parameters/getFiltersPaginated.ts rename src/version2/parameters/{getHierarchy.ts => getHierarchy.mts} (100%) rename src/version2/parameters/{getIdsOfWorklogsDeletedSince.ts => getIdsOfWorklogsDeletedSince.mts} (100%) rename src/version2/parameters/{getIdsOfWorklogsModifiedSince.ts => getIdsOfWorklogsModifiedSince.mts} (100%) create mode 100644 src/version2/parameters/getIsWatchingIssueBulk.mts delete mode 100644 src/version2/parameters/getIsWatchingIssueBulk.ts create mode 100644 src/version2/parameters/getIssue.mts delete mode 100644 src/version2/parameters/getIssue.ts rename src/version2/parameters/{getIssueFieldOption.ts => getIssueFieldOption.mts} (100%) rename src/version2/parameters/{getIssueLink.ts => getIssueLink.mts} (100%) rename src/version2/parameters/{getIssueLinkType.ts => getIssueLinkType.mts} (100%) create mode 100644 src/version2/parameters/getIssuePickerResource.mts delete mode 100644 src/version2/parameters/getIssuePickerResource.ts rename src/version2/parameters/{getIssueProperty.ts => getIssueProperty.mts} (100%) rename src/version2/parameters/{getIssuePropertyKeys.ts => getIssuePropertyKeys.mts} (100%) rename src/version2/parameters/{getIssueSecurityLevel.ts => getIssueSecurityLevel.mts} (100%) rename src/version2/parameters/{getIssueSecurityLevelMembers.ts => getIssueSecurityLevelMembers.mts} (100%) rename src/version2/parameters/{getIssueSecurityScheme.ts => getIssueSecurityScheme.mts} (100%) rename src/version2/parameters/{getIssueType.ts => getIssueType.mts} (100%) rename src/version2/parameters/{getIssueTypeMappingsForContexts.ts => getIssueTypeMappingsForContexts.mts} (100%) rename src/version2/parameters/{getIssueTypeProperty.ts => getIssueTypeProperty.mts} (100%) rename src/version2/parameters/{getIssueTypePropertyKeys.ts => getIssueTypePropertyKeys.mts} (100%) rename src/version2/parameters/{getIssueTypeSchemeForProjects.ts => getIssueTypeSchemeForProjects.mts} (100%) rename src/version2/parameters/{getIssueTypeSchemesMapping.ts => getIssueTypeSchemesMapping.mts} (100%) rename src/version2/parameters/{getIssueTypeScreenSchemeMappings.ts => getIssueTypeScreenSchemeMappings.mts} (100%) rename src/version2/parameters/{getIssueTypeScreenSchemeProjectAssociations.ts => getIssueTypeScreenSchemeProjectAssociations.mts} (100%) rename src/version2/parameters/{getIssueTypeScreenSchemes.ts => getIssueTypeScreenSchemes.mts} (100%) rename src/version2/parameters/{getIssueTypesForProject.ts => getIssueTypesForProject.mts} (100%) rename src/version2/parameters/{getIssueWatchers.ts => getIssueWatchers.mts} (100%) rename src/version2/parameters/{getIssueWorklog.ts => getIssueWorklog.mts} (100%) rename src/version2/parameters/{getMyFilters.ts => getMyFilters.mts} (100%) rename src/version2/parameters/{getMyPermissions.ts => getMyPermissions.mts} (100%) rename src/version2/parameters/{getNotificationScheme.ts => getNotificationScheme.mts} (100%) rename src/version2/parameters/{getNotificationSchemeForProject.ts => getNotificationSchemeForProject.mts} (100%) rename src/version2/parameters/{getNotificationSchemeToProjectMappings.ts => getNotificationSchemeToProjectMappings.mts} (100%) rename src/version2/parameters/{getNotificationSchemes.ts => getNotificationSchemes.mts} (100%) rename src/version2/parameters/{getOptionsForContext.ts => getOptionsForContext.mts} (100%) rename src/version2/parameters/{getPermissionScheme.ts => getPermissionScheme.mts} (100%) rename src/version2/parameters/{getPermissionSchemeGrant.ts => getPermissionSchemeGrant.mts} (100%) rename src/version2/parameters/{getPermissionSchemeGrants.ts => getPermissionSchemeGrants.mts} (100%) create mode 100644 src/version2/parameters/getPermittedProjects.mts delete mode 100644 src/version2/parameters/getPermittedProjects.ts rename src/version2/parameters/{getPrecomputations.ts => getPrecomputations.mts} (100%) rename src/version2/parameters/{getPreference.ts => getPreference.mts} (100%) rename src/version2/parameters/{getPriority.ts => getPriority.mts} (100%) rename src/version2/parameters/{getProject.ts => getProject.mts} (100%) rename src/version2/parameters/{getProjectCategoryById.ts => getProjectCategoryById.mts} (100%) rename src/version2/parameters/{getProjectComponents.ts => getProjectComponents.mts} (100%) rename src/version2/parameters/{getProjectComponentsPaginated.ts => getProjectComponentsPaginated.mts} (100%) rename src/version2/parameters/{getProjectContextMapping.ts => getProjectContextMapping.mts} (100%) rename src/version2/parameters/{getProjectEmail.ts => getProjectEmail.mts} (100%) rename src/version2/parameters/{getProjectIssueSecurityScheme.ts => getProjectIssueSecurityScheme.mts} (100%) rename src/version2/parameters/{getProjectProperty.ts => getProjectProperty.mts} (100%) rename src/version2/parameters/{getProjectPropertyKeys.ts => getProjectPropertyKeys.mts} (100%) rename src/version2/parameters/{getProjectRole.ts => getProjectRole.mts} (100%) rename src/version2/parameters/{getProjectRoleActorsForRole.ts => getProjectRoleActorsForRole.mts} (100%) rename src/version2/parameters/{getProjectRoleById.ts => getProjectRoleById.mts} (100%) rename src/version2/parameters/{getProjectRoleDetails.ts => getProjectRoleDetails.mts} (100%) rename src/version2/parameters/{getProjectRoles.ts => getProjectRoles.mts} (100%) rename src/version2/parameters/{getProjectTypeByKey.ts => getProjectTypeByKey.mts} (100%) rename src/version2/parameters/{getProjectVersions.ts => getProjectVersions.mts} (100%) rename src/version2/parameters/{getProjectVersionsPaginated.ts => getProjectVersionsPaginated.mts} (100%) rename src/version2/parameters/{getProjectsForIssueTypeScreenScheme.ts => getProjectsForIssueTypeScreenScheme.mts} (100%) rename src/version2/parameters/{getRecent.ts => getRecent.mts} (100%) rename src/version2/parameters/{getRemoteIssueLinkById.ts => getRemoteIssueLinkById.mts} (100%) rename src/version2/parameters/{getRemoteIssueLinks.ts => getRemoteIssueLinks.mts} (100%) rename src/version2/parameters/{getScreenSchemes.ts => getScreenSchemes.mts} (100%) rename src/version2/parameters/{getScreens.ts => getScreens.mts} (100%) rename src/version2/parameters/{getScreensForField.ts => getScreensForField.mts} (100%) rename src/version2/parameters/{getSecurityLevelMembers.ts => getSecurityLevelMembers.mts} (100%) rename src/version2/parameters/{getSecurityLevels.ts => getSecurityLevels.mts} (100%) rename src/version2/parameters/{getSecurityLevelsForProject.ts => getSecurityLevelsForProject.mts} (100%) rename src/version2/parameters/{getSelectableIssueFieldOptions.ts => getSelectableIssueFieldOptions.mts} (100%) rename src/version2/parameters/{getSharePermission.ts => getSharePermission.mts} (100%) rename src/version2/parameters/{getSharePermissions.ts => getSharePermissions.mts} (100%) rename src/version2/parameters/{getStatus.ts => getStatus.mts} (100%) rename src/version2/parameters/{getStatusCategory.ts => getStatusCategory.mts} (100%) rename src/version2/parameters/{getStatusesById.ts => getStatusesById.mts} (100%) rename src/version2/parameters/{getTask.ts => getTask.mts} (100%) rename src/version2/parameters/{getTransitions.ts => getTransitions.mts} (100%) rename src/version2/parameters/{getTrashedFieldsPaginated.ts => getTrashedFieldsPaginated.mts} (100%) rename src/version2/parameters/{getUiModifications.ts => getUiModifications.mts} (100%) rename src/version2/parameters/{getUser.ts => getUser.mts} (100%) rename src/version2/parameters/{getUserDefaultColumns.ts => getUserDefaultColumns.mts} (100%) rename src/version2/parameters/{getUserEmail.ts => getUserEmail.mts} (100%) rename src/version2/parameters/{getUserEmailBulk.ts => getUserEmailBulk.mts} (100%) rename src/version2/parameters/{getUserGroups.ts => getUserGroups.mts} (100%) rename src/version2/parameters/{getUserProperty.ts => getUserProperty.mts} (100%) rename src/version2/parameters/{getUserPropertyKeys.ts => getUserPropertyKeys.mts} (100%) rename src/version2/parameters/{getUsersFromGroup.ts => getUsersFromGroup.mts} (100%) rename src/version2/parameters/{getValidProjectKey.ts => getValidProjectKey.mts} (100%) rename src/version2/parameters/{getValidProjectName.ts => getValidProjectName.mts} (100%) rename src/version2/parameters/{getVersion.ts => getVersion.mts} (100%) rename src/version2/parameters/{getVersionRelatedIssues.ts => getVersionRelatedIssues.mts} (100%) rename src/version2/parameters/{getVersionUnresolvedIssues.ts => getVersionUnresolvedIssues.mts} (100%) rename src/version2/parameters/{getVisibleIssueFieldOptions.ts => getVisibleIssueFieldOptions.mts} (100%) rename src/version2/parameters/{getVotes.ts => getVotes.mts} (100%) rename src/version2/parameters/{getWorkflow.ts => getWorkflow.mts} (100%) rename src/version2/parameters/{getWorkflowScheme.ts => getWorkflowScheme.mts} (100%) rename src/version2/parameters/{getWorkflowSchemeDraft.ts => getWorkflowSchemeDraft.mts} (100%) rename src/version2/parameters/{getWorkflowSchemeDraftIssueType.ts => getWorkflowSchemeDraftIssueType.mts} (100%) rename src/version2/parameters/{getWorkflowSchemeIssueType.ts => getWorkflowSchemeIssueType.mts} (100%) rename src/version2/parameters/{getWorkflowSchemeProjectAssociations.ts => getWorkflowSchemeProjectAssociations.mts} (100%) rename src/version2/parameters/{getWorkflowTransitionProperties.ts => getWorkflowTransitionProperties.mts} (100%) rename src/version2/parameters/{getWorkflowTransitionRuleConfigurations.ts => getWorkflowTransitionRuleConfigurations.mts} (100%) rename src/version2/parameters/{getWorkflowsPaginated.ts => getWorkflowsPaginated.mts} (100%) rename src/version2/parameters/{getWorklog.ts => getWorklog.mts} (100%) rename src/version2/parameters/{getWorklogProperty.ts => getWorklogProperty.mts} (100%) rename src/version2/parameters/{getWorklogPropertyKeys.ts => getWorklogPropertyKeys.mts} (100%) create mode 100644 src/version2/parameters/getWorklogsForIds.mts delete mode 100644 src/version2/parameters/getWorklogsForIds.ts create mode 100644 src/version2/parameters/index.mts delete mode 100644 src/version2/parameters/index.ts create mode 100644 src/version2/parameters/linkIssues.mts delete mode 100644 src/version2/parameters/linkIssues.ts create mode 100644 src/version2/parameters/matchIssues.mts delete mode 100644 src/version2/parameters/matchIssues.ts rename src/version2/parameters/{mergeVersions.ts => mergeVersions.mts} (100%) create mode 100644 src/version2/parameters/migrateQueries.mts delete mode 100644 src/version2/parameters/migrateQueries.ts create mode 100644 src/version2/parameters/movePriorities.mts delete mode 100644 src/version2/parameters/movePriorities.ts create mode 100644 src/version2/parameters/moveResolutions.mts delete mode 100644 src/version2/parameters/moveResolutions.ts rename src/version2/parameters/{moveScreenTab.ts => moveScreenTab.mts} (100%) create mode 100644 src/version2/parameters/moveScreenTabField.mts delete mode 100644 src/version2/parameters/moveScreenTabField.ts create mode 100644 src/version2/parameters/moveVersion.mts delete mode 100644 src/version2/parameters/moveVersion.ts create mode 100644 src/version2/parameters/notify.mts delete mode 100644 src/version2/parameters/notify.ts create mode 100644 src/version2/parameters/parseJqlQueries.mts delete mode 100644 src/version2/parameters/parseJqlQueries.ts create mode 100644 src/version2/parameters/partialUpdateProjectRole.mts delete mode 100644 src/version2/parameters/partialUpdateProjectRole.ts create mode 100644 src/version2/parameters/publishDraftWorkflowScheme.mts delete mode 100644 src/version2/parameters/publishDraftWorkflowScheme.ts rename src/version2/parameters/{putAddonProperty.ts => putAddonProperty.mts} (100%) rename src/version2/parameters/{putAppProperty.ts => putAppProperty.mts} (100%) create mode 100644 src/version2/parameters/readWorkflows.mts delete mode 100644 src/version2/parameters/readWorkflows.ts create mode 100644 src/version2/parameters/refreshWebhooks.mts delete mode 100644 src/version2/parameters/refreshWebhooks.ts create mode 100644 src/version2/parameters/registerDynamicWebhooks.mts delete mode 100644 src/version2/parameters/registerDynamicWebhooks.ts create mode 100644 src/version2/parameters/registerModules.mts delete mode 100644 src/version2/parameters/registerModules.ts rename src/version2/parameters/{removeAttachment.ts => removeAttachment.mts} (100%) create mode 100644 src/version2/parameters/removeCustomFieldContextFromProjects.mts delete mode 100644 src/version2/parameters/removeCustomFieldContextFromProjects.ts rename src/version2/parameters/{removeGadget.ts => removeGadget.mts} (100%) rename src/version2/parameters/{removeGroup.ts => removeGroup.mts} (100%) rename src/version2/parameters/{removeIssueTypeFromIssueTypeScheme.ts => removeIssueTypeFromIssueTypeScheme.mts} (100%) create mode 100644 src/version2/parameters/removeIssueTypesFromContext.mts delete mode 100644 src/version2/parameters/removeIssueTypesFromContext.ts create mode 100644 src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts delete mode 100644 src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts rename src/version2/parameters/{removeLevel.ts => removeLevel.mts} (100%) create mode 100644 src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts delete mode 100644 src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts rename src/version2/parameters/{removeMemberFromSecurityLevel.ts => removeMemberFromSecurityLevel.mts} (100%) rename src/version2/parameters/{removeModules.ts => removeModules.mts} (100%) rename src/version2/parameters/{removeNotificationFromNotificationScheme.ts => removeNotificationFromNotificationScheme.mts} (100%) rename src/version2/parameters/{removePreference.ts => removePreference.mts} (100%) rename src/version2/parameters/{removeProjectCategory.ts => removeProjectCategory.mts} (100%) rename src/version2/parameters/{removeScreenTabField.ts => removeScreenTabField.mts} (100%) rename src/version2/parameters/{removeUser.ts => removeUser.mts} (100%) rename src/version2/parameters/{removeUserFromGroup.ts => removeUserFromGroup.mts} (100%) rename src/version2/parameters/{removeVote.ts => removeVote.mts} (100%) rename src/version2/parameters/{removeWatcher.ts => removeWatcher.mts} (100%) create mode 100644 src/version2/parameters/renameScreenTab.mts delete mode 100644 src/version2/parameters/renameScreenTab.ts create mode 100644 src/version2/parameters/reorderCustomFieldOptions.mts delete mode 100644 src/version2/parameters/reorderCustomFieldOptions.ts create mode 100644 src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts delete mode 100644 src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts create mode 100644 src/version2/parameters/replaceIssueFieldOption.mts delete mode 100644 src/version2/parameters/replaceIssueFieldOption.ts rename src/version2/parameters/{resetColumns.ts => resetColumns.mts} (100%) rename src/version2/parameters/{resetUserColumns.ts => resetUserColumns.mts} (100%) rename src/version2/parameters/{restore.ts => restore.mts} (100%) rename src/version2/parameters/{restoreCustomField.ts => restoreCustomField.mts} (100%) create mode 100644 src/version2/parameters/sanitiseJqlQueries.mts delete mode 100644 src/version2/parameters/sanitiseJqlQueries.ts rename src/version2/parameters/{search.ts => search.mts} (100%) create mode 100644 src/version2/parameters/searchForIssuesUsingJql.mts delete mode 100644 src/version2/parameters/searchForIssuesUsingJql.ts create mode 100644 src/version2/parameters/searchForIssuesUsingJqlPost.mts delete mode 100644 src/version2/parameters/searchForIssuesUsingJqlPost.ts rename src/version2/parameters/{searchPriorities.ts => searchPriorities.mts} (100%) rename src/version2/parameters/{searchProjects.ts => searchProjects.mts} (100%) rename src/version2/parameters/{searchProjectsUsingSecuritySchemes.ts => searchProjectsUsingSecuritySchemes.mts} (100%) rename src/version2/parameters/{searchResolutions.ts => searchResolutions.mts} (100%) rename src/version2/parameters/{searchSecuritySchemes.ts => searchSecuritySchemes.mts} (100%) create mode 100644 src/version2/parameters/selectTimeTrackingImplementation.mts delete mode 100644 src/version2/parameters/selectTimeTrackingImplementation.ts create mode 100644 src/version2/parameters/setActors.mts delete mode 100644 src/version2/parameters/setActors.ts create mode 100644 src/version2/parameters/setApplicationProperty.mts delete mode 100644 src/version2/parameters/setApplicationProperty.ts create mode 100644 src/version2/parameters/setBanner.mts delete mode 100644 src/version2/parameters/setBanner.ts rename src/version2/parameters/{setColumns.ts => setColumns.mts} (100%) rename src/version2/parameters/{setCommentProperty.ts => setCommentProperty.mts} (100%) rename src/version2/parameters/{setDashboardItemProperty.ts => setDashboardItemProperty.mts} (100%) create mode 100644 src/version2/parameters/setDefaultLevels.mts delete mode 100644 src/version2/parameters/setDefaultLevels.ts create mode 100644 src/version2/parameters/setDefaultPriority.mts delete mode 100644 src/version2/parameters/setDefaultPriority.ts create mode 100644 src/version2/parameters/setDefaultResolution.mts delete mode 100644 src/version2/parameters/setDefaultResolution.ts create mode 100644 src/version2/parameters/setDefaultShareScope.mts delete mode 100644 src/version2/parameters/setDefaultShareScope.ts create mode 100644 src/version2/parameters/setDefaultValues.mts delete mode 100644 src/version2/parameters/setDefaultValues.ts rename src/version2/parameters/{setFavouriteForFilter.ts => setFavouriteForFilter.mts} (100%) create mode 100644 src/version2/parameters/setFieldConfigurationSchemeMapping.mts delete mode 100644 src/version2/parameters/setFieldConfigurationSchemeMapping.ts rename src/version2/parameters/{setIssueProperty.ts => setIssueProperty.mts} (100%) rename src/version2/parameters/{setIssueTypeProperty.ts => setIssueTypeProperty.mts} (100%) rename src/version2/parameters/{setPreference.ts => setPreference.mts} (100%) rename src/version2/parameters/{setProjectProperty.ts => setProjectProperty.mts} (100%) create mode 100644 src/version2/parameters/setSharedTimeTrackingConfiguration.mts delete mode 100644 src/version2/parameters/setSharedTimeTrackingConfiguration.ts rename src/version2/parameters/{setUserColumns.ts => setUserColumns.mts} (100%) rename src/version2/parameters/{setUserProperty.ts => setUserProperty.mts} (100%) create mode 100644 src/version2/parameters/setWorkflowSchemeDraftIssueType.mts delete mode 100644 src/version2/parameters/setWorkflowSchemeDraftIssueType.ts create mode 100644 src/version2/parameters/setWorkflowSchemeIssueType.mts delete mode 100644 src/version2/parameters/setWorkflowSchemeIssueType.ts rename src/version2/parameters/{setWorklogProperty.ts => setWorklogProperty.mts} (100%) rename src/version2/parameters/{storeAvatar.ts => storeAvatar.mts} (100%) create mode 100644 src/version2/parameters/toggleFeatureForProject.mts delete mode 100644 src/version2/parameters/toggleFeatureForProject.ts rename src/version2/parameters/{trashCustomField.ts => trashCustomField.mts} (100%) rename src/version2/parameters/{unarchiveIssues.ts => unarchiveIssues.mts} (100%) create mode 100644 src/version2/parameters/updateComment.mts delete mode 100644 src/version2/parameters/updateComment.ts create mode 100644 src/version2/parameters/updateComponent.mts delete mode 100644 src/version2/parameters/updateComponent.ts create mode 100644 src/version2/parameters/updateCustomField.mts delete mode 100644 src/version2/parameters/updateCustomField.ts create mode 100644 src/version2/parameters/updateCustomFieldConfiguration.mts delete mode 100644 src/version2/parameters/updateCustomFieldConfiguration.ts create mode 100644 src/version2/parameters/updateCustomFieldContext.mts delete mode 100644 src/version2/parameters/updateCustomFieldContext.ts create mode 100644 src/version2/parameters/updateCustomFieldOption.mts delete mode 100644 src/version2/parameters/updateCustomFieldOption.ts create mode 100644 src/version2/parameters/updateCustomFieldValue.mts delete mode 100644 src/version2/parameters/updateCustomFieldValue.ts create mode 100644 src/version2/parameters/updateDashboard.mts delete mode 100644 src/version2/parameters/updateDashboard.ts rename src/version2/parameters/{updateDefaultScreenScheme.ts => updateDefaultScreenScheme.mts} (100%) create mode 100644 src/version2/parameters/updateDefaultWorkflow.mts delete mode 100644 src/version2/parameters/updateDefaultWorkflow.ts create mode 100644 src/version2/parameters/updateDraftDefaultWorkflow.mts delete mode 100644 src/version2/parameters/updateDraftDefaultWorkflow.ts create mode 100644 src/version2/parameters/updateDraftWorkflowMapping.mts delete mode 100644 src/version2/parameters/updateDraftWorkflowMapping.ts create mode 100644 src/version2/parameters/updateEntityPropertiesValue.mts delete mode 100644 src/version2/parameters/updateEntityPropertiesValue.ts create mode 100644 src/version2/parameters/updateFieldConfiguration.mts delete mode 100644 src/version2/parameters/updateFieldConfiguration.ts create mode 100644 src/version2/parameters/updateFieldConfigurationItems.mts delete mode 100644 src/version2/parameters/updateFieldConfigurationItems.ts create mode 100644 src/version2/parameters/updateFieldConfigurationScheme.mts delete mode 100644 src/version2/parameters/updateFieldConfigurationScheme.ts create mode 100644 src/version2/parameters/updateFilter.mts delete mode 100644 src/version2/parameters/updateFilter.ts create mode 100644 src/version2/parameters/updateGadget.mts delete mode 100644 src/version2/parameters/updateGadget.ts create mode 100644 src/version2/parameters/updateIssueFieldOption.mts delete mode 100644 src/version2/parameters/updateIssueFieldOption.ts create mode 100644 src/version2/parameters/updateIssueFields.mts delete mode 100644 src/version2/parameters/updateIssueFields.ts create mode 100644 src/version2/parameters/updateIssueLinkType.mts delete mode 100644 src/version2/parameters/updateIssueLinkType.ts create mode 100644 src/version2/parameters/updateIssueSecurityScheme.mts delete mode 100644 src/version2/parameters/updateIssueSecurityScheme.ts create mode 100644 src/version2/parameters/updateIssueType.mts delete mode 100644 src/version2/parameters/updateIssueType.ts create mode 100644 src/version2/parameters/updateIssueTypeScheme.mts delete mode 100644 src/version2/parameters/updateIssueTypeScheme.ts create mode 100644 src/version2/parameters/updateIssueTypeScreenScheme.mts delete mode 100644 src/version2/parameters/updateIssueTypeScreenScheme.ts create mode 100644 src/version2/parameters/updateMultipleCustomFieldValues.mts delete mode 100644 src/version2/parameters/updateMultipleCustomFieldValues.ts create mode 100644 src/version2/parameters/updateNotificationScheme.mts delete mode 100644 src/version2/parameters/updateNotificationScheme.ts create mode 100644 src/version2/parameters/updatePermissionScheme.mts delete mode 100644 src/version2/parameters/updatePermissionScheme.ts create mode 100644 src/version2/parameters/updatePrecomputations.mts delete mode 100644 src/version2/parameters/updatePrecomputations.ts create mode 100644 src/version2/parameters/updatePriority.mts delete mode 100644 src/version2/parameters/updatePriority.ts create mode 100644 src/version2/parameters/updateProject.mts delete mode 100644 src/version2/parameters/updateProject.ts create mode 100644 src/version2/parameters/updateProjectAvatar.mts delete mode 100644 src/version2/parameters/updateProjectAvatar.ts create mode 100644 src/version2/parameters/updateProjectCategory.mts delete mode 100644 src/version2/parameters/updateProjectCategory.ts create mode 100644 src/version2/parameters/updateProjectEmail.mts delete mode 100644 src/version2/parameters/updateProjectEmail.ts create mode 100644 src/version2/parameters/updateRemoteIssueLink.mts delete mode 100644 src/version2/parameters/updateRemoteIssueLink.ts create mode 100644 src/version2/parameters/updateResolution.mts delete mode 100644 src/version2/parameters/updateResolution.ts create mode 100644 src/version2/parameters/updateScreen.mts delete mode 100644 src/version2/parameters/updateScreen.ts create mode 100644 src/version2/parameters/updateScreenScheme.mts delete mode 100644 src/version2/parameters/updateScreenScheme.ts create mode 100644 src/version2/parameters/updateSecurityLevel.mts delete mode 100644 src/version2/parameters/updateSecurityLevel.ts create mode 100644 src/version2/parameters/updateStatuses.mts delete mode 100644 src/version2/parameters/updateStatuses.ts create mode 100644 src/version2/parameters/updateUiModification.mts delete mode 100644 src/version2/parameters/updateUiModification.ts create mode 100644 src/version2/parameters/updateVersion.mts delete mode 100644 src/version2/parameters/updateVersion.ts create mode 100644 src/version2/parameters/updateWorkflowMapping.mts delete mode 100644 src/version2/parameters/updateWorkflowMapping.ts create mode 100644 src/version2/parameters/updateWorkflowScheme.mts delete mode 100644 src/version2/parameters/updateWorkflowScheme.ts create mode 100644 src/version2/parameters/updateWorkflowSchemeDraft.mts delete mode 100644 src/version2/parameters/updateWorkflowSchemeDraft.ts create mode 100644 src/version2/parameters/updateWorkflowTransitionProperty.mts delete mode 100644 src/version2/parameters/updateWorkflowTransitionProperty.ts create mode 100644 src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts delete mode 100644 src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts create mode 100644 src/version2/parameters/updateWorkflows.mts delete mode 100644 src/version2/parameters/updateWorkflows.ts create mode 100644 src/version2/parameters/updateWorklog.mts delete mode 100644 src/version2/parameters/updateWorklog.ts create mode 100644 src/version2/parameters/validateCreateWorkflows.mts delete mode 100644 src/version2/parameters/validateCreateWorkflows.ts rename src/version2/parameters/{validateProjectKey.ts => validateProjectKey.mts} (100%) create mode 100644 src/version2/parameters/validateUpdateWorkflows.mts delete mode 100644 src/version2/parameters/validateUpdateWorkflows.ts rename src/version2/parameters/{workflowCapabilities.ts => workflowCapabilities.mts} (100%) create mode 100644 src/version2/parameters/workflowRuleSearch.mts delete mode 100644 src/version2/parameters/workflowRuleSearch.ts create mode 100644 src/version2/permissionSchemes.mts delete mode 100644 src/version2/permissionSchemes.ts create mode 100644 src/version2/permissions.mts delete mode 100644 src/version2/permissions.ts create mode 100644 src/version2/projectAvatars.mts delete mode 100644 src/version2/projectAvatars.ts create mode 100644 src/version2/projectCategories.mts delete mode 100644 src/version2/projectCategories.ts create mode 100644 src/version2/projectComponents.mts delete mode 100644 src/version2/projectComponents.ts create mode 100644 src/version2/projectEmail.mts delete mode 100644 src/version2/projectEmail.ts create mode 100644 src/version2/projectFeatures.mts delete mode 100644 src/version2/projectFeatures.ts create mode 100644 src/version2/projectKeyAndNameValidation.mts delete mode 100644 src/version2/projectKeyAndNameValidation.ts create mode 100644 src/version2/projectPermissionSchemes.mts delete mode 100644 src/version2/projectPermissionSchemes.ts create mode 100644 src/version2/projectProperties.mts delete mode 100644 src/version2/projectProperties.ts create mode 100644 src/version2/projectRoleActors.mts delete mode 100644 src/version2/projectRoleActors.ts create mode 100644 src/version2/projectRoles.mts delete mode 100644 src/version2/projectRoles.ts create mode 100644 src/version2/projectTypes.mts delete mode 100644 src/version2/projectTypes.ts create mode 100644 src/version2/projectVersions.mts delete mode 100644 src/version2/projectVersions.ts create mode 100644 src/version2/projects.mts delete mode 100644 src/version2/projects.ts create mode 100644 src/version2/screenSchemes.mts delete mode 100644 src/version2/screenSchemes.ts create mode 100644 src/version2/screenTabFields.mts delete mode 100644 src/version2/screenTabFields.ts create mode 100644 src/version2/screenTabs.mts delete mode 100644 src/version2/screenTabs.ts create mode 100644 src/version2/screens.mts delete mode 100644 src/version2/screens.ts create mode 100644 src/version2/serverInfo.mts delete mode 100644 src/version2/serverInfo.ts create mode 100644 src/version2/status.mts delete mode 100644 src/version2/status.ts create mode 100644 src/version2/tasks.mts delete mode 100644 src/version2/tasks.ts create mode 100644 src/version2/timeTracking.mts delete mode 100644 src/version2/timeTracking.ts delete mode 100644 src/version2/uIModificationsApps.ts create mode 100644 src/version2/uiModificationsApps.mts create mode 100644 src/version2/userProperties.mts delete mode 100644 src/version2/userProperties.ts create mode 100644 src/version2/userSearch.mts delete mode 100644 src/version2/userSearch.ts create mode 100644 src/version2/users.mts delete mode 100644 src/version2/users.ts create mode 100644 src/version2/webhooks.mts delete mode 100644 src/version2/webhooks.ts create mode 100644 src/version2/workflowSchemeDrafts.mts delete mode 100644 src/version2/workflowSchemeDrafts.ts create mode 100644 src/version2/workflowSchemeProjectAssociations.mts delete mode 100644 src/version2/workflowSchemeProjectAssociations.ts create mode 100644 src/version2/workflowSchemes.mts delete mode 100644 src/version2/workflowSchemes.ts create mode 100644 src/version2/workflowStatusCategories.mts delete mode 100644 src/version2/workflowStatusCategories.ts create mode 100644 src/version2/workflowStatuses.mts delete mode 100644 src/version2/workflowStatuses.ts create mode 100644 src/version2/workflowTransitionProperties.mts delete mode 100644 src/version2/workflowTransitionProperties.ts create mode 100644 src/version2/workflowTransitionRules.mts delete mode 100644 src/version2/workflowTransitionRules.ts create mode 100644 src/version2/workflows.mts delete mode 100644 src/version2/workflows.ts create mode 100644 src/version3/announcementBanner.mts delete mode 100644 src/version3/announcementBanner.ts create mode 100644 src/version3/appMigration.mts delete mode 100644 src/version3/appMigration.ts create mode 100644 src/version3/appProperties.mts delete mode 100644 src/version3/appProperties.ts create mode 100644 src/version3/applicationRoles.mts delete mode 100644 src/version3/applicationRoles.ts create mode 100644 src/version3/auditRecords.mts delete mode 100644 src/version3/auditRecords.ts create mode 100644 src/version3/avatars.mts delete mode 100644 src/version3/avatars.ts delete mode 100644 src/version3/client/index.ts create mode 100644 src/version3/client/version3Client.mts delete mode 100644 src/version3/client/version3Client.ts create mode 100644 src/version3/dashboards.mts delete mode 100644 src/version3/dashboards.ts create mode 100644 src/version3/dynamicModules.mts delete mode 100644 src/version3/dynamicModules.ts create mode 100644 src/version3/filterSharing.mts delete mode 100644 src/version3/filterSharing.ts create mode 100644 src/version3/filters.mts delete mode 100644 src/version3/filters.ts create mode 100644 src/version3/groupAndUserPicker.mts delete mode 100644 src/version3/groupAndUserPicker.ts create mode 100644 src/version3/groups.mts delete mode 100644 src/version3/groups.ts create mode 100644 src/version3/index.mts delete mode 100644 src/version3/index.ts create mode 100644 src/version3/instanceInformation.mts delete mode 100644 src/version3/instanceInformation.ts create mode 100644 src/version3/issueAttachments.mts delete mode 100644 src/version3/issueAttachments.ts create mode 100644 src/version3/issueCommentProperties.mts delete mode 100644 src/version3/issueCommentProperties.ts create mode 100644 src/version3/issueComments.mts delete mode 100644 src/version3/issueComments.ts create mode 100644 src/version3/issueCustomFieldConfigurationApps.mts delete mode 100644 src/version3/issueCustomFieldConfigurationApps.ts create mode 100644 src/version3/issueCustomFieldContexts.mts delete mode 100644 src/version3/issueCustomFieldContexts.ts create mode 100644 src/version3/issueCustomFieldOptions.mts delete mode 100644 src/version3/issueCustomFieldOptions.ts create mode 100644 src/version3/issueCustomFieldOptionsApps.mts delete mode 100644 src/version3/issueCustomFieldOptionsApps.ts create mode 100644 src/version3/issueCustomFieldValuesApps.mts delete mode 100644 src/version3/issueCustomFieldValuesApps.ts create mode 100644 src/version3/issueFieldConfigurations.mts delete mode 100644 src/version3/issueFieldConfigurations.ts create mode 100644 src/version3/issueFields.mts delete mode 100644 src/version3/issueFields.ts create mode 100644 src/version3/issueLinkTypes.mts delete mode 100644 src/version3/issueLinkTypes.ts create mode 100644 src/version3/issueLinks.mts delete mode 100644 src/version3/issueLinks.ts create mode 100644 src/version3/issueNavigatorSettings.mts delete mode 100644 src/version3/issueNavigatorSettings.ts create mode 100644 src/version3/issueNotificationSchemes.mts delete mode 100644 src/version3/issueNotificationSchemes.ts create mode 100644 src/version3/issuePriorities.mts delete mode 100644 src/version3/issuePriorities.ts create mode 100644 src/version3/issueProperties.mts delete mode 100644 src/version3/issueProperties.ts create mode 100644 src/version3/issueRemoteLinks.mts delete mode 100644 src/version3/issueRemoteLinks.ts create mode 100644 src/version3/issueResolutions.mts delete mode 100644 src/version3/issueResolutions.ts create mode 100644 src/version3/issueSearch.mts delete mode 100644 src/version3/issueSearch.ts create mode 100644 src/version3/issueSecurityLevel.mts delete mode 100644 src/version3/issueSecurityLevel.ts create mode 100644 src/version3/issueSecuritySchemes.mts delete mode 100644 src/version3/issueSecuritySchemes.ts create mode 100644 src/version3/issueTypeProperties.mts delete mode 100644 src/version3/issueTypeProperties.ts create mode 100644 src/version3/issueTypeSchemes.mts delete mode 100644 src/version3/issueTypeSchemes.ts create mode 100644 src/version3/issueTypeScreenSchemes.mts delete mode 100644 src/version3/issueTypeScreenSchemes.ts create mode 100644 src/version3/issueTypes.mts delete mode 100644 src/version3/issueTypes.ts create mode 100644 src/version3/issueVotes.mts delete mode 100644 src/version3/issueVotes.ts create mode 100644 src/version3/issueWatchers.mts delete mode 100644 src/version3/issueWatchers.ts create mode 100644 src/version3/issueWorklogProperties.mts delete mode 100644 src/version3/issueWorklogProperties.ts create mode 100644 src/version3/issueWorklogs.mts delete mode 100644 src/version3/issueWorklogs.ts create mode 100644 src/version3/issues.mts delete mode 100644 src/version3/issues.ts delete mode 100644 src/version3/jQL.ts create mode 100644 src/version3/jiraExpressions.mts delete mode 100644 src/version3/jiraExpressions.ts create mode 100644 src/version3/jiraSettings.mts delete mode 100644 src/version3/jiraSettings.ts create mode 100644 src/version3/jql.mts create mode 100644 src/version3/jqlFunctionsApps.mts delete mode 100644 src/version3/jqlFunctionsApps.ts create mode 100644 src/version3/labels.mts delete mode 100644 src/version3/labels.ts create mode 100644 src/version3/licenseMetrics.mts delete mode 100644 src/version3/licenseMetrics.ts rename src/version3/models/{actorInput.ts => actorInput.mts} (100%) rename src/version3/models/{actorsMap.ts => actorsMap.mts} (100%) rename src/version3/models/{addField.ts => addField.mts} (100%) rename src/version3/models/{addGroup.ts => addGroup.mts} (100%) create mode 100644 src/version3/models/addSecuritySchemeLevelsRequest.mts delete mode 100644 src/version3/models/addSecuritySchemeLevelsRequest.ts rename src/version3/models/{announcementBannerConfiguration.ts => announcementBannerConfiguration.mts} (100%) rename src/version3/models/{announcementBannerConfigurationUpdate.ts => announcementBannerConfigurationUpdate.mts} (100%) rename src/version3/models/{application.ts => application.mts} (100%) rename src/version3/models/{applicationProperty.ts => applicationProperty.mts} (100%) create mode 100644 src/version3/models/applicationRole.mts delete mode 100644 src/version3/models/applicationRole.ts rename src/version3/models/{archiveIssueAsyncRequest.ts => archiveIssueAsyncRequest.mts} (100%) create mode 100644 src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts delete mode 100644 src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts rename src/version3/models/{associatedItem.ts => associatedItem.mts} (100%) create mode 100644 src/version3/models/attachment.mts delete mode 100644 src/version3/models/attachment.ts rename src/version3/models/{attachmentArchiveEntry.ts => attachmentArchiveEntry.mts} (100%) create mode 100644 src/version3/models/attachmentArchiveImpl.mts delete mode 100644 src/version3/models/attachmentArchiveImpl.ts rename src/version3/models/{attachmentArchiveItemReadable.ts => attachmentArchiveItemReadable.mts} (100%) create mode 100644 src/version3/models/attachmentArchiveMetadataReadable.mts delete mode 100644 src/version3/models/attachmentArchiveMetadataReadable.ts create mode 100644 src/version3/models/attachmentMetadata.mts delete mode 100644 src/version3/models/attachmentMetadata.ts rename src/version3/models/{attachmentSettings.ts => attachmentSettings.mts} (100%) create mode 100644 src/version3/models/auditRecord.mts delete mode 100644 src/version3/models/auditRecord.ts create mode 100644 src/version3/models/auditRecords.mts delete mode 100644 src/version3/models/auditRecords.ts rename src/version3/models/{autoCompleteSuggestion.ts => autoCompleteSuggestion.mts} (100%) create mode 100644 src/version3/models/autoCompleteSuggestions.mts delete mode 100644 src/version3/models/autoCompleteSuggestions.ts rename src/version3/models/{availableDashboardGadget.ts => availableDashboardGadget.mts} (100%) create mode 100644 src/version3/models/availableDashboardGadgetsResponse.mts delete mode 100644 src/version3/models/availableDashboardGadgetsResponse.ts rename src/version3/models/{avatar.ts => avatar.mts} (100%) rename src/version3/models/{avatarUrls.ts => avatarUrls.mts} (100%) rename src/version3/models/{avatarWithDetails.ts => avatarWithDetails.mts} (100%) create mode 100644 src/version3/models/avatars.mts delete mode 100644 src/version3/models/avatars.ts rename src/version3/models/{bulkChangeOwnerDetails.ts => bulkChangeOwnerDetails.mts} (100%) create mode 100644 src/version3/models/bulkCustomFieldOptionCreateRequest.mts delete mode 100644 src/version3/models/bulkCustomFieldOptionCreateRequest.ts create mode 100644 src/version3/models/bulkCustomFieldOptionUpdateRequest.mts delete mode 100644 src/version3/models/bulkCustomFieldOptionUpdateRequest.ts rename src/version3/models/{bulkEditShareableEntity.ts => bulkEditShareableEntity.mts} (100%) rename src/version3/models/{bulkIssueIsWatching.ts => bulkIssueIsWatching.mts} (100%) create mode 100644 src/version3/models/bulkIssuePropertyUpdateRequest.mts delete mode 100644 src/version3/models/bulkIssuePropertyUpdateRequest.ts create mode 100644 src/version3/models/bulkOperationErrorResult.mts delete mode 100644 src/version3/models/bulkOperationErrorResult.ts create mode 100644 src/version3/models/bulkPermissionGrants.mts delete mode 100644 src/version3/models/bulkPermissionGrants.ts create mode 100644 src/version3/models/bulkPermissionsRequest.mts delete mode 100644 src/version3/models/bulkPermissionsRequest.ts rename src/version3/models/{bulkProjectPermissionGrants.ts => bulkProjectPermissionGrants.mts} (100%) rename src/version3/models/{bulkProjectPermissions.ts => bulkProjectPermissions.mts} (100%) rename src/version3/models/{changeDetails.ts => changeDetails.mts} (100%) rename src/version3/models/{changedValue.ts => changedValue.mts} (100%) create mode 100644 src/version3/models/changedWorklog.mts delete mode 100644 src/version3/models/changedWorklog.ts create mode 100644 src/version3/models/changedWorklogs.mts delete mode 100644 src/version3/models/changedWorklogs.ts create mode 100644 src/version3/models/changelog.mts delete mode 100644 src/version3/models/changelog.ts rename src/version3/models/{columnItem.ts => columnItem.mts} (100%) create mode 100644 src/version3/models/comment.mts delete mode 100644 src/version3/models/comment.ts rename src/version3/models/{componentIssuesCount.ts => componentIssuesCount.mts} (100%) create mode 100644 src/version3/models/componentWithIssueCount.mts delete mode 100644 src/version3/models/componentWithIssueCount.ts create mode 100644 src/version3/models/configuration.mts delete mode 100644 src/version3/models/configuration.ts rename src/version3/models/{connectCustomFieldValue.ts => connectCustomFieldValue.mts} (100%) create mode 100644 src/version3/models/connectCustomFieldValues.mts delete mode 100644 src/version3/models/connectCustomFieldValues.ts rename src/version3/models/{connectModule.ts => connectModule.mts} (100%) create mode 100644 src/version3/models/connectModules.mts delete mode 100644 src/version3/models/connectModules.ts create mode 100644 src/version3/models/connectWorkflowTransitionRule.mts delete mode 100644 src/version3/models/connectWorkflowTransitionRule.ts create mode 100644 src/version3/models/containerForProjectFeatures.mts delete mode 100644 src/version3/models/containerForProjectFeatures.ts create mode 100644 src/version3/models/containerForRegisteredWebhooks.mts delete mode 100644 src/version3/models/containerForRegisteredWebhooks.ts rename src/version3/models/{containerForWebhookIDs.ts => containerForWebhookIDs.mts} (100%) create mode 100644 src/version3/models/containerOfWorkflowSchemeAssociations.mts delete mode 100644 src/version3/models/containerOfWorkflowSchemeAssociations.ts rename src/version3/models/{contextForProjectAndIssueType.ts => contextForProjectAndIssueType.mts} (100%) rename src/version3/models/{contextualConfiguration.ts => contextualConfiguration.mts} (100%) create mode 100644 src/version3/models/convertedJQLQueries.mts delete mode 100644 src/version3/models/convertedJQLQueries.ts rename src/version3/models/{createCustomFieldContext.ts => createCustomFieldContext.mts} (100%) create mode 100644 src/version3/models/createIssueSecuritySchemeDetails.mts delete mode 100644 src/version3/models/createIssueSecuritySchemeDetails.ts create mode 100644 src/version3/models/createNotificationSchemeDetails.mts delete mode 100644 src/version3/models/createNotificationSchemeDetails.ts rename src/version3/models/{createPriorityDetails.ts => createPriorityDetails.mts} (100%) rename src/version3/models/{createProjectDetails.ts => createProjectDetails.mts} (100%) rename src/version3/models/{createResolutionDetails.ts => createResolutionDetails.mts} (100%) create mode 100644 src/version3/models/createUiModificationDetails.mts delete mode 100644 src/version3/models/createUiModificationDetails.ts rename src/version3/models/{createUpdateRoleRequest.ts => createUpdateRoleRequest.mts} (100%) rename src/version3/models/{createWorkflowCondition.ts => createWorkflowCondition.mts} (100%) create mode 100644 src/version3/models/createWorkflowDetails.mts delete mode 100644 src/version3/models/createWorkflowDetails.ts rename src/version3/models/{createWorkflowStatusDetails.ts => createWorkflowStatusDetails.mts} (100%) create mode 100644 src/version3/models/createWorkflowTransitionDetails.mts delete mode 100644 src/version3/models/createWorkflowTransitionDetails.ts rename src/version3/models/{createWorkflowTransitionRule.ts => createWorkflowTransitionRule.mts} (100%) create mode 100644 src/version3/models/createWorkflowTransitionRulesDetails.mts delete mode 100644 src/version3/models/createWorkflowTransitionRulesDetails.ts rename src/version3/models/{createWorkflowTransitionScreenDetails.ts => createWorkflowTransitionScreenDetails.mts} (100%) create mode 100644 src/version3/models/createdIssue.mts delete mode 100644 src/version3/models/createdIssue.ts create mode 100644 src/version3/models/createdIssues.mts delete mode 100644 src/version3/models/createdIssues.ts rename src/version3/models/{customContextVariable.ts => customContextVariable.mts} (100%) create mode 100644 src/version3/models/customFieldConfigurations.mts delete mode 100644 src/version3/models/customFieldConfigurations.ts rename src/version3/models/{customFieldContext.ts => customFieldContext.mts} (100%) rename src/version3/models/{customFieldContextDefaultValue.ts => customFieldContextDefaultValue.mts} (100%) create mode 100644 src/version3/models/customFieldContextDefaultValueUpdate.mts delete mode 100644 src/version3/models/customFieldContextDefaultValueUpdate.ts rename src/version3/models/{customFieldContextOption.ts => customFieldContextOption.mts} (100%) rename src/version3/models/{customFieldContextProjectMapping.ts => customFieldContextProjectMapping.mts} (100%) rename src/version3/models/{customFieldContextUpdateDetails.ts => customFieldContextUpdateDetails.mts} (100%) create mode 100644 src/version3/models/customFieldCreatedContextOptionsList.mts delete mode 100644 src/version3/models/customFieldCreatedContextOptionsList.ts create mode 100644 src/version3/models/customFieldDefinitionJson.mts delete mode 100644 src/version3/models/customFieldDefinitionJson.ts rename src/version3/models/{customFieldOption.ts => customFieldOption.mts} (100%) rename src/version3/models/{customFieldOptionCreate.ts => customFieldOptionCreate.mts} (100%) rename src/version3/models/{customFieldOptionUpdate.ts => customFieldOptionUpdate.mts} (100%) rename src/version3/models/{customFieldReplacement.ts => customFieldReplacement.mts} (100%) create mode 100644 src/version3/models/customFieldUpdatedContextOptionsList.mts delete mode 100644 src/version3/models/customFieldUpdatedContextOptionsList.ts rename src/version3/models/{customFieldValueUpdate.ts => customFieldValueUpdate.mts} (100%) create mode 100644 src/version3/models/customFieldValueUpdateRequest.mts delete mode 100644 src/version3/models/customFieldValueUpdateRequest.ts create mode 100644 src/version3/models/dashboard.mts delete mode 100644 src/version3/models/dashboard.ts create mode 100644 src/version3/models/dashboardDetails.mts delete mode 100644 src/version3/models/dashboardDetails.ts create mode 100644 src/version3/models/dashboardGadget.mts delete mode 100644 src/version3/models/dashboardGadget.ts rename src/version3/models/{dashboardGadgetPosition.ts => dashboardGadgetPosition.mts} (100%) create mode 100644 src/version3/models/dashboardGadgetResponse.mts delete mode 100644 src/version3/models/dashboardGadgetResponse.ts create mode 100644 src/version3/models/dashboardGadgetSettings.mts delete mode 100644 src/version3/models/dashboardGadgetSettings.ts create mode 100644 src/version3/models/dashboardGadgetUpdateRequest.mts delete mode 100644 src/version3/models/dashboardGadgetUpdateRequest.ts create mode 100644 src/version3/models/dashboardUser.mts delete mode 100644 src/version3/models/dashboardUser.ts rename src/version3/models/{dateRangeFilter.ts => dateRangeFilter.mts} (100%) rename src/version3/models/{defaultLevelValue.ts => defaultLevelValue.mts} (100%) rename src/version3/models/{defaultShareScope.ts => defaultShareScope.mts} (100%) rename src/version3/models/{defaultWorkflow.ts => defaultWorkflow.mts} (100%) create mode 100644 src/version3/models/deleteAndReplaceVersion.mts delete mode 100644 src/version3/models/deleteAndReplaceVersion.ts create mode 100644 src/version3/models/document.mts delete mode 100644 src/version3/models/document.ts rename src/version3/models/{entityProperty.ts => entityProperty.mts} (100%) rename src/version3/models/{entityPropertyDetails.ts => entityPropertyDetails.mts} (100%) rename src/version3/models/{error.ts => error.mts} (100%) rename src/version3/models/{errorCollection.ts => errorCollection.mts} (100%) create mode 100644 src/version3/models/errors.mts delete mode 100644 src/version3/models/errors.ts create mode 100644 src/version3/models/eventNotification.mts delete mode 100644 src/version3/models/eventNotification.ts rename src/version3/models/{exportArchivedIssuesTaskProgress.ts => exportArchivedIssuesTaskProgress.mts} (100%) rename src/version3/models/{failedWebhook.ts => failedWebhook.mts} (100%) create mode 100644 src/version3/models/failedWebhooks.mts delete mode 100644 src/version3/models/failedWebhooks.ts create mode 100644 src/version3/models/field.mts delete mode 100644 src/version3/models/field.ts rename src/version3/models/{fieldConfiguration.ts => fieldConfiguration.mts} (100%) rename src/version3/models/{fieldConfigurationDetails.ts => fieldConfigurationDetails.mts} (100%) rename src/version3/models/{fieldConfigurationIssueTypeItem.ts => fieldConfigurationIssueTypeItem.mts} (100%) rename src/version3/models/{fieldConfigurationItem.ts => fieldConfigurationItem.mts} (100%) create mode 100644 src/version3/models/fieldConfigurationItemsDetails.mts delete mode 100644 src/version3/models/fieldConfigurationItemsDetails.ts rename src/version3/models/{fieldConfigurationScheme.ts => fieldConfigurationScheme.mts} (100%) rename src/version3/models/{fieldConfigurationSchemeProjectAssociation.ts => fieldConfigurationSchemeProjectAssociation.mts} (100%) create mode 100644 src/version3/models/fieldConfigurationSchemeProjects.mts delete mode 100644 src/version3/models/fieldConfigurationSchemeProjects.ts rename src/version3/models/{fieldConfigurationToIssueTypeMapping.ts => fieldConfigurationToIssueTypeMapping.mts} (100%) create mode 100644 src/version3/models/fieldDetails.mts delete mode 100644 src/version3/models/fieldDetails.ts rename src/version3/models/{fieldLastUsed.ts => fieldLastUsed.mts} (100%) rename src/version3/models/{fieldReferenceData.ts => fieldReferenceData.mts} (100%) create mode 100644 src/version3/models/fields.mts delete mode 100644 src/version3/models/fields.ts create mode 100644 src/version3/models/filter.mts delete mode 100644 src/version3/models/filter.ts create mode 100644 src/version3/models/filterDetails.mts delete mode 100644 src/version3/models/filterDetails.ts create mode 100644 src/version3/models/filterSubscription.mts delete mode 100644 src/version3/models/filterSubscription.ts create mode 100644 src/version3/models/filterSubscriptionsList.mts delete mode 100644 src/version3/models/filterSubscriptionsList.ts rename src/version3/models/{fixVersion.ts => fixVersion.mts} (100%) create mode 100644 src/version3/models/foundGroup.mts delete mode 100644 src/version3/models/foundGroup.ts create mode 100644 src/version3/models/foundGroups.mts delete mode 100644 src/version3/models/foundGroups.ts create mode 100644 src/version3/models/foundUsers.mts delete mode 100644 src/version3/models/foundUsers.ts create mode 100644 src/version3/models/foundUsersAndGroups.mts delete mode 100644 src/version3/models/foundUsersAndGroups.ts rename src/version3/models/{functionReferenceData.ts => functionReferenceData.mts} (100%) rename src/version3/models/{globalScope.ts => globalScope.mts} (100%) create mode 100644 src/version3/models/group.mts delete mode 100644 src/version3/models/group.ts rename src/version3/models/{groupDetails.ts => groupDetails.mts} (100%) rename src/version3/models/{groupLabel.ts => groupLabel.mts} (100%) rename src/version3/models/{groupName.ts => groupName.mts} (100%) create mode 100644 src/version3/models/hierarchy.mts delete mode 100644 src/version3/models/hierarchy.ts rename src/version3/models/{hierarchyLevel.ts => hierarchyLevel.mts} (100%) create mode 100644 src/version3/models/historyMetadata.mts delete mode 100644 src/version3/models/historyMetadata.ts rename src/version3/models/{historyMetadataParticipant.ts => historyMetadataParticipant.mts} (100%) rename src/version3/models/{icon.ts => icon.mts} (100%) rename src/version3/models/{id.ts => id.mts} (100%) rename src/version3/models/{idOrKey.ts => idOrKey.mts} (100%) rename src/version3/models/{includedFields.ts => includedFields.mts} (100%) create mode 100644 src/version3/models/index.mts delete mode 100644 src/version3/models/index.ts create mode 100644 src/version3/models/issue.mts delete mode 100644 src/version3/models/issue.ts create mode 100644 src/version3/models/issueArchivalSync.mts delete mode 100644 src/version3/models/issueArchivalSync.ts rename src/version3/models/{issueArchivalSyncRequest.ts => issueArchivalSyncRequest.mts} (100%) rename src/version3/models/{issueChangelogIds.ts => issueChangelogIds.mts} (100%) rename src/version3/models/{issueCommentListRequest.ts => issueCommentListRequest.mts} (100%) create mode 100644 src/version3/models/issueCreateMetadata.mts delete mode 100644 src/version3/models/issueCreateMetadata.ts rename src/version3/models/{issueEntityProperties.ts => issueEntityProperties.mts} (100%) rename src/version3/models/{issueEntityPropertiesForMultiUpdate.ts => issueEntityPropertiesForMultiUpdate.mts} (100%) rename src/version3/models/{issueEvent.ts => issueEvent.mts} (100%) create mode 100644 src/version3/models/issueFieldOption.mts delete mode 100644 src/version3/models/issueFieldOption.ts create mode 100644 src/version3/models/issueFieldOptionConfiguration.mts delete mode 100644 src/version3/models/issueFieldOptionConfiguration.ts create mode 100644 src/version3/models/issueFieldOptionCreate.mts delete mode 100644 src/version3/models/issueFieldOptionCreate.ts create mode 100644 src/version3/models/issueFieldOptionScope.mts delete mode 100644 src/version3/models/issueFieldOptionScope.ts rename src/version3/models/{issueFilterForBulkPropertyDelete.ts => issueFilterForBulkPropertyDelete.mts} (100%) rename src/version3/models/{issueFilterForBulkPropertySet.ts => issueFilterForBulkPropertySet.mts} (100%) create mode 100644 src/version3/models/issueLink.mts delete mode 100644 src/version3/models/issueLink.ts rename src/version3/models/{issueLinkType.ts => issueLinkType.mts} (100%) create mode 100644 src/version3/models/issueLinkTypes.mts delete mode 100644 src/version3/models/issueLinkTypes.ts rename src/version3/models/{issueList.ts => issueList.mts} (100%) create mode 100644 src/version3/models/issueMatches.mts delete mode 100644 src/version3/models/issueMatches.ts create mode 100644 src/version3/models/issueMatchesForJQL.mts delete mode 100644 src/version3/models/issueMatchesForJQL.ts create mode 100644 src/version3/models/issuePickerSuggestions.mts delete mode 100644 src/version3/models/issuePickerSuggestions.ts create mode 100644 src/version3/models/issuePickerSuggestionsIssueType.mts delete mode 100644 src/version3/models/issuePickerSuggestionsIssueType.ts create mode 100644 src/version3/models/issueSecurityLevelMember.mts delete mode 100644 src/version3/models/issueSecurityLevelMember.ts rename src/version3/models/{issueSecuritySchemeToProjectMapping.ts => issueSecuritySchemeToProjectMapping.mts} (100%) create mode 100644 src/version3/models/issueTransition.mts delete mode 100644 src/version3/models/issueTransition.ts rename src/version3/models/{issueTypeCreate.ts => issueTypeCreate.mts} (100%) create mode 100644 src/version3/models/issueTypeDetails.mts delete mode 100644 src/version3/models/issueTypeDetails.ts rename src/version3/models/{issueTypeIds.ts => issueTypeIds.mts} (100%) rename src/version3/models/{issueTypeIdsToRemove.ts => issueTypeIdsToRemove.mts} (100%) rename src/version3/models/{issueTypeInfo.ts => issueTypeInfo.mts} (100%) create mode 100644 src/version3/models/issueTypeIssueCreateMetadata.mts delete mode 100644 src/version3/models/issueTypeIssueCreateMetadata.ts rename src/version3/models/{issueTypeScheme.ts => issueTypeScheme.mts} (100%) rename src/version3/models/{issueTypeSchemeDetails.ts => issueTypeSchemeDetails.mts} (100%) rename src/version3/models/{issueTypeSchemeID.ts => issueTypeSchemeID.mts} (100%) rename src/version3/models/{issueTypeSchemeMapping.ts => issueTypeSchemeMapping.mts} (100%) rename src/version3/models/{issueTypeSchemeProjectAssociation.ts => issueTypeSchemeProjectAssociation.mts} (100%) create mode 100644 src/version3/models/issueTypeSchemeProjects.mts delete mode 100644 src/version3/models/issueTypeSchemeProjects.ts rename src/version3/models/{issueTypeSchemeUpdateDetails.ts => issueTypeSchemeUpdateDetails.mts} (100%) rename src/version3/models/{issueTypeScreenScheme.ts => issueTypeScreenScheme.mts} (100%) create mode 100644 src/version3/models/issueTypeScreenSchemeDetails.mts delete mode 100644 src/version3/models/issueTypeScreenSchemeDetails.ts rename src/version3/models/{issueTypeScreenSchemeId.ts => issueTypeScreenSchemeId.mts} (100%) rename src/version3/models/{issueTypeScreenSchemeItem.ts => issueTypeScreenSchemeItem.mts} (100%) rename src/version3/models/{issueTypeScreenSchemeMapping.ts => issueTypeScreenSchemeMapping.mts} (100%) create mode 100644 src/version3/models/issueTypeScreenSchemeMappingDetails.mts delete mode 100644 src/version3/models/issueTypeScreenSchemeMappingDetails.ts rename src/version3/models/{issueTypeScreenSchemeProjectAssociation.ts => issueTypeScreenSchemeProjectAssociation.mts} (100%) rename src/version3/models/{issueTypeScreenSchemeUpdateDetails.ts => issueTypeScreenSchemeUpdateDetails.mts} (100%) create mode 100644 src/version3/models/issueTypeScreenSchemesProjects.mts delete mode 100644 src/version3/models/issueTypeScreenSchemesProjects.ts rename src/version3/models/{issueTypeToContextMapping.ts => issueTypeToContextMapping.mts} (100%) rename src/version3/models/{issueTypeUpdate.ts => issueTypeUpdate.mts} (100%) create mode 100644 src/version3/models/issueTypeWithStatus.mts delete mode 100644 src/version3/models/issueTypeWithStatus.ts rename src/version3/models/{issueTypeWorkflowMapping.ts => issueTypeWorkflowMapping.mts} (100%) rename src/version3/models/{issueTypesWorkflowMapping.ts => issueTypesWorkflowMapping.mts} (100%) create mode 100644 src/version3/models/issueUpdateDetails.mts delete mode 100644 src/version3/models/issueUpdateDetails.ts rename src/version3/models/{issueUpdateMetadata.ts => issueUpdateMetadata.mts} (100%) create mode 100644 src/version3/models/issuesAndJQLQueries.mts delete mode 100644 src/version3/models/issuesAndJQLQueries.ts create mode 100644 src/version3/models/issuesJqlMetaData.mts delete mode 100644 src/version3/models/issuesJqlMetaData.ts create mode 100644 src/version3/models/issuesMeta.mts delete mode 100644 src/version3/models/issuesMeta.ts create mode 100644 src/version3/models/issuesUpdate.mts delete mode 100644 src/version3/models/issuesUpdate.ts create mode 100644 src/version3/models/jQLPersonalDataMigrationRequest.mts delete mode 100644 src/version3/models/jQLPersonalDataMigrationRequest.ts create mode 100644 src/version3/models/jQLQueryWithUnknownUsers.mts delete mode 100644 src/version3/models/jQLQueryWithUnknownUsers.ts create mode 100644 src/version3/models/jQLReferenceData.mts delete mode 100644 src/version3/models/jQLReferenceData.ts create mode 100644 src/version3/models/jexpIssues.mts delete mode 100644 src/version3/models/jexpIssues.ts create mode 100644 src/version3/models/jexpJqlIssues.mts delete mode 100644 src/version3/models/jexpJqlIssues.ts create mode 100644 src/version3/models/jiraExpressionAnalysis.mts delete mode 100644 src/version3/models/jiraExpressionAnalysis.ts rename src/version3/models/{jiraExpressionComplexity.ts => jiraExpressionComplexity.mts} (100%) create mode 100644 src/version3/models/jiraExpressionEvalContext.mts delete mode 100644 src/version3/models/jiraExpressionEvalContext.ts create mode 100644 src/version3/models/jiraExpressionEvalRequest.mts delete mode 100644 src/version3/models/jiraExpressionEvalRequest.ts create mode 100644 src/version3/models/jiraExpressionEvaluationMetaData.mts delete mode 100644 src/version3/models/jiraExpressionEvaluationMetaData.ts rename src/version3/models/{jiraExpressionForAnalysis.ts => jiraExpressionForAnalysis.mts} (100%) create mode 100644 src/version3/models/jiraExpressionResult.mts delete mode 100644 src/version3/models/jiraExpressionResult.ts rename src/version3/models/{jiraExpressionValidationError.ts => jiraExpressionValidationError.mts} (100%) create mode 100644 src/version3/models/jiraExpressionsAnalysis.mts delete mode 100644 src/version3/models/jiraExpressionsAnalysis.ts create mode 100644 src/version3/models/jiraExpressionsComplexity.mts delete mode 100644 src/version3/models/jiraExpressionsComplexity.ts rename src/version3/models/{jiraExpressionsComplexityValue.ts => jiraExpressionsComplexityValue.mts} (100%) create mode 100644 src/version3/models/jiraStatus.mts delete mode 100644 src/version3/models/jiraStatus.ts rename src/version3/models/{jqlFunctionPrecomputation.ts => jqlFunctionPrecomputation.mts} (100%) rename src/version3/models/{jqlFunctionPrecomputationUpdate.ts => jqlFunctionPrecomputationUpdate.mts} (100%) create mode 100644 src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts delete mode 100644 src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts create mode 100644 src/version3/models/jqlQueriesToParse.mts delete mode 100644 src/version3/models/jqlQueriesToParse.ts create mode 100644 src/version3/models/jqlQueriesToSanitize.mts delete mode 100644 src/version3/models/jqlQueriesToSanitize.ts create mode 100644 src/version3/models/jqlQuery.mts delete mode 100644 src/version3/models/jqlQuery.ts create mode 100644 src/version3/models/jqlQueryClause.mts delete mode 100644 src/version3/models/jqlQueryClause.ts create mode 100644 src/version3/models/jqlQueryField.mts delete mode 100644 src/version3/models/jqlQueryField.ts rename src/version3/models/{jqlQueryFieldEntityProperty.ts => jqlQueryFieldEntityProperty.mts} (100%) create mode 100644 src/version3/models/jqlQueryOrderByClause.mts delete mode 100644 src/version3/models/jqlQueryOrderByClause.ts create mode 100644 src/version3/models/jqlQueryOrderByClauseElement.mts delete mode 100644 src/version3/models/jqlQueryOrderByClauseElement.ts create mode 100644 src/version3/models/jqlQueryToSanitize.mts delete mode 100644 src/version3/models/jqlQueryToSanitize.ts rename src/version3/models/{jsonType.ts => jsonType.mts} (100%) create mode 100644 src/version3/models/license.mts delete mode 100644 src/version3/models/license.ts rename src/version3/models/{licenseMetric.ts => licenseMetric.mts} (100%) rename src/version3/models/{licensedApplication.ts => licensedApplication.mts} (100%) create mode 100644 src/version3/models/linkGroup.mts delete mode 100644 src/version3/models/linkGroup.ts create mode 100644 src/version3/models/linkIssueRequestJson.mts delete mode 100644 src/version3/models/linkIssueRequestJson.ts create mode 100644 src/version3/models/linkedIssue.mts delete mode 100644 src/version3/models/linkedIssue.ts rename src/version3/models/{listWrapperCallbackApplicationRole.ts => listWrapperCallbackApplicationRole.mts} (100%) rename src/version3/models/{listWrapperCallbackGroupName.ts => listWrapperCallbackGroupName.mts} (100%) rename src/version3/models/{locale.ts => locale.mts} (100%) rename src/version3/models/{mark.ts => mark.mts} (100%) rename src/version3/models/{moveField.ts => moveField.mts} (100%) create mode 100644 src/version3/models/multiIssueEntityProperties.mts delete mode 100644 src/version3/models/multiIssueEntityProperties.ts rename src/version3/models/{multipleCustomFieldValuesUpdate.ts => multipleCustomFieldValuesUpdate.mts} (100%) create mode 100644 src/version3/models/multipleCustomFieldValuesUpdateDetails.mts delete mode 100644 src/version3/models/multipleCustomFieldValuesUpdateDetails.ts create mode 100644 src/version3/models/nestedResponse.mts delete mode 100644 src/version3/models/nestedResponse.ts rename src/version3/models/{newUserDetails.ts => newUserDetails.mts} (100%) create mode 100644 src/version3/models/notification.mts delete mode 100644 src/version3/models/notification.ts rename src/version3/models/{notificationEvent.ts => notificationEvent.mts} (100%) create mode 100644 src/version3/models/notificationRecipients.mts delete mode 100644 src/version3/models/notificationRecipients.ts create mode 100644 src/version3/models/notificationRecipientsRestrictions.mts delete mode 100644 src/version3/models/notificationRecipientsRestrictions.ts create mode 100644 src/version3/models/notificationScheme.mts delete mode 100644 src/version3/models/notificationScheme.ts rename src/version3/models/{notificationSchemeAndProjectMapping.ts => notificationSchemeAndProjectMapping.mts} (100%) create mode 100644 src/version3/models/notificationSchemeAndProjectMappingPage.mts delete mode 100644 src/version3/models/notificationSchemeAndProjectMappingPage.ts create mode 100644 src/version3/models/notificationSchemeEvent.mts delete mode 100644 src/version3/models/notificationSchemeEvent.ts create mode 100644 src/version3/models/notificationSchemeEventDetails.mts delete mode 100644 src/version3/models/notificationSchemeEventDetails.ts rename src/version3/models/{notificationSchemeEventTypeId.ts => notificationSchemeEventTypeId.mts} (100%) rename src/version3/models/{notificationSchemeId.ts => notificationSchemeId.mts} (100%) rename src/version3/models/{notificationSchemeNotificationDetails.ts => notificationSchemeNotificationDetails.mts} (100%) rename src/version3/models/{oldToNewSecurityLevelMappings.ts => oldToNewSecurityLevelMappings.mts} (100%) rename src/version3/models/{operationMessage.ts => operationMessage.mts} (100%) create mode 100644 src/version3/models/operations.mts delete mode 100644 src/version3/models/operations.ts rename src/version3/models/{orderOfCustomFieldOptions.ts => orderOfCustomFieldOptions.mts} (100%) rename src/version3/models/{orderOfIssueTypes.ts => orderOfIssueTypes.mts} (100%) create mode 100644 src/version3/models/pageBeanFieldConfigurationDetails.mts delete mode 100644 src/version3/models/pageBeanFieldConfigurationDetails.ts create mode 100644 src/version3/models/pageChangelog.mts delete mode 100644 src/version3/models/pageChangelog.ts create mode 100644 src/version3/models/pageComment.mts delete mode 100644 src/version3/models/pageComment.ts create mode 100644 src/version3/models/pageComponentWithIssueCount.mts delete mode 100644 src/version3/models/pageComponentWithIssueCount.ts create mode 100644 src/version3/models/pageContextForProjectAndIssueType.mts delete mode 100644 src/version3/models/pageContextForProjectAndIssueType.ts create mode 100644 src/version3/models/pageContextualConfiguration.mts delete mode 100644 src/version3/models/pageContextualConfiguration.ts create mode 100644 src/version3/models/pageCustomFieldContext.mts delete mode 100644 src/version3/models/pageCustomFieldContext.ts create mode 100644 src/version3/models/pageCustomFieldContextDefaultValue.mts delete mode 100644 src/version3/models/pageCustomFieldContextDefaultValue.ts create mode 100644 src/version3/models/pageCustomFieldContextOption.mts delete mode 100644 src/version3/models/pageCustomFieldContextOption.ts create mode 100644 src/version3/models/pageCustomFieldContextProjectMapping.mts delete mode 100644 src/version3/models/pageCustomFieldContextProjectMapping.ts create mode 100644 src/version3/models/pageDashboard.mts delete mode 100644 src/version3/models/pageDashboard.ts create mode 100644 src/version3/models/pageField.mts delete mode 100644 src/version3/models/pageField.ts create mode 100644 src/version3/models/pageFieldConfigurationIssueTypeItem.mts delete mode 100644 src/version3/models/pageFieldConfigurationIssueTypeItem.ts create mode 100644 src/version3/models/pageFieldConfigurationItem.mts delete mode 100644 src/version3/models/pageFieldConfigurationItem.ts create mode 100644 src/version3/models/pageFieldConfigurationScheme.mts delete mode 100644 src/version3/models/pageFieldConfigurationScheme.ts create mode 100644 src/version3/models/pageFieldConfigurationSchemeProjects.mts delete mode 100644 src/version3/models/pageFieldConfigurationSchemeProjects.ts create mode 100644 src/version3/models/pageFilterDetails.mts delete mode 100644 src/version3/models/pageFilterDetails.ts create mode 100644 src/version3/models/pageGroupDetails.mts delete mode 100644 src/version3/models/pageGroupDetails.ts create mode 100644 src/version3/models/pageIssueFieldOption.mts delete mode 100644 src/version3/models/pageIssueFieldOption.ts create mode 100644 src/version3/models/pageIssueSecurityLevelMember.mts delete mode 100644 src/version3/models/pageIssueSecurityLevelMember.ts create mode 100644 src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts delete mode 100644 src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts create mode 100644 src/version3/models/pageIssueTypeScheme.mts delete mode 100644 src/version3/models/pageIssueTypeScheme.ts create mode 100644 src/version3/models/pageIssueTypeSchemeMapping.mts delete mode 100644 src/version3/models/pageIssueTypeSchemeMapping.ts create mode 100644 src/version3/models/pageIssueTypeSchemeProjects.mts delete mode 100644 src/version3/models/pageIssueTypeSchemeProjects.ts create mode 100644 src/version3/models/pageIssueTypeScreenScheme.mts delete mode 100644 src/version3/models/pageIssueTypeScreenScheme.ts create mode 100644 src/version3/models/pageIssueTypeScreenSchemeItem.mts delete mode 100644 src/version3/models/pageIssueTypeScreenSchemeItem.ts create mode 100644 src/version3/models/pageIssueTypeScreenSchemesProjects.mts delete mode 100644 src/version3/models/pageIssueTypeScreenSchemesProjects.ts create mode 100644 src/version3/models/pageIssueTypeToContextMapping.mts delete mode 100644 src/version3/models/pageIssueTypeToContextMapping.ts create mode 100644 src/version3/models/pageJqlFunctionPrecomputation.mts delete mode 100644 src/version3/models/pageJqlFunctionPrecomputation.ts create mode 100644 src/version3/models/pageNotificationScheme.mts delete mode 100644 src/version3/models/pageNotificationScheme.ts create mode 100644 src/version3/models/pageOfChangelogs.mts delete mode 100644 src/version3/models/pageOfChangelogs.ts create mode 100644 src/version3/models/pageOfComments.mts delete mode 100644 src/version3/models/pageOfComments.ts create mode 100644 src/version3/models/pageOfDashboards.mts delete mode 100644 src/version3/models/pageOfDashboards.ts create mode 100644 src/version3/models/pageOfStatuses.mts delete mode 100644 src/version3/models/pageOfStatuses.ts create mode 100644 src/version3/models/pageOfWorklogs.mts delete mode 100644 src/version3/models/pageOfWorklogs.ts create mode 100644 src/version3/models/pagePriority.mts delete mode 100644 src/version3/models/pagePriority.ts create mode 100644 src/version3/models/pageProject.mts delete mode 100644 src/version3/models/pageProject.ts create mode 100644 src/version3/models/pageProjectDetails.mts delete mode 100644 src/version3/models/pageProjectDetails.ts create mode 100644 src/version3/models/pageResolution.mts delete mode 100644 src/version3/models/pageResolution.ts create mode 100644 src/version3/models/pageScreen.mts delete mode 100644 src/version3/models/pageScreen.ts create mode 100644 src/version3/models/pageScreenScheme.mts delete mode 100644 src/version3/models/pageScreenScheme.ts create mode 100644 src/version3/models/pageScreenWithTab.mts delete mode 100644 src/version3/models/pageScreenWithTab.ts create mode 100644 src/version3/models/pageSecurityLevel.mts delete mode 100644 src/version3/models/pageSecurityLevel.ts create mode 100644 src/version3/models/pageSecurityLevelMember.mts delete mode 100644 src/version3/models/pageSecurityLevelMember.ts create mode 100644 src/version3/models/pageSecuritySchemeWithProjects.mts delete mode 100644 src/version3/models/pageSecuritySchemeWithProjects.ts rename src/version3/models/{pageString.ts => pageString.mts} (100%) create mode 100644 src/version3/models/pageUiModificationDetails.mts delete mode 100644 src/version3/models/pageUiModificationDetails.ts create mode 100644 src/version3/models/pageUser.mts delete mode 100644 src/version3/models/pageUser.ts create mode 100644 src/version3/models/pageUserDetails.mts delete mode 100644 src/version3/models/pageUserDetails.ts create mode 100644 src/version3/models/pageUserKey.mts delete mode 100644 src/version3/models/pageUserKey.ts create mode 100644 src/version3/models/pageVersion.mts delete mode 100644 src/version3/models/pageVersion.ts create mode 100644 src/version3/models/pageWebhook.mts delete mode 100644 src/version3/models/pageWebhook.ts create mode 100644 src/version3/models/pageWorkflow.mts delete mode 100644 src/version3/models/pageWorkflow.ts create mode 100644 src/version3/models/pageWorkflowScheme.mts delete mode 100644 src/version3/models/pageWorkflowScheme.ts create mode 100644 src/version3/models/pageWorkflowTransitionRules.mts delete mode 100644 src/version3/models/pageWorkflowTransitionRules.ts create mode 100644 src/version3/models/pagedListUserDetailsApplicationUser.mts delete mode 100644 src/version3/models/pagedListUserDetailsApplicationUser.ts create mode 100644 src/version3/models/parsedJqlQueries.mts delete mode 100644 src/version3/models/parsedJqlQueries.ts create mode 100644 src/version3/models/parsedJqlQuery.mts delete mode 100644 src/version3/models/parsedJqlQuery.ts create mode 100644 src/version3/models/permissionDetails.mts delete mode 100644 src/version3/models/permissionDetails.ts create mode 100644 src/version3/models/permissionGrant.mts delete mode 100644 src/version3/models/permissionGrant.ts create mode 100644 src/version3/models/permissionGrants.mts delete mode 100644 src/version3/models/permissionGrants.ts rename src/version3/models/{permissionHolder.ts => permissionHolder.mts} (100%) create mode 100644 src/version3/models/permissionScheme.mts delete mode 100644 src/version3/models/permissionScheme.ts create mode 100644 src/version3/models/permissionSchemes.mts delete mode 100644 src/version3/models/permissionSchemes.ts rename src/version3/models/{permissions.ts => permissions.mts} (100%) rename src/version3/models/{permissionsKeys.ts => permissionsKeys.mts} (100%) create mode 100644 src/version3/models/permittedProjects.mts delete mode 100644 src/version3/models/permittedProjects.ts rename src/version3/models/{priority.ts => priority.mts} (100%) rename src/version3/models/{priorityId.ts => priorityId.mts} (100%) create mode 100644 src/version3/models/project.mts delete mode 100644 src/version3/models/project.ts create mode 100644 src/version3/models/projectAvatars.mts delete mode 100644 src/version3/models/projectAvatars.ts rename src/version3/models/{projectCategory.ts => projectCategory.mts} (100%) create mode 100644 src/version3/models/projectComponent.mts delete mode 100644 src/version3/models/projectComponent.ts create mode 100644 src/version3/models/projectDetails.mts delete mode 100644 src/version3/models/projectDetails.ts rename src/version3/models/{projectEmailAddress.ts => projectEmailAddress.mts} (100%) rename src/version3/models/{projectFeature.ts => projectFeature.mts} (100%) rename src/version3/models/{projectFeatureToggleRequest.ts => projectFeatureToggleRequest.mts} (100%) rename src/version3/models/{projectId.ts => projectId.mts} (100%) rename src/version3/models/{projectIdentifier.ts => projectIdentifier.mts} (100%) rename src/version3/models/{projectIdentifiers.ts => projectIdentifiers.mts} (100%) rename src/version3/models/{projectIds.ts => projectIds.mts} (100%) rename src/version3/models/{projectInsight.ts => projectInsight.mts} (100%) create mode 100644 src/version3/models/projectIssueCreateMetadata.mts delete mode 100644 src/version3/models/projectIssueCreateMetadata.ts create mode 100644 src/version3/models/projectIssueSecurityLevels.mts delete mode 100644 src/version3/models/projectIssueSecurityLevels.ts create mode 100644 src/version3/models/projectIssueTypeHierarchy.mts delete mode 100644 src/version3/models/projectIssueTypeHierarchy.ts rename src/version3/models/{projectIssueTypeMapping.ts => projectIssueTypeMapping.mts} (100%) create mode 100644 src/version3/models/projectIssueTypeMappings.mts delete mode 100644 src/version3/models/projectIssueTypeMappings.ts create mode 100644 src/version3/models/projectIssueTypes.mts delete mode 100644 src/version3/models/projectIssueTypes.ts create mode 100644 src/version3/models/projectIssueTypesHierarchyLevel.mts delete mode 100644 src/version3/models/projectIssueTypesHierarchyLevel.ts rename src/version3/models/{projectLandingPageInfo.ts => projectLandingPageInfo.mts} (100%) rename src/version3/models/{projectPermissions.ts => projectPermissions.mts} (100%) create mode 100644 src/version3/models/projectRole.mts delete mode 100644 src/version3/models/projectRole.ts rename src/version3/models/{projectRoleActorsUpdate.ts => projectRoleActorsUpdate.mts} (100%) create mode 100644 src/version3/models/projectRoleDetails.mts delete mode 100644 src/version3/models/projectRoleDetails.ts rename src/version3/models/{projectRoleGroup.ts => projectRoleGroup.mts} (100%) rename src/version3/models/{projectRoleUser.ts => projectRoleUser.mts} (100%) rename src/version3/models/{projectScope.ts => projectScope.mts} (100%) rename src/version3/models/{projectType.ts => projectType.mts} (100%) rename src/version3/models/{propertyKey.ts => propertyKey.mts} (100%) create mode 100644 src/version3/models/propertyKeys.mts delete mode 100644 src/version3/models/propertyKeys.ts rename src/version3/models/{publishedWorkflowId.ts => publishedWorkflowId.mts} (100%) rename src/version3/models/{registeredWebhook.ts => registeredWebhook.mts} (100%) create mode 100644 src/version3/models/remoteIssueLink.mts delete mode 100644 src/version3/models/remoteIssueLink.ts rename src/version3/models/{remoteIssueLinkIdentifies.ts => remoteIssueLinkIdentifies.mts} (100%) create mode 100644 src/version3/models/remoteIssueLinkRequest.mts delete mode 100644 src/version3/models/remoteIssueLinkRequest.ts create mode 100644 src/version3/models/remoteObject.mts delete mode 100644 src/version3/models/remoteObject.ts create mode 100644 src/version3/models/removeOptionFromIssuesResult.mts delete mode 100644 src/version3/models/removeOptionFromIssuesResult.ts rename src/version3/models/{reorderIssuePriorities.ts => reorderIssuePriorities.mts} (100%) rename src/version3/models/{reorderIssueResolutionsRequest.ts => reorderIssueResolutionsRequest.mts} (100%) rename src/version3/models/{resolution.ts => resolution.mts} (100%) rename src/version3/models/{resolutionId.ts => resolutionId.mts} (100%) rename src/version3/models/{restrictedPermission.ts => restrictedPermission.mts} (100%) rename src/version3/models/{richText.ts => richText.mts} (100%) create mode 100644 src/version3/models/roleActor.mts delete mode 100644 src/version3/models/roleActor.ts rename src/version3/models/{ruleConfiguration.ts => ruleConfiguration.mts} (100%) create mode 100644 src/version3/models/sanitizedJqlQueries.mts delete mode 100644 src/version3/models/sanitizedJqlQueries.ts create mode 100644 src/version3/models/sanitizedJqlQuery.mts delete mode 100644 src/version3/models/sanitizedJqlQuery.ts create mode 100644 src/version3/models/scope.mts delete mode 100644 src/version3/models/scope.ts create mode 100644 src/version3/models/screen.mts delete mode 100644 src/version3/models/screen.ts rename src/version3/models/{screenDetails.ts => screenDetails.mts} (100%) rename src/version3/models/{screenID.ts => screenID.mts} (100%) create mode 100644 src/version3/models/screenScheme.mts delete mode 100644 src/version3/models/screenScheme.ts create mode 100644 src/version3/models/screenSchemeDetails.mts delete mode 100644 src/version3/models/screenSchemeDetails.ts rename src/version3/models/{screenSchemeId.ts => screenSchemeId.mts} (100%) rename src/version3/models/{screenTypes.ts => screenTypes.mts} (100%) create mode 100644 src/version3/models/screenWithTab.mts delete mode 100644 src/version3/models/screenWithTab.ts rename src/version3/models/{screenableField.ts => screenableField.mts} (100%) rename src/version3/models/{screenableTab.ts => screenableTab.mts} (100%) rename src/version3/models/{searchAutoCompleteFilter.ts => searchAutoCompleteFilter.mts} (100%) create mode 100644 src/version3/models/searchRequest.mts delete mode 100644 src/version3/models/searchRequest.ts create mode 100644 src/version3/models/searchResults.mts delete mode 100644 src/version3/models/searchResults.ts rename src/version3/models/{securityLevel.ts => securityLevel.mts} (100%) create mode 100644 src/version3/models/securityLevelMember.mts delete mode 100644 src/version3/models/securityLevelMember.ts create mode 100644 src/version3/models/securityScheme.mts delete mode 100644 src/version3/models/securityScheme.ts rename src/version3/models/{securitySchemeId.ts => securitySchemeId.mts} (100%) create mode 100644 src/version3/models/securitySchemeLevel.mts delete mode 100644 src/version3/models/securitySchemeLevel.ts rename src/version3/models/{securitySchemeLevelMember.ts => securitySchemeLevelMember.mts} (100%) create mode 100644 src/version3/models/securitySchemeMembersRequest.mts delete mode 100644 src/version3/models/securitySchemeMembersRequest.ts rename src/version3/models/{securitySchemeWithProjects.ts => securitySchemeWithProjects.mts} (100%) create mode 100644 src/version3/models/securitySchemes.mts delete mode 100644 src/version3/models/securitySchemes.ts rename src/version3/models/{serverInformation.ts => serverInformation.mts} (100%) create mode 100644 src/version3/models/setDefaultLevelsRequest.mts delete mode 100644 src/version3/models/setDefaultLevelsRequest.ts rename src/version3/models/{setDefaultPriorityRequest.ts => setDefaultPriorityRequest.mts} (100%) rename src/version3/models/{setDefaultResolutionRequest.ts => setDefaultResolutionRequest.mts} (100%) create mode 100644 src/version3/models/sharePermission.mts delete mode 100644 src/version3/models/sharePermission.ts rename src/version3/models/{sharePermissionInput.ts => sharePermissionInput.mts} (100%) rename src/version3/models/{simpleApplicationProperty.ts => simpleApplicationProperty.mts} (100%) rename src/version3/models/{simpleErrorCollection.ts => simpleErrorCollection.mts} (100%) rename src/version3/models/{simpleLink.ts => simpleLink.mts} (100%) create mode 100644 src/version3/models/simpleListWrapperApplicationRole.mts delete mode 100644 src/version3/models/simpleListWrapperApplicationRole.ts create mode 100644 src/version3/models/simpleListWrapperGroupName.mts delete mode 100644 src/version3/models/simpleListWrapperGroupName.ts create mode 100644 src/version3/models/status.mts delete mode 100644 src/version3/models/status.ts rename src/version3/models/{statusCategory.ts => statusCategory.mts} (100%) rename src/version3/models/{statusCreate.ts => statusCreate.mts} (100%) create mode 100644 src/version3/models/statusCreateRequest.mts delete mode 100644 src/version3/models/statusCreateRequest.ts create mode 100644 src/version3/models/statusDetails.mts delete mode 100644 src/version3/models/statusDetails.ts rename src/version3/models/{statusMapping.ts => statusMapping.mts} (100%) create mode 100644 src/version3/models/statusScope.mts delete mode 100644 src/version3/models/statusScope.ts rename src/version3/models/{statusUpdate.ts => statusUpdate.mts} (100%) create mode 100644 src/version3/models/statusUpdateRequest.mts delete mode 100644 src/version3/models/statusUpdateRequest.ts rename src/version3/models/{suggestedIssue.ts => suggestedIssue.mts} (100%) create mode 100644 src/version3/models/systemAvatars.mts delete mode 100644 src/version3/models/systemAvatars.ts rename src/version3/models/{taskProgressObject.ts => taskProgressObject.mts} (100%) create mode 100644 src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts delete mode 100644 src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts rename src/version3/models/{timeTrackingConfiguration.ts => timeTrackingConfiguration.mts} (100%) rename src/version3/models/{timeTrackingDetails.ts => timeTrackingDetails.mts} (100%) rename src/version3/models/{timeTrackingProvider.ts => timeTrackingProvider.mts} (100%) create mode 100644 src/version3/models/transition.mts delete mode 100644 src/version3/models/transition.ts create mode 100644 src/version3/models/transitions.mts delete mode 100644 src/version3/models/transitions.ts rename src/version3/models/{uiModificationContextDetails.ts => uiModificationContextDetails.mts} (100%) create mode 100644 src/version3/models/uiModificationDetails.mts delete mode 100644 src/version3/models/uiModificationDetails.ts rename src/version3/models/{uiModificationIdentifiers.ts => uiModificationIdentifiers.mts} (100%) rename src/version3/models/{unrestrictedUserEmail.ts => unrestrictedUserEmail.mts} (100%) rename src/version3/models/{updateCustomFieldDetails.ts => updateCustomFieldDetails.mts} (100%) rename src/version3/models/{updateFieldConfigurationSchemeDetails.ts => updateFieldConfigurationSchemeDetails.mts} (100%) rename src/version3/models/{updateIssueSecurityLevelDetails.ts => updateIssueSecurityLevelDetails.mts} (100%) rename src/version3/models/{updateIssueSecuritySchemeRequest.ts => updateIssueSecuritySchemeRequest.mts} (100%) rename src/version3/models/{updateNotificationSchemeDetails.ts => updateNotificationSchemeDetails.mts} (100%) rename src/version3/models/{updatePriorityDetails.ts => updatePriorityDetails.mts} (100%) rename src/version3/models/{updateProjectDetails.ts => updateProjectDetails.mts} (100%) rename src/version3/models/{updateResolutionDetails.ts => updateResolutionDetails.mts} (100%) rename src/version3/models/{updateScreenDetails.ts => updateScreenDetails.mts} (100%) create mode 100644 src/version3/models/updateScreenSchemeDetails.mts delete mode 100644 src/version3/models/updateScreenSchemeDetails.ts rename src/version3/models/{updateScreenTypes.ts => updateScreenTypes.mts} (100%) create mode 100644 src/version3/models/updateUiModificationDetails.mts delete mode 100644 src/version3/models/updateUiModificationDetails.ts rename src/version3/models/{updateUserToGroup.ts => updateUserToGroup.mts} (100%) rename src/version3/models/{updatedProjectCategory.ts => updatedProjectCategory.mts} (100%) create mode 100644 src/version3/models/user.mts delete mode 100644 src/version3/models/user.ts rename src/version3/models/{userAvatarUrls.ts => userAvatarUrls.mts} (100%) create mode 100644 src/version3/models/userDetails.mts delete mode 100644 src/version3/models/userDetails.ts rename src/version3/models/{userKey.ts => userKey.mts} (100%) create mode 100644 src/version3/models/userList.mts delete mode 100644 src/version3/models/userList.ts rename src/version3/models/{userMigration.ts => userMigration.mts} (100%) rename src/version3/models/{userPickerUser.ts => userPickerUser.mts} (100%) create mode 100644 src/version3/models/version.mts delete mode 100644 src/version3/models/version.ts create mode 100644 src/version3/models/versionIssueCounts.mts delete mode 100644 src/version3/models/versionIssueCounts.ts rename src/version3/models/{versionIssuesStatus.ts => versionIssuesStatus.mts} (100%) rename src/version3/models/{versionMove.ts => versionMove.mts} (100%) rename src/version3/models/{versionUnresolvedIssuesCount.ts => versionUnresolvedIssuesCount.mts} (100%) rename src/version3/models/{versionUsageInCustomField.ts => versionUsageInCustomField.mts} (100%) rename src/version3/models/{visibility.ts => visibility.mts} (100%) create mode 100644 src/version3/models/votes.mts delete mode 100644 src/version3/models/votes.ts create mode 100644 src/version3/models/watchers.mts delete mode 100644 src/version3/models/watchers.ts create mode 100644 src/version3/models/webhook.mts delete mode 100644 src/version3/models/webhook.ts create mode 100644 src/version3/models/webhookDetails.mts delete mode 100644 src/version3/models/webhookDetails.ts create mode 100644 src/version3/models/webhookRegistrationDetails.mts delete mode 100644 src/version3/models/webhookRegistrationDetails.ts rename src/version3/models/{webhooksExpirationDate.ts => webhooksExpirationDate.mts} (100%) create mode 100644 src/version3/models/workflow.mts delete mode 100644 src/version3/models/workflow.ts rename src/version3/models/{workflowCondition.ts => workflowCondition.mts} (100%) rename src/version3/models/{workflowId.ts => workflowId.mts} (100%) rename src/version3/models/{workflowOperations.ts => workflowOperations.mts} (100%) create mode 100644 src/version3/models/workflowRules.mts delete mode 100644 src/version3/models/workflowRules.ts rename src/version3/models/{workflowRulesSearch.ts => workflowRulesSearch.mts} (100%) create mode 100644 src/version3/models/workflowRulesSearchDetails.mts delete mode 100644 src/version3/models/workflowRulesSearchDetails.ts create mode 100644 src/version3/models/workflowScheme.mts delete mode 100644 src/version3/models/workflowScheme.ts create mode 100644 src/version3/models/workflowSchemeAssociations.mts delete mode 100644 src/version3/models/workflowSchemeAssociations.ts rename src/version3/models/{workflowSchemeIdName.ts => workflowSchemeIdName.mts} (100%) rename src/version3/models/{workflowSchemeProjectAssociation.ts => workflowSchemeProjectAssociation.mts} (100%) create mode 100644 src/version3/models/workflowStatus.mts delete mode 100644 src/version3/models/workflowStatus.ts rename src/version3/models/{workflowStatusProperties.ts => workflowStatusProperties.mts} (100%) rename src/version3/models/{workflowTransition.ts => workflowTransition.mts} (100%) rename src/version3/models/{workflowTransitionProperty.ts => workflowTransitionProperty.mts} (100%) rename src/version3/models/{workflowTransitionRule.ts => workflowTransitionRule.mts} (100%) create mode 100644 src/version3/models/workflowTransitionRules.mts delete mode 100644 src/version3/models/workflowTransitionRules.ts create mode 100644 src/version3/models/workflowTransitionRulesDetails.mts delete mode 100644 src/version3/models/workflowTransitionRulesDetails.ts create mode 100644 src/version3/models/workflowTransitionRulesUpdate.mts delete mode 100644 src/version3/models/workflowTransitionRulesUpdate.ts create mode 100644 src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts delete mode 100644 src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts create mode 100644 src/version3/models/workflowTransitionRulesUpdateErrors.mts delete mode 100644 src/version3/models/workflowTransitionRulesUpdateErrors.ts create mode 100644 src/version3/models/workflowsWithTransitionRulesDetails.mts delete mode 100644 src/version3/models/workflowsWithTransitionRulesDetails.ts create mode 100644 src/version3/models/worklog.mts delete mode 100644 src/version3/models/worklog.ts rename src/version3/models/{worklogIdsRequest.ts => worklogIdsRequest.mts} (100%) create mode 100644 src/version3/myself.mts delete mode 100644 src/version3/myself.ts create mode 100644 src/version3/parameters/addActorUsers.mts delete mode 100644 src/version3/parameters/addActorUsers.ts rename src/version3/parameters/{addAttachment.ts => addAttachment.mts} (100%) create mode 100644 src/version3/parameters/addComment.mts delete mode 100644 src/version3/parameters/addComment.ts rename src/version3/parameters/{addFieldToDefaultScreen.ts => addFieldToDefaultScreen.mts} (100%) create mode 100644 src/version3/parameters/addGadget.mts delete mode 100644 src/version3/parameters/addGadget.ts create mode 100644 src/version3/parameters/addIssueTypesToContext.mts delete mode 100644 src/version3/parameters/addIssueTypesToContext.ts create mode 100644 src/version3/parameters/addIssueTypesToIssueTypeScheme.mts delete mode 100644 src/version3/parameters/addIssueTypesToIssueTypeScheme.ts create mode 100644 src/version3/parameters/addProjectRoleActorsToRole.mts delete mode 100644 src/version3/parameters/addProjectRoleActorsToRole.ts create mode 100644 src/version3/parameters/addScreenTab.mts delete mode 100644 src/version3/parameters/addScreenTab.ts create mode 100644 src/version3/parameters/addScreenTabField.mts delete mode 100644 src/version3/parameters/addScreenTabField.ts create mode 100644 src/version3/parameters/addSecurityLevel.mts delete mode 100644 src/version3/parameters/addSecurityLevel.ts create mode 100644 src/version3/parameters/addSecurityLevelMembers.mts delete mode 100644 src/version3/parameters/addSecurityLevelMembers.ts create mode 100644 src/version3/parameters/addSharePermission.mts delete mode 100644 src/version3/parameters/addSharePermission.ts create mode 100644 src/version3/parameters/addUserToGroup.mts delete mode 100644 src/version3/parameters/addUserToGroup.ts rename src/version3/parameters/{addVote.ts => addVote.mts} (100%) rename src/version3/parameters/{addWatcher.ts => addWatcher.mts} (100%) create mode 100644 src/version3/parameters/addWorklog.mts delete mode 100644 src/version3/parameters/addWorklog.ts create mode 100644 src/version3/parameters/analyseExpression.mts delete mode 100644 src/version3/parameters/analyseExpression.ts create mode 100644 src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts delete mode 100644 src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts create mode 100644 src/version3/parameters/archiveIssues.mts delete mode 100644 src/version3/parameters/archiveIssues.ts create mode 100644 src/version3/parameters/archiveIssuesAsync.mts delete mode 100644 src/version3/parameters/archiveIssuesAsync.ts rename src/version3/parameters/{archiveProject.ts => archiveProject.mts} (100%) create mode 100644 src/version3/parameters/assignFieldConfigurationSchemeToProject.mts delete mode 100644 src/version3/parameters/assignFieldConfigurationSchemeToProject.ts create mode 100644 src/version3/parameters/assignIssue.mts delete mode 100644 src/version3/parameters/assignIssue.ts create mode 100644 src/version3/parameters/assignIssueTypeSchemeToProject.mts delete mode 100644 src/version3/parameters/assignIssueTypeSchemeToProject.ts create mode 100644 src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts delete mode 100644 src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts create mode 100644 src/version3/parameters/assignPermissionScheme.mts delete mode 100644 src/version3/parameters/assignPermissionScheme.ts create mode 100644 src/version3/parameters/assignProjectsToCustomFieldContext.mts delete mode 100644 src/version3/parameters/assignProjectsToCustomFieldContext.ts create mode 100644 src/version3/parameters/assignSchemeToProject.mts delete mode 100644 src/version3/parameters/assignSchemeToProject.ts create mode 100644 src/version3/parameters/associateSchemesToProjects.mts delete mode 100644 src/version3/parameters/associateSchemesToProjects.ts create mode 100644 src/version3/parameters/bulkDeleteIssueProperty.mts delete mode 100644 src/version3/parameters/bulkDeleteIssueProperty.ts create mode 100644 src/version3/parameters/bulkEditDashboards.mts delete mode 100644 src/version3/parameters/bulkEditDashboards.ts rename src/version3/parameters/{bulkGetGroups.ts => bulkGetGroups.mts} (100%) rename src/version3/parameters/{bulkGetUsers.ts => bulkGetUsers.mts} (100%) rename src/version3/parameters/{bulkGetUsersMigration.ts => bulkGetUsersMigration.mts} (100%) create mode 100644 src/version3/parameters/bulkSetIssuePropertiesByIssue.mts delete mode 100644 src/version3/parameters/bulkSetIssuePropertiesByIssue.ts create mode 100644 src/version3/parameters/bulkSetIssueProperty.mts delete mode 100644 src/version3/parameters/bulkSetIssueProperty.ts create mode 100644 src/version3/parameters/bulkSetIssuesProperties.mts delete mode 100644 src/version3/parameters/bulkSetIssuesProperties.ts rename src/version3/parameters/{cancelTask.ts => cancelTask.mts} (100%) rename src/version3/parameters/{changeFilterOwner.ts => changeFilterOwner.mts} (100%) create mode 100644 src/version3/parameters/copyDashboard.mts delete mode 100644 src/version3/parameters/copyDashboard.ts create mode 100644 src/version3/parameters/createComponent.mts delete mode 100644 src/version3/parameters/createComponent.ts create mode 100644 src/version3/parameters/createCustomField.mts delete mode 100644 src/version3/parameters/createCustomField.ts rename src/version3/parameters/{createCustomFieldContext.ts => createCustomFieldContext.mts} (100%) create mode 100644 src/version3/parameters/createCustomFieldOption.mts delete mode 100644 src/version3/parameters/createCustomFieldOption.ts create mode 100644 src/version3/parameters/createDashboard.mts delete mode 100644 src/version3/parameters/createDashboard.ts create mode 100644 src/version3/parameters/createFieldConfiguration.mts delete mode 100644 src/version3/parameters/createFieldConfiguration.ts create mode 100644 src/version3/parameters/createFieldConfigurationScheme.mts delete mode 100644 src/version3/parameters/createFieldConfigurationScheme.ts create mode 100644 src/version3/parameters/createFilter.mts delete mode 100644 src/version3/parameters/createFilter.ts create mode 100644 src/version3/parameters/createGroup.mts delete mode 100644 src/version3/parameters/createGroup.ts create mode 100644 src/version3/parameters/createIssue.mts delete mode 100644 src/version3/parameters/createIssue.ts create mode 100644 src/version3/parameters/createIssueFieldOption.mts delete mode 100644 src/version3/parameters/createIssueFieldOption.ts create mode 100644 src/version3/parameters/createIssueLinkType.mts delete mode 100644 src/version3/parameters/createIssueLinkType.ts create mode 100644 src/version3/parameters/createIssueSecurityScheme.mts delete mode 100644 src/version3/parameters/createIssueSecurityScheme.ts create mode 100644 src/version3/parameters/createIssueType.mts delete mode 100644 src/version3/parameters/createIssueType.ts rename src/version3/parameters/{createIssueTypeAvatar.ts => createIssueTypeAvatar.mts} (100%) create mode 100644 src/version3/parameters/createIssueTypeScheme.mts delete mode 100644 src/version3/parameters/createIssueTypeScheme.ts create mode 100644 src/version3/parameters/createIssueTypeScreenScheme.mts delete mode 100644 src/version3/parameters/createIssueTypeScreenScheme.ts create mode 100644 src/version3/parameters/createIssues.mts delete mode 100644 src/version3/parameters/createIssues.ts create mode 100644 src/version3/parameters/createNotificationScheme.mts delete mode 100644 src/version3/parameters/createNotificationScheme.ts create mode 100644 src/version3/parameters/createOrUpdateRemoteIssueLink.mts delete mode 100644 src/version3/parameters/createOrUpdateRemoteIssueLink.ts create mode 100644 src/version3/parameters/createPermissionGrant.mts delete mode 100644 src/version3/parameters/createPermissionGrant.ts create mode 100644 src/version3/parameters/createPermissionScheme.mts delete mode 100644 src/version3/parameters/createPermissionScheme.ts create mode 100644 src/version3/parameters/createPriority.mts delete mode 100644 src/version3/parameters/createPriority.ts create mode 100644 src/version3/parameters/createProject.mts delete mode 100644 src/version3/parameters/createProject.ts rename src/version3/parameters/{createProjectAvatar.ts => createProjectAvatar.mts} (100%) create mode 100644 src/version3/parameters/createProjectCategory.mts delete mode 100644 src/version3/parameters/createProjectCategory.ts create mode 100644 src/version3/parameters/createProjectRole.mts delete mode 100644 src/version3/parameters/createProjectRole.ts create mode 100644 src/version3/parameters/createResolution.mts delete mode 100644 src/version3/parameters/createResolution.ts create mode 100644 src/version3/parameters/createScreen.mts delete mode 100644 src/version3/parameters/createScreen.ts create mode 100644 src/version3/parameters/createScreenScheme.mts delete mode 100644 src/version3/parameters/createScreenScheme.ts create mode 100644 src/version3/parameters/createStatuses.mts delete mode 100644 src/version3/parameters/createStatuses.ts create mode 100644 src/version3/parameters/createUiModification.mts delete mode 100644 src/version3/parameters/createUiModification.ts create mode 100644 src/version3/parameters/createUser.mts delete mode 100644 src/version3/parameters/createUser.ts create mode 100644 src/version3/parameters/createVersion.mts delete mode 100644 src/version3/parameters/createVersion.ts create mode 100644 src/version3/parameters/createWorkflow.mts delete mode 100644 src/version3/parameters/createWorkflow.ts create mode 100644 src/version3/parameters/createWorkflowScheme.mts delete mode 100644 src/version3/parameters/createWorkflowScheme.ts rename src/version3/parameters/{createWorkflowSchemeDraftFromParent.ts => createWorkflowSchemeDraftFromParent.mts} (100%) create mode 100644 src/version3/parameters/createWorkflowTransitionProperty.mts delete mode 100644 src/version3/parameters/createWorkflowTransitionProperty.ts rename src/version3/parameters/{deleteActor.ts => deleteActor.mts} (100%) rename src/version3/parameters/{deleteAddonProperty.ts => deleteAddonProperty.mts} (100%) create mode 100644 src/version3/parameters/deleteAndReplaceVersion.mts delete mode 100644 src/version3/parameters/deleteAndReplaceVersion.ts rename src/version3/parameters/{deleteAppProperty.ts => deleteAppProperty.mts} (100%) rename src/version3/parameters/{deleteAvatar.ts => deleteAvatar.mts} (100%) rename src/version3/parameters/{deleteComment.ts => deleteComment.mts} (100%) rename src/version3/parameters/{deleteCommentProperty.ts => deleteCommentProperty.mts} (100%) rename src/version3/parameters/{deleteComponent.ts => deleteComponent.mts} (100%) rename src/version3/parameters/{deleteCustomField.ts => deleteCustomField.mts} (100%) rename src/version3/parameters/{deleteCustomFieldContext.ts => deleteCustomFieldContext.mts} (100%) rename src/version3/parameters/{deleteCustomFieldOption.ts => deleteCustomFieldOption.mts} (100%) rename src/version3/parameters/{deleteDashboard.ts => deleteDashboard.mts} (100%) rename src/version3/parameters/{deleteDashboardItemProperty.ts => deleteDashboardItemProperty.mts} (100%) rename src/version3/parameters/{deleteDefaultWorkflow.ts => deleteDefaultWorkflow.mts} (100%) rename src/version3/parameters/{deleteDraftDefaultWorkflow.ts => deleteDraftDefaultWorkflow.mts} (100%) rename src/version3/parameters/{deleteDraftWorkflowMapping.ts => deleteDraftWorkflowMapping.mts} (100%) rename src/version3/parameters/{deleteFavouriteForFilter.ts => deleteFavouriteForFilter.mts} (100%) rename src/version3/parameters/{deleteFieldConfiguration.ts => deleteFieldConfiguration.mts} (100%) rename src/version3/parameters/{deleteFieldConfigurationScheme.ts => deleteFieldConfigurationScheme.mts} (100%) rename src/version3/parameters/{deleteFilter.ts => deleteFilter.mts} (100%) rename src/version3/parameters/{deleteInactiveWorkflow.ts => deleteInactiveWorkflow.mts} (100%) rename src/version3/parameters/{deleteIssue.ts => deleteIssue.mts} (100%) rename src/version3/parameters/{deleteIssueFieldOption.ts => deleteIssueFieldOption.mts} (100%) rename src/version3/parameters/{deleteIssueLink.ts => deleteIssueLink.mts} (100%) rename src/version3/parameters/{deleteIssueLinkType.ts => deleteIssueLinkType.mts} (100%) rename src/version3/parameters/{deleteIssueProperty.ts => deleteIssueProperty.mts} (100%) rename src/version3/parameters/{deleteIssueType.ts => deleteIssueType.mts} (100%) rename src/version3/parameters/{deleteIssueTypeProperty.ts => deleteIssueTypeProperty.mts} (100%) rename src/version3/parameters/{deleteIssueTypeScheme.ts => deleteIssueTypeScheme.mts} (100%) rename src/version3/parameters/{deleteIssueTypeScreenScheme.ts => deleteIssueTypeScreenScheme.mts} (100%) rename src/version3/parameters/{deleteNotificationScheme.ts => deleteNotificationScheme.mts} (100%) rename src/version3/parameters/{deletePermissionScheme.ts => deletePermissionScheme.mts} (100%) rename src/version3/parameters/{deletePermissionSchemeEntity.ts => deletePermissionSchemeEntity.mts} (100%) rename src/version3/parameters/{deleteProject.ts => deleteProject.mts} (100%) rename src/version3/parameters/{deleteProjectAsynchronously.ts => deleteProjectAsynchronously.mts} (100%) rename src/version3/parameters/{deleteProjectAvatar.ts => deleteProjectAvatar.mts} (100%) rename src/version3/parameters/{deleteProjectProperty.ts => deleteProjectProperty.mts} (100%) rename src/version3/parameters/{deleteProjectRole.ts => deleteProjectRole.mts} (100%) rename src/version3/parameters/{deleteProjectRoleActorsFromRole.ts => deleteProjectRoleActorsFromRole.mts} (100%) rename src/version3/parameters/{deleteRemoteIssueLinkByGlobalId.ts => deleteRemoteIssueLinkByGlobalId.mts} (100%) rename src/version3/parameters/{deleteRemoteIssueLinkById.ts => deleteRemoteIssueLinkById.mts} (100%) rename src/version3/parameters/{deleteResolution.ts => deleteResolution.mts} (100%) rename src/version3/parameters/{deleteScreen.ts => deleteScreen.mts} (100%) rename src/version3/parameters/{deleteScreenScheme.ts => deleteScreenScheme.mts} (100%) rename src/version3/parameters/{deleteScreenTab.ts => deleteScreenTab.mts} (100%) rename src/version3/parameters/{deleteSecurityScheme.ts => deleteSecurityScheme.mts} (100%) rename src/version3/parameters/{deleteSharePermission.ts => deleteSharePermission.mts} (100%) rename src/version3/parameters/{deleteStatusesById.ts => deleteStatusesById.mts} (100%) rename src/version3/parameters/{deleteUiModification.ts => deleteUiModification.mts} (100%) rename src/version3/parameters/{deleteUserProperty.ts => deleteUserProperty.mts} (100%) create mode 100644 src/version3/parameters/deleteWebhookById.mts delete mode 100644 src/version3/parameters/deleteWebhookById.ts rename src/version3/parameters/{deleteWorkflowMapping.ts => deleteWorkflowMapping.mts} (100%) rename src/version3/parameters/{deleteWorkflowScheme.ts => deleteWorkflowScheme.mts} (100%) rename src/version3/parameters/{deleteWorkflowSchemeDraft.ts => deleteWorkflowSchemeDraft.mts} (100%) rename src/version3/parameters/{deleteWorkflowSchemeDraftIssueType.ts => deleteWorkflowSchemeDraftIssueType.mts} (100%) rename src/version3/parameters/{deleteWorkflowSchemeIssueType.ts => deleteWorkflowSchemeIssueType.mts} (100%) rename src/version3/parameters/{deleteWorkflowTransitionProperty.ts => deleteWorkflowTransitionProperty.mts} (100%) create mode 100644 src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts delete mode 100644 src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts rename src/version3/parameters/{deleteWorklog.ts => deleteWorklog.mts} (100%) rename src/version3/parameters/{deleteWorklogProperty.ts => deleteWorklogProperty.mts} (100%) create mode 100644 src/version3/parameters/doTransition.mts delete mode 100644 src/version3/parameters/doTransition.ts create mode 100644 src/version3/parameters/editIssue.mts delete mode 100644 src/version3/parameters/editIssue.ts create mode 100644 src/version3/parameters/evaluateJiraExpression.mts delete mode 100644 src/version3/parameters/evaluateJiraExpression.ts rename src/version3/parameters/{expandAttachmentForHumans.ts => expandAttachmentForHumans.mts} (100%) rename src/version3/parameters/{expandAttachmentForMachines.ts => expandAttachmentForMachines.mts} (100%) create mode 100644 src/version3/parameters/exportArchivedIssues.mts delete mode 100644 src/version3/parameters/exportArchivedIssues.ts rename src/version3/parameters/{findAssignableUsers.ts => findAssignableUsers.mts} (100%) rename src/version3/parameters/{findBulkAssignableUsers.ts => findBulkAssignableUsers.mts} (100%) rename src/version3/parameters/{findGroups.ts => findGroups.mts} (100%) rename src/version3/parameters/{findUserKeysByQuery.ts => findUserKeysByQuery.mts} (100%) rename src/version3/parameters/{findUsers.ts => findUsers.mts} (100%) rename src/version3/parameters/{findUsersAndGroups.ts => findUsersAndGroups.mts} (100%) rename src/version3/parameters/{findUsersByQuery.ts => findUsersByQuery.mts} (100%) rename src/version3/parameters/{findUsersForPicker.ts => findUsersForPicker.mts} (100%) rename src/version3/parameters/{findUsersWithAllPermissions.ts => findUsersWithAllPermissions.mts} (100%) rename src/version3/parameters/{findUsersWithBrowsePermission.ts => findUsersWithBrowsePermission.mts} (100%) create mode 100644 src/version3/parameters/fullyUpdateProjectRole.mts delete mode 100644 src/version3/parameters/fullyUpdateProjectRole.ts rename src/version3/parameters/{getAccessibleProjectTypeByKey.ts => getAccessibleProjectTypeByKey.mts} (100%) rename src/version3/parameters/{getAddonProperties.ts => getAddonProperties.mts} (100%) rename src/version3/parameters/{getAddonProperty.ts => getAddonProperty.mts} (100%) rename src/version3/parameters/{getAllDashboards.ts => getAllDashboards.mts} (100%) rename src/version3/parameters/{getAllFieldConfigurationSchemes.ts => getAllFieldConfigurationSchemes.mts} (100%) rename src/version3/parameters/{getAllFieldConfigurations.ts => getAllFieldConfigurations.mts} (100%) rename src/version3/parameters/{getAllGadgets.ts => getAllGadgets.mts} (100%) rename src/version3/parameters/{getAllIssueFieldOptions.ts => getAllIssueFieldOptions.mts} (100%) rename src/version3/parameters/{getAllIssueTypeSchemes.ts => getAllIssueTypeSchemes.mts} (100%) rename src/version3/parameters/{getAllLabels.ts => getAllLabels.mts} (100%) rename src/version3/parameters/{getAllPermissionSchemes.ts => getAllPermissionSchemes.mts} (100%) rename src/version3/parameters/{getAllProjectAvatars.ts => getAllProjectAvatars.mts} (100%) rename src/version3/parameters/{getAllScreenTabFields.ts => getAllScreenTabFields.mts} (100%) rename src/version3/parameters/{getAllScreenTabs.ts => getAllScreenTabs.mts} (100%) rename src/version3/parameters/{getAllStatuses.ts => getAllStatuses.mts} (100%) rename src/version3/parameters/{getAllSystemAvatars.ts => getAllSystemAvatars.mts} (100%) rename src/version3/parameters/{getAllUsers.ts => getAllUsers.mts} (100%) rename src/version3/parameters/{getAllUsersDefault.ts => getAllUsersDefault.mts} (100%) rename src/version3/parameters/{getAllWorkflowSchemes.ts => getAllWorkflowSchemes.mts} (100%) rename src/version3/parameters/{getAlternativeIssueTypes.ts => getAlternativeIssueTypes.mts} (100%) rename src/version3/parameters/{getApplicationProperty.ts => getApplicationProperty.mts} (100%) rename src/version3/parameters/{getApplicationRole.ts => getApplicationRole.mts} (100%) rename src/version3/parameters/{getAssignedPermissionScheme.ts => getAssignedPermissionScheme.mts} (100%) rename src/version3/parameters/{getAttachment.ts => getAttachment.mts} (100%) rename src/version3/parameters/{getAttachmentContent.ts => getAttachmentContent.mts} (100%) rename src/version3/parameters/{getAttachmentThumbnail.ts => getAttachmentThumbnail.mts} (100%) rename src/version3/parameters/{getAuditRecords.ts => getAuditRecords.mts} (100%) create mode 100644 src/version3/parameters/getAutoCompletePost.mts delete mode 100644 src/version3/parameters/getAutoCompletePost.ts rename src/version3/parameters/{getAvailableScreenFields.ts => getAvailableScreenFields.mts} (100%) rename src/version3/parameters/{getAvatarImageByID.ts => getAvatarImageByID.mts} (100%) rename src/version3/parameters/{getAvatarImageByOwner.ts => getAvatarImageByOwner.mts} (100%) rename src/version3/parameters/{getAvatarImageByType.ts => getAvatarImageByType.mts} (100%) rename src/version3/parameters/{getAvatars.ts => getAvatars.mts} (100%) create mode 100644 src/version3/parameters/getBulkPermissions.mts delete mode 100644 src/version3/parameters/getBulkPermissions.ts rename src/version3/parameters/{getChangeLogs.ts => getChangeLogs.mts} (100%) create mode 100644 src/version3/parameters/getChangeLogsByIds.mts delete mode 100644 src/version3/parameters/getChangeLogsByIds.ts rename src/version3/parameters/{getColumns.ts => getColumns.mts} (100%) rename src/version3/parameters/{getComment.ts => getComment.mts} (100%) rename src/version3/parameters/{getCommentProperty.ts => getCommentProperty.mts} (100%) rename src/version3/parameters/{getCommentPropertyKeys.ts => getCommentPropertyKeys.mts} (100%) rename src/version3/parameters/{getComments.ts => getComments.mts} (100%) create mode 100644 src/version3/parameters/getCommentsByIds.mts delete mode 100644 src/version3/parameters/getCommentsByIds.ts rename src/version3/parameters/{getComponent.ts => getComponent.mts} (100%) rename src/version3/parameters/{getComponentRelatedIssues.ts => getComponentRelatedIssues.mts} (100%) rename src/version3/parameters/{getContextsForField.ts => getContextsForField.mts} (100%) rename src/version3/parameters/{getCreateIssueMeta.ts => getCreateIssueMeta.mts} (100%) rename src/version3/parameters/{getCurrentUser.ts => getCurrentUser.mts} (100%) rename src/version3/parameters/{getCustomFieldConfiguration.ts => getCustomFieldConfiguration.mts} (100%) create mode 100644 src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts delete mode 100644 src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts rename src/version3/parameters/{getCustomFieldOption.ts => getCustomFieldOption.mts} (100%) rename src/version3/parameters/{getDashboard.ts => getDashboard.mts} (100%) rename src/version3/parameters/{getDashboardItemProperty.ts => getDashboardItemProperty.mts} (100%) rename src/version3/parameters/{getDashboardItemPropertyKeys.ts => getDashboardItemPropertyKeys.mts} (100%) rename src/version3/parameters/{getDashboardsPaginated.ts => getDashboardsPaginated.mts} (100%) rename src/version3/parameters/{getDefaultValues.ts => getDefaultValues.mts} (100%) rename src/version3/parameters/{getDefaultWorkflow.ts => getDefaultWorkflow.mts} (100%) rename src/version3/parameters/{getDraftDefaultWorkflow.ts => getDraftDefaultWorkflow.mts} (100%) rename src/version3/parameters/{getDraftWorkflow.ts => getDraftWorkflow.mts} (100%) rename src/version3/parameters/{getDynamicWebhooksForApp.ts => getDynamicWebhooksForApp.mts} (100%) rename src/version3/parameters/{getEditIssueMeta.ts => getEditIssueMeta.mts} (100%) rename src/version3/parameters/{getFailedWebhooks.ts => getFailedWebhooks.mts} (100%) rename src/version3/parameters/{getFavouriteFilters.ts => getFavouriteFilters.mts} (100%) rename src/version3/parameters/{getFeaturesForProject.ts => getFeaturesForProject.mts} (100%) rename src/version3/parameters/{getFieldAutoCompleteForQueryString.ts => getFieldAutoCompleteForQueryString.mts} (100%) rename src/version3/parameters/{getFieldConfigurationItems.ts => getFieldConfigurationItems.mts} (100%) rename src/version3/parameters/{getFieldConfigurationSchemeMappings.ts => getFieldConfigurationSchemeMappings.mts} (100%) rename src/version3/parameters/{getFieldConfigurationSchemeProjectMapping.ts => getFieldConfigurationSchemeProjectMapping.mts} (100%) rename src/version3/parameters/{getFieldsPaginated.ts => getFieldsPaginated.mts} (100%) rename src/version3/parameters/{getFilter.ts => getFilter.mts} (100%) create mode 100644 src/version3/parameters/getFiltersPaginated.mts delete mode 100644 src/version3/parameters/getFiltersPaginated.ts rename src/version3/parameters/{getHierarchy.ts => getHierarchy.mts} (100%) rename src/version3/parameters/{getIdsOfWorklogsDeletedSince.ts => getIdsOfWorklogsDeletedSince.mts} (100%) rename src/version3/parameters/{getIdsOfWorklogsModifiedSince.ts => getIdsOfWorklogsModifiedSince.mts} (100%) create mode 100644 src/version3/parameters/getIsWatchingIssueBulk.mts delete mode 100644 src/version3/parameters/getIsWatchingIssueBulk.ts create mode 100644 src/version3/parameters/getIssue.mts delete mode 100644 src/version3/parameters/getIssue.ts rename src/version3/parameters/{getIssueFieldOption.ts => getIssueFieldOption.mts} (100%) rename src/version3/parameters/{getIssueLink.ts => getIssueLink.mts} (100%) rename src/version3/parameters/{getIssueLinkType.ts => getIssueLinkType.mts} (100%) create mode 100644 src/version3/parameters/getIssuePickerResource.mts delete mode 100644 src/version3/parameters/getIssuePickerResource.ts rename src/version3/parameters/{getIssueProperty.ts => getIssueProperty.mts} (100%) rename src/version3/parameters/{getIssuePropertyKeys.ts => getIssuePropertyKeys.mts} (100%) rename src/version3/parameters/{getIssueSecurityLevel.ts => getIssueSecurityLevel.mts} (100%) rename src/version3/parameters/{getIssueSecurityLevelMembers.ts => getIssueSecurityLevelMembers.mts} (100%) rename src/version3/parameters/{getIssueSecurityScheme.ts => getIssueSecurityScheme.mts} (100%) rename src/version3/parameters/{getIssueType.ts => getIssueType.mts} (100%) rename src/version3/parameters/{getIssueTypeMappingsForContexts.ts => getIssueTypeMappingsForContexts.mts} (100%) rename src/version3/parameters/{getIssueTypeProperty.ts => getIssueTypeProperty.mts} (100%) rename src/version3/parameters/{getIssueTypePropertyKeys.ts => getIssueTypePropertyKeys.mts} (100%) rename src/version3/parameters/{getIssueTypeSchemeForProjects.ts => getIssueTypeSchemeForProjects.mts} (100%) rename src/version3/parameters/{getIssueTypeSchemesMapping.ts => getIssueTypeSchemesMapping.mts} (100%) rename src/version3/parameters/{getIssueTypeScreenSchemeMappings.ts => getIssueTypeScreenSchemeMappings.mts} (100%) rename src/version3/parameters/{getIssueTypeScreenSchemeProjectAssociations.ts => getIssueTypeScreenSchemeProjectAssociations.mts} (100%) rename src/version3/parameters/{getIssueTypeScreenSchemes.ts => getIssueTypeScreenSchemes.mts} (100%) rename src/version3/parameters/{getIssueTypesForProject.ts => getIssueTypesForProject.mts} (100%) rename src/version3/parameters/{getIssueWatchers.ts => getIssueWatchers.mts} (100%) rename src/version3/parameters/{getIssueWorklog.ts => getIssueWorklog.mts} (100%) rename src/version3/parameters/{getMyFilters.ts => getMyFilters.mts} (100%) rename src/version3/parameters/{getMyPermissions.ts => getMyPermissions.mts} (100%) rename src/version3/parameters/{getNotificationScheme.ts => getNotificationScheme.mts} (100%) rename src/version3/parameters/{getNotificationSchemeToProjectMappings.ts => getNotificationSchemeToProjectMappings.mts} (100%) rename src/version3/parameters/{getNotificationSchemes.ts => getNotificationSchemes.mts} (100%) rename src/version3/parameters/{getOptionsForContext.ts => getOptionsForContext.mts} (100%) rename src/version3/parameters/{getPermissionScheme.ts => getPermissionScheme.mts} (100%) rename src/version3/parameters/{getPermissionSchemeGrant.ts => getPermissionSchemeGrant.mts} (100%) rename src/version3/parameters/{getPermissionSchemeGrants.ts => getPermissionSchemeGrants.mts} (100%) create mode 100644 src/version3/parameters/getPermittedProjects.mts delete mode 100644 src/version3/parameters/getPermittedProjects.ts rename src/version3/parameters/{getPrecomputations.ts => getPrecomputations.mts} (100%) rename src/version3/parameters/{getPreference.ts => getPreference.mts} (100%) rename src/version3/parameters/{getPriority.ts => getPriority.mts} (100%) rename src/version3/parameters/{getProject.ts => getProject.mts} (100%) rename src/version3/parameters/{getProjectCategoryById.ts => getProjectCategoryById.mts} (100%) rename src/version3/parameters/{getProjectComponents.ts => getProjectComponents.mts} (100%) rename src/version3/parameters/{getProjectComponentsPaginated.ts => getProjectComponentsPaginated.mts} (100%) rename src/version3/parameters/{getProjectContextMapping.ts => getProjectContextMapping.mts} (100%) rename src/version3/parameters/{getProjectEmail.ts => getProjectEmail.mts} (100%) rename src/version3/parameters/{getProjectIssueSecurityScheme.ts => getProjectIssueSecurityScheme.mts} (100%) rename src/version3/parameters/{getProjectProperty.ts => getProjectProperty.mts} (100%) rename src/version3/parameters/{getProjectPropertyKeys.ts => getProjectPropertyKeys.mts} (100%) rename src/version3/parameters/{getProjectRole.ts => getProjectRole.mts} (100%) rename src/version3/parameters/{getProjectRoleActorsForRole.ts => getProjectRoleActorsForRole.mts} (100%) rename src/version3/parameters/{getProjectRoleById.ts => getProjectRoleById.mts} (100%) rename src/version3/parameters/{getProjectRoleDetails.ts => getProjectRoleDetails.mts} (100%) rename src/version3/parameters/{getProjectRoles.ts => getProjectRoles.mts} (100%) rename src/version3/parameters/{getProjectTypeByKey.ts => getProjectTypeByKey.mts} (100%) rename src/version3/parameters/{getProjectVersions.ts => getProjectVersions.mts} (100%) rename src/version3/parameters/{getProjectVersionsPaginated.ts => getProjectVersionsPaginated.mts} (100%) rename src/version3/parameters/{getProjectsForIssueTypeScreenScheme.ts => getProjectsForIssueTypeScreenScheme.mts} (100%) rename src/version3/parameters/{getRecent.ts => getRecent.mts} (100%) rename src/version3/parameters/{getRemoteIssueLinkById.ts => getRemoteIssueLinkById.mts} (100%) rename src/version3/parameters/{getRemoteIssueLinks.ts => getRemoteIssueLinks.mts} (100%) rename src/version3/parameters/{getScreenSchemes.ts => getScreenSchemes.mts} (100%) rename src/version3/parameters/{getScreens.ts => getScreens.mts} (100%) rename src/version3/parameters/{getScreensForField.ts => getScreensForField.mts} (100%) rename src/version3/parameters/{getSecurityLevelMembers.ts => getSecurityLevelMembers.mts} (100%) rename src/version3/parameters/{getSecurityLevels.ts => getSecurityLevels.mts} (100%) rename src/version3/parameters/{getSecurityLevelsForProject.ts => getSecurityLevelsForProject.mts} (100%) rename src/version3/parameters/{getSelectableIssueFieldOptions.ts => getSelectableIssueFieldOptions.mts} (100%) rename src/version3/parameters/{getSharePermission.ts => getSharePermission.mts} (100%) rename src/version3/parameters/{getSharePermissions.ts => getSharePermissions.mts} (100%) rename src/version3/parameters/{getStatus.ts => getStatus.mts} (100%) rename src/version3/parameters/{getStatusCategory.ts => getStatusCategory.mts} (100%) rename src/version3/parameters/{getStatusesById.ts => getStatusesById.mts} (100%) rename src/version3/parameters/{getTask.ts => getTask.mts} (100%) rename src/version3/parameters/{getTransitions.ts => getTransitions.mts} (100%) rename src/version3/parameters/{getTrashedFieldsPaginated.ts => getTrashedFieldsPaginated.mts} (100%) rename src/version3/parameters/{getUiModifications.ts => getUiModifications.mts} (100%) rename src/version3/parameters/{getUser.ts => getUser.mts} (100%) rename src/version3/parameters/{getUserDefaultColumns.ts => getUserDefaultColumns.mts} (100%) rename src/version3/parameters/{getUserEmail.ts => getUserEmail.mts} (100%) rename src/version3/parameters/{getUserEmailBulk.ts => getUserEmailBulk.mts} (100%) rename src/version3/parameters/{getUserGroups.ts => getUserGroups.mts} (100%) rename src/version3/parameters/{getUserProperty.ts => getUserProperty.mts} (100%) rename src/version3/parameters/{getUserPropertyKeys.ts => getUserPropertyKeys.mts} (100%) rename src/version3/parameters/{getUsersFromGroup.ts => getUsersFromGroup.mts} (100%) rename src/version3/parameters/{getValidProjectKey.ts => getValidProjectKey.mts} (100%) rename src/version3/parameters/{getValidProjectName.ts => getValidProjectName.mts} (100%) rename src/version3/parameters/{getVersion.ts => getVersion.mts} (100%) rename src/version3/parameters/{getVersionRelatedIssues.ts => getVersionRelatedIssues.mts} (100%) rename src/version3/parameters/{getVersionUnresolvedIssues.ts => getVersionUnresolvedIssues.mts} (100%) rename src/version3/parameters/{getVisibleIssueFieldOptions.ts => getVisibleIssueFieldOptions.mts} (100%) rename src/version3/parameters/{getVotes.ts => getVotes.mts} (100%) rename src/version3/parameters/{getWorkflow.ts => getWorkflow.mts} (100%) rename src/version3/parameters/{getWorkflowScheme.ts => getWorkflowScheme.mts} (100%) rename src/version3/parameters/{getWorkflowSchemeDraft.ts => getWorkflowSchemeDraft.mts} (100%) rename src/version3/parameters/{getWorkflowSchemeDraftIssueType.ts => getWorkflowSchemeDraftIssueType.mts} (100%) rename src/version3/parameters/{getWorkflowSchemeIssueType.ts => getWorkflowSchemeIssueType.mts} (100%) rename src/version3/parameters/{getWorkflowSchemeProjectAssociations.ts => getWorkflowSchemeProjectAssociations.mts} (100%) rename src/version3/parameters/{getWorkflowTransitionProperties.ts => getWorkflowTransitionProperties.mts} (100%) rename src/version3/parameters/{getWorkflowTransitionRuleConfigurations.ts => getWorkflowTransitionRuleConfigurations.mts} (100%) rename src/version3/parameters/{getWorkflowsPaginated.ts => getWorkflowsPaginated.mts} (100%) rename src/version3/parameters/{getWorklog.ts => getWorklog.mts} (100%) rename src/version3/parameters/{getWorklogProperty.ts => getWorklogProperty.mts} (100%) rename src/version3/parameters/{getWorklogPropertyKeys.ts => getWorklogPropertyKeys.mts} (100%) create mode 100644 src/version3/parameters/getWorklogsForIds.mts delete mode 100644 src/version3/parameters/getWorklogsForIds.ts create mode 100644 src/version3/parameters/index.mts delete mode 100644 src/version3/parameters/index.ts create mode 100644 src/version3/parameters/linkIssues.mts delete mode 100644 src/version3/parameters/linkIssues.ts create mode 100644 src/version3/parameters/matchIssues.mts delete mode 100644 src/version3/parameters/matchIssues.ts rename src/version3/parameters/{mergeVersions.ts => mergeVersions.mts} (100%) create mode 100644 src/version3/parameters/migrateQueries.mts delete mode 100644 src/version3/parameters/migrateQueries.ts create mode 100644 src/version3/parameters/movePriorities.mts delete mode 100644 src/version3/parameters/movePriorities.ts create mode 100644 src/version3/parameters/moveResolutions.mts delete mode 100644 src/version3/parameters/moveResolutions.ts rename src/version3/parameters/{moveScreenTab.ts => moveScreenTab.mts} (100%) create mode 100644 src/version3/parameters/moveScreenTabField.mts delete mode 100644 src/version3/parameters/moveScreenTabField.ts create mode 100644 src/version3/parameters/moveVersion.mts delete mode 100644 src/version3/parameters/moveVersion.ts create mode 100644 src/version3/parameters/notify.mts delete mode 100644 src/version3/parameters/notify.ts create mode 100644 src/version3/parameters/parseJqlQueries.mts delete mode 100644 src/version3/parameters/parseJqlQueries.ts create mode 100644 src/version3/parameters/partialUpdateProjectRole.mts delete mode 100644 src/version3/parameters/partialUpdateProjectRole.ts create mode 100644 src/version3/parameters/publishDraftWorkflowScheme.mts delete mode 100644 src/version3/parameters/publishDraftWorkflowScheme.ts rename src/version3/parameters/{putAddonProperty.ts => putAddonProperty.mts} (100%) rename src/version3/parameters/{putAppProperty.ts => putAppProperty.mts} (100%) create mode 100644 src/version3/parameters/refreshWebhooks.mts delete mode 100644 src/version3/parameters/refreshWebhooks.ts create mode 100644 src/version3/parameters/registerDynamicWebhooks.mts delete mode 100644 src/version3/parameters/registerDynamicWebhooks.ts create mode 100644 src/version3/parameters/registerModules.mts delete mode 100644 src/version3/parameters/registerModules.ts rename src/version3/parameters/{removeAttachment.ts => removeAttachment.mts} (100%) create mode 100644 src/version3/parameters/removeCustomFieldContextFromProjects.mts delete mode 100644 src/version3/parameters/removeCustomFieldContextFromProjects.ts rename src/version3/parameters/{removeGadget.ts => removeGadget.mts} (100%) rename src/version3/parameters/{removeGroup.ts => removeGroup.mts} (100%) rename src/version3/parameters/{removeIssueTypeFromIssueTypeScheme.ts => removeIssueTypeFromIssueTypeScheme.mts} (100%) create mode 100644 src/version3/parameters/removeIssueTypesFromContext.mts delete mode 100644 src/version3/parameters/removeIssueTypesFromContext.ts create mode 100644 src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts delete mode 100644 src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts rename src/version3/parameters/{removeLevel.ts => removeLevel.mts} (100%) create mode 100644 src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts delete mode 100644 src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts rename src/version3/parameters/{removeMemberFromSecurityLevel.ts => removeMemberFromSecurityLevel.mts} (100%) rename src/version3/parameters/{removeModules.ts => removeModules.mts} (100%) rename src/version3/parameters/{removeNotificationFromNotificationScheme.ts => removeNotificationFromNotificationScheme.mts} (100%) rename src/version3/parameters/{removePreference.ts => removePreference.mts} (100%) rename src/version3/parameters/{removeProjectCategory.ts => removeProjectCategory.mts} (100%) rename src/version3/parameters/{removeScreenTabField.ts => removeScreenTabField.mts} (100%) rename src/version3/parameters/{removeUser.ts => removeUser.mts} (100%) rename src/version3/parameters/{removeUserFromGroup.ts => removeUserFromGroup.mts} (100%) rename src/version3/parameters/{removeVote.ts => removeVote.mts} (100%) rename src/version3/parameters/{removeWatcher.ts => removeWatcher.mts} (100%) create mode 100644 src/version3/parameters/renameScreenTab.mts delete mode 100644 src/version3/parameters/renameScreenTab.ts create mode 100644 src/version3/parameters/reorderCustomFieldOptions.mts delete mode 100644 src/version3/parameters/reorderCustomFieldOptions.ts create mode 100644 src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts delete mode 100644 src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts create mode 100644 src/version3/parameters/replaceIssueFieldOption.mts delete mode 100644 src/version3/parameters/replaceIssueFieldOption.ts rename src/version3/parameters/{resetColumns.ts => resetColumns.mts} (100%) rename src/version3/parameters/{resetUserColumns.ts => resetUserColumns.mts} (100%) rename src/version3/parameters/{restore.ts => restore.mts} (100%) rename src/version3/parameters/{restoreCustomField.ts => restoreCustomField.mts} (100%) create mode 100644 src/version3/parameters/sanitiseJqlQueries.mts delete mode 100644 src/version3/parameters/sanitiseJqlQueries.ts rename src/version3/parameters/{search.ts => search.mts} (100%) create mode 100644 src/version3/parameters/searchForIssuesUsingJql.mts delete mode 100644 src/version3/parameters/searchForIssuesUsingJql.ts create mode 100644 src/version3/parameters/searchForIssuesUsingJqlPost.mts delete mode 100644 src/version3/parameters/searchForIssuesUsingJqlPost.ts rename src/version3/parameters/{searchPriorities.ts => searchPriorities.mts} (100%) rename src/version3/parameters/{searchProjects.ts => searchProjects.mts} (100%) rename src/version3/parameters/{searchProjectsUsingSecuritySchemes.ts => searchProjectsUsingSecuritySchemes.mts} (100%) rename src/version3/parameters/{searchResolutions.ts => searchResolutions.mts} (100%) rename src/version3/parameters/{searchSecuritySchemes.ts => searchSecuritySchemes.mts} (100%) create mode 100644 src/version3/parameters/selectTimeTrackingImplementation.mts delete mode 100644 src/version3/parameters/selectTimeTrackingImplementation.ts create mode 100644 src/version3/parameters/setActors.mts delete mode 100644 src/version3/parameters/setActors.ts create mode 100644 src/version3/parameters/setApplicationProperty.mts delete mode 100644 src/version3/parameters/setApplicationProperty.ts create mode 100644 src/version3/parameters/setBanner.mts delete mode 100644 src/version3/parameters/setBanner.ts rename src/version3/parameters/{setColumns.ts => setColumns.mts} (100%) rename src/version3/parameters/{setCommentProperty.ts => setCommentProperty.mts} (100%) rename src/version3/parameters/{setDashboardItemProperty.ts => setDashboardItemProperty.mts} (100%) create mode 100644 src/version3/parameters/setDefaultLevels.mts delete mode 100644 src/version3/parameters/setDefaultLevels.ts create mode 100644 src/version3/parameters/setDefaultPriority.mts delete mode 100644 src/version3/parameters/setDefaultPriority.ts create mode 100644 src/version3/parameters/setDefaultResolution.mts delete mode 100644 src/version3/parameters/setDefaultResolution.ts create mode 100644 src/version3/parameters/setDefaultShareScope.mts delete mode 100644 src/version3/parameters/setDefaultShareScope.ts create mode 100644 src/version3/parameters/setDefaultValues.mts delete mode 100644 src/version3/parameters/setDefaultValues.ts rename src/version3/parameters/{setFavouriteForFilter.ts => setFavouriteForFilter.mts} (100%) create mode 100644 src/version3/parameters/setFieldConfigurationSchemeMapping.mts delete mode 100644 src/version3/parameters/setFieldConfigurationSchemeMapping.ts rename src/version3/parameters/{setIssueProperty.ts => setIssueProperty.mts} (100%) rename src/version3/parameters/{setIssueTypeProperty.ts => setIssueTypeProperty.mts} (100%) rename src/version3/parameters/{setPreference.ts => setPreference.mts} (100%) rename src/version3/parameters/{setProjectProperty.ts => setProjectProperty.mts} (100%) create mode 100644 src/version3/parameters/setSharedTimeTrackingConfiguration.mts delete mode 100644 src/version3/parameters/setSharedTimeTrackingConfiguration.ts rename src/version3/parameters/{setUserColumns.ts => setUserColumns.mts} (100%) rename src/version3/parameters/{setUserProperty.ts => setUserProperty.mts} (100%) create mode 100644 src/version3/parameters/setWorkflowSchemeDraftIssueType.mts delete mode 100644 src/version3/parameters/setWorkflowSchemeDraftIssueType.ts create mode 100644 src/version3/parameters/setWorkflowSchemeIssueType.mts delete mode 100644 src/version3/parameters/setWorkflowSchemeIssueType.ts rename src/version3/parameters/{setWorklogProperty.ts => setWorklogProperty.mts} (100%) rename src/version3/parameters/{storeAvatar.ts => storeAvatar.mts} (100%) create mode 100644 src/version3/parameters/toggleFeatureForProject.mts delete mode 100644 src/version3/parameters/toggleFeatureForProject.ts rename src/version3/parameters/{trashCustomField.ts => trashCustomField.mts} (100%) create mode 100644 src/version3/parameters/unarchiveIssues.mts delete mode 100644 src/version3/parameters/unarchiveIssues.ts create mode 100644 src/version3/parameters/updateComment.mts delete mode 100644 src/version3/parameters/updateComment.ts create mode 100644 src/version3/parameters/updateComponent.mts delete mode 100644 src/version3/parameters/updateComponent.ts create mode 100644 src/version3/parameters/updateCustomField.mts delete mode 100644 src/version3/parameters/updateCustomField.ts create mode 100644 src/version3/parameters/updateCustomFieldConfiguration.mts delete mode 100644 src/version3/parameters/updateCustomFieldConfiguration.ts create mode 100644 src/version3/parameters/updateCustomFieldContext.mts delete mode 100644 src/version3/parameters/updateCustomFieldContext.ts create mode 100644 src/version3/parameters/updateCustomFieldOption.mts delete mode 100644 src/version3/parameters/updateCustomFieldOption.ts create mode 100644 src/version3/parameters/updateCustomFieldValue.mts delete mode 100644 src/version3/parameters/updateCustomFieldValue.ts create mode 100644 src/version3/parameters/updateDashboard.mts delete mode 100644 src/version3/parameters/updateDashboard.ts rename src/version3/parameters/{updateDefaultScreenScheme.ts => updateDefaultScreenScheme.mts} (100%) create mode 100644 src/version3/parameters/updateDefaultWorkflow.mts delete mode 100644 src/version3/parameters/updateDefaultWorkflow.ts create mode 100644 src/version3/parameters/updateDraftDefaultWorkflow.mts delete mode 100644 src/version3/parameters/updateDraftDefaultWorkflow.ts create mode 100644 src/version3/parameters/updateDraftWorkflowMapping.mts delete mode 100644 src/version3/parameters/updateDraftWorkflowMapping.ts create mode 100644 src/version3/parameters/updateEntityPropertiesValue.mts delete mode 100644 src/version3/parameters/updateEntityPropertiesValue.ts create mode 100644 src/version3/parameters/updateFieldConfiguration.mts delete mode 100644 src/version3/parameters/updateFieldConfiguration.ts create mode 100644 src/version3/parameters/updateFieldConfigurationItems.mts delete mode 100644 src/version3/parameters/updateFieldConfigurationItems.ts create mode 100644 src/version3/parameters/updateFieldConfigurationScheme.mts delete mode 100644 src/version3/parameters/updateFieldConfigurationScheme.ts create mode 100644 src/version3/parameters/updateFilter.mts delete mode 100644 src/version3/parameters/updateFilter.ts create mode 100644 src/version3/parameters/updateGadget.mts delete mode 100644 src/version3/parameters/updateGadget.ts create mode 100644 src/version3/parameters/updateIssueFieldOption.mts delete mode 100644 src/version3/parameters/updateIssueFieldOption.ts create mode 100644 src/version3/parameters/updateIssueFields.mts delete mode 100644 src/version3/parameters/updateIssueFields.ts create mode 100644 src/version3/parameters/updateIssueLinkType.mts delete mode 100644 src/version3/parameters/updateIssueLinkType.ts create mode 100644 src/version3/parameters/updateIssueSecurityScheme.mts delete mode 100644 src/version3/parameters/updateIssueSecurityScheme.ts create mode 100644 src/version3/parameters/updateIssueType.mts delete mode 100644 src/version3/parameters/updateIssueType.ts create mode 100644 src/version3/parameters/updateIssueTypeScheme.mts delete mode 100644 src/version3/parameters/updateIssueTypeScheme.ts create mode 100644 src/version3/parameters/updateIssueTypeScreenScheme.mts delete mode 100644 src/version3/parameters/updateIssueTypeScreenScheme.ts create mode 100644 src/version3/parameters/updateMultipleCustomFieldValues.mts delete mode 100644 src/version3/parameters/updateMultipleCustomFieldValues.ts create mode 100644 src/version3/parameters/updateNotificationScheme.mts delete mode 100644 src/version3/parameters/updateNotificationScheme.ts create mode 100644 src/version3/parameters/updatePermissionScheme.mts delete mode 100644 src/version3/parameters/updatePermissionScheme.ts create mode 100644 src/version3/parameters/updatePrecomputations.mts delete mode 100644 src/version3/parameters/updatePrecomputations.ts create mode 100644 src/version3/parameters/updatePriority.mts delete mode 100644 src/version3/parameters/updatePriority.ts create mode 100644 src/version3/parameters/updateProject.mts delete mode 100644 src/version3/parameters/updateProject.ts create mode 100644 src/version3/parameters/updateProjectAvatar.mts delete mode 100644 src/version3/parameters/updateProjectAvatar.ts create mode 100644 src/version3/parameters/updateProjectCategory.mts delete mode 100644 src/version3/parameters/updateProjectCategory.ts create mode 100644 src/version3/parameters/updateProjectEmail.mts delete mode 100644 src/version3/parameters/updateProjectEmail.ts create mode 100644 src/version3/parameters/updateRemoteIssueLink.mts delete mode 100644 src/version3/parameters/updateRemoteIssueLink.ts create mode 100644 src/version3/parameters/updateResolution.mts delete mode 100644 src/version3/parameters/updateResolution.ts create mode 100644 src/version3/parameters/updateScreen.mts delete mode 100644 src/version3/parameters/updateScreen.ts create mode 100644 src/version3/parameters/updateScreenScheme.mts delete mode 100644 src/version3/parameters/updateScreenScheme.ts create mode 100644 src/version3/parameters/updateSecurityLevel.mts delete mode 100644 src/version3/parameters/updateSecurityLevel.ts create mode 100644 src/version3/parameters/updateStatuses.mts delete mode 100644 src/version3/parameters/updateStatuses.ts create mode 100644 src/version3/parameters/updateUiModification.mts delete mode 100644 src/version3/parameters/updateUiModification.ts create mode 100644 src/version3/parameters/updateVersion.mts delete mode 100644 src/version3/parameters/updateVersion.ts create mode 100644 src/version3/parameters/updateWorkflowMapping.mts delete mode 100644 src/version3/parameters/updateWorkflowMapping.ts create mode 100644 src/version3/parameters/updateWorkflowScheme.mts delete mode 100644 src/version3/parameters/updateWorkflowScheme.ts create mode 100644 src/version3/parameters/updateWorkflowSchemeDraft.mts delete mode 100644 src/version3/parameters/updateWorkflowSchemeDraft.ts create mode 100644 src/version3/parameters/updateWorkflowTransitionProperty.mts delete mode 100644 src/version3/parameters/updateWorkflowTransitionProperty.ts create mode 100644 src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts delete mode 100644 src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts create mode 100644 src/version3/parameters/updateWorklog.mts delete mode 100644 src/version3/parameters/updateWorklog.ts rename src/version3/parameters/{validateProjectKey.ts => validateProjectKey.mts} (100%) create mode 100644 src/version3/parameters/workflowRuleSearch.mts delete mode 100644 src/version3/parameters/workflowRuleSearch.ts create mode 100644 src/version3/permissionSchemes.mts delete mode 100644 src/version3/permissionSchemes.ts create mode 100644 src/version3/permissions.mts delete mode 100644 src/version3/permissions.ts create mode 100644 src/version3/projectAvatars.mts delete mode 100644 src/version3/projectAvatars.ts create mode 100644 src/version3/projectCategories.mts delete mode 100644 src/version3/projectCategories.ts create mode 100644 src/version3/projectComponents.mts delete mode 100644 src/version3/projectComponents.ts create mode 100644 src/version3/projectEmail.mts delete mode 100644 src/version3/projectEmail.ts create mode 100644 src/version3/projectFeatures.mts delete mode 100644 src/version3/projectFeatures.ts create mode 100644 src/version3/projectKeyAndNameValidation.mts delete mode 100644 src/version3/projectKeyAndNameValidation.ts create mode 100644 src/version3/projectPermissionSchemes.mts delete mode 100644 src/version3/projectPermissionSchemes.ts create mode 100644 src/version3/projectProperties.mts delete mode 100644 src/version3/projectProperties.ts create mode 100644 src/version3/projectRoleActors.mts delete mode 100644 src/version3/projectRoleActors.ts create mode 100644 src/version3/projectRoles.mts delete mode 100644 src/version3/projectRoles.ts create mode 100644 src/version3/projectTypes.mts delete mode 100644 src/version3/projectTypes.ts create mode 100644 src/version3/projectVersions.mts delete mode 100644 src/version3/projectVersions.ts create mode 100644 src/version3/projects.mts delete mode 100644 src/version3/projects.ts create mode 100644 src/version3/screenSchemes.mts delete mode 100644 src/version3/screenSchemes.ts create mode 100644 src/version3/screenTabFields.mts delete mode 100644 src/version3/screenTabFields.ts create mode 100644 src/version3/screenTabs.mts delete mode 100644 src/version3/screenTabs.ts create mode 100644 src/version3/screens.mts delete mode 100644 src/version3/screens.ts create mode 100644 src/version3/serverInfo.mts delete mode 100644 src/version3/serverInfo.ts create mode 100644 src/version3/status.mts delete mode 100644 src/version3/status.ts create mode 100644 src/version3/tasks.mts delete mode 100644 src/version3/tasks.ts create mode 100644 src/version3/timeTracking.mts delete mode 100644 src/version3/timeTracking.ts delete mode 100644 src/version3/uIModificationsApps.ts create mode 100644 src/version3/uiModificationsApps.mts create mode 100644 src/version3/userProperties.mts delete mode 100644 src/version3/userProperties.ts create mode 100644 src/version3/userSearch.mts delete mode 100644 src/version3/userSearch.ts create mode 100644 src/version3/users.mts delete mode 100644 src/version3/users.ts create mode 100644 src/version3/webhooks.mts delete mode 100644 src/version3/webhooks.ts create mode 100644 src/version3/workflowSchemeDrafts.mts delete mode 100644 src/version3/workflowSchemeDrafts.ts create mode 100644 src/version3/workflowSchemeProjectAssociations.mts delete mode 100644 src/version3/workflowSchemeProjectAssociations.ts create mode 100644 src/version3/workflowSchemes.mts delete mode 100644 src/version3/workflowSchemes.ts create mode 100644 src/version3/workflowStatusCategories.mts delete mode 100644 src/version3/workflowStatusCategories.ts create mode 100644 src/version3/workflowStatuses.mts delete mode 100644 src/version3/workflowStatuses.ts create mode 100644 src/version3/workflowTransitionProperties.mts delete mode 100644 src/version3/workflowTransitionProperties.ts create mode 100644 src/version3/workflowTransitionRules.mts delete mode 100644 src/version3/workflowTransitionRules.ts create mode 100644 src/version3/workflows.mts delete mode 100644 src/version3/workflows.ts rename tests/integration/agile/{sprint.test.ts => sprint.test.mts} (100%) rename tests/integration/{constants.ts => constants.mts} (100%) rename tests/integration/{index.ts => index.mts} (100%) rename tests/integration/utils/{cleanupEnvironment.ts => cleanupEnvironment.mts} (100%) rename tests/integration/utils/{createAgileProject.ts => createAgileProject.mts} (100%) rename tests/integration/utils/{createIssue.ts => createIssue.mts} (100%) rename tests/integration/utils/{createSoftwareProject.ts => createSoftwareProject.mts} (100%) rename tests/integration/utils/{deleteAgileProject.ts => deleteAgileProject.mts} (100%) rename tests/integration/utils/{deleteSoftwareProject.ts => deleteSoftwareProject.mts} (100%) rename tests/integration/utils/{getClient.ts => getClient.mts} (100%) rename tests/integration/utils/{index.ts => index.mts} (100%) rename tests/integration/utils/{prepareEnvironment.ts => prepareEnvironment.mts} (100%) rename tests/integration/version2/{avatars.test.ts => avatars.test.mts} (100%) rename tests/integration/version2/{dashboards.test.ts => dashboards.test.mts} (100%) rename tests/integration/version2/{groups.test.ts => groups.test.mts} (100%) rename tests/integration/version2/{issueAttachments.test.ts => issueAttachments.test.mts} (100%) rename tests/integration/version2/{issueComments.test.ts => issueComments.test.mts} (100%) rename tests/integration/version2/{issueSearch.test.ts => issueSearch.test.mts} (100%) rename tests/integration/version2/{issueVotes.test.ts => issueVotes.test.mts} (100%) rename tests/integration/version2/{issues.test.ts => issues.test.mts} (100%) rename tests/integration/version2/{projectRoles.test.ts => projectRoles.test.mts} (100%) rename tests/integration/version2/{projects.test.ts => projects.test.mts} (100%) rename tests/integration/version3/{avatars.test.ts => avatars.test.mts} (100%) rename tests/integration/version3/{dashboards.test.ts => dashboards.test.mts} (100%) rename tests/integration/version3/{groups.test.ts => groups.test.mts} (100%) rename tests/integration/version3/{issueAttachments.test.ts => issueAttachments.test.mts} (100%) rename tests/integration/version3/{issueComments.test.ts => issueComments.test.mts} (100%) rename tests/integration/version3/{issueSearch.test.ts => issueSearch.test.mts} (100%) rename tests/integration/version3/{issueVotes.test.ts => issueVotes.test.mts} (100%) rename tests/integration/version3/{issues.test.ts => issues.test.mts} (100%) rename tests/integration/version3/{projectRoles.test.ts => projectRoles.test.mts} (100%) rename tests/integration/version3/{projects.test.ts => projects.test.mts} (100%) rename tests/unit/agile/{board.test.ts => board.test.mts} (100%) create mode 100644 tests/unit/agile/client/agileClient.test.mts rename tests/unit/agile/{issue.test.ts => issue.test.mts} (100%) rename tests/unit/agile/{sprint.test.ts => sprint.test.mts} (100%) rename tests/unit/clients/{baseClient.test.ts => baseClient.test.mts} (100%) delete mode 100644 tests/unit/createClient.test.ts create mode 100644 tests/unit/index.test.mts delete mode 100644 tests/unit/index.test.ts create mode 100644 tests/unit/serviceDesk/client/serviceDeskClient.test.mts rename tests/unit/services/{authenticationService.test.ts => authenticationService.test.mts} (100%) rename tests/unit/version2/{appMigration.test.ts => appMigration.test.mts} (100%) create mode 100644 tests/unit/version2/client/version2Client.test.mts rename tests/unit/version2/{issueComments.test.ts => issueComments.test.mts} (100%) rename tests/unit/version2/{issueFields.test.ts => issueFields.test.mts} (100%) rename tests/unit/version2/{issueLinks.test.ts => issueLinks.test.mts} (100%) rename tests/unit/version2/{issuePriorities.test.ts => issuePriorities.test.mts} (100%) rename tests/unit/version2/{issueRemoteLinks.test.ts => issueRemoteLinks.test.mts} (100%) create mode 100644 tests/unit/version2/issueSearch.test.mts delete mode 100644 tests/unit/version2/issueSearch.test.ts rename tests/unit/version2/{issueVotes.test.ts => issueVotes.test.mts} (100%) rename tests/unit/version2/{issueWatcher.test.ts => issueWatcher.test.mts} (100%) rename tests/unit/version2/{issues.test.ts => issues.test.mts} (100%) rename tests/unit/version2/{myself.test.ts => myself.test.mts} (100%) rename tests/unit/version2/{projectVersions.test.ts => projectVersions.test.mts} (100%) rename tests/unit/version2/{workflowStatuses.test.ts => workflowStatuses.test.mts} (100%) rename tests/unit/version3/{appMigration.test.ts => appMigration.test.mts} (100%) create mode 100644 tests/unit/version3/client/version3Client.test.mts rename tests/unit/version3/{issueComments.test.ts => issueComments.test.mts} (100%) rename tests/unit/version3/{issueFields.test.ts => issueFields.test.mts} (100%) rename tests/unit/version3/{issueLinks.test.ts => issueLinks.test.mts} (100%) rename tests/unit/version3/{issuePriorities.test.ts => issuePriorities.test.mts} (100%) rename tests/unit/version3/{issueRemoteLinks.test.ts => issueRemoteLinks.test.mts} (100%) create mode 100644 tests/unit/version3/issueSearch.test.mts delete mode 100644 tests/unit/version3/issueSearch.test.ts rename tests/unit/version3/{issueVotes.test.ts => issueVotes.test.mts} (100%) rename tests/unit/version3/{issueWatcher.test.ts => issueWatcher.test.mts} (100%) rename tests/unit/version3/{issues.test.ts => issues.test.mts} (100%) rename tests/unit/version3/{myself.test.ts => myself.test.mts} (100%) rename tests/unit/version3/{projectVersions.test.ts => projectVersions.test.mts} (100%) rename tests/unit/version3/{workflowStatuses.test.ts => workflowStatuses.test.mts} (100%) diff --git a/.gitignore b/.gitignore index c68ba2715b..4e3c836361 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .idea/ .vscode/ node_modules/ -out/ +dist/ docs/ coverage/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb66ec3c6..fc99ba3397 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Jira.js changelog +### 5.0.0 + +todo +- createClient function was removed + ### 4.0.3 - **Bug Fix:** Fixed an issue with the `Users.createUser` method by adding the required `products` property. Thanks to [Appelberg-s](https://github.com/Appelberg-s) for the [fix](https://github.com/MrRefactoring/jira.js/commit/362918093c20036049db334743e2a0f5f41cbcd4#diff-6960050bc2a3d9ffad9eb5e307145969dc4a38eb5434eebf39da545fd18e01b7R12). @@ -276,7 +281,7 @@ Version 3: maxContentLength was increased for attachments upload. Thanks to [Rea - `excludeId` property added to `findGroups` method in `Groups`. - `orderBy`, `expand` and `queryString` properties added to `getAllIssueTypeSchemes` method in `IssueTypeSchemes`. - `queryString`, `orderBy` and `expand` properties added to `getIssueTypeScreenSchemes` method in `IssueTypeScreenSchemes`. - - `sanitiseJqlQueries` method added to `JQL`. + - `sanitiseJqlQueries` method added to `Jql`. - `excludeInactiveUsers` property added to `getProjectRole` method in `ProjectRoles`. - `queryString`, `scope` and `orderBy` properties added to `getScreens` method in `Screens`. - `expand`, `queryString` and `orderBy` properties added to `getScreenSchemes` method in `ScreenSchemes`. diff --git a/examples/src/addFixVersion.ts b/examples/src/addFixVersion.mts similarity index 100% rename from examples/src/addFixVersion.ts rename to examples/src/addFixVersion.mts diff --git a/examples/src/addWorklog.ts b/examples/src/addWorklog.mts similarity index 100% rename from examples/src/addWorklog.ts rename to examples/src/addWorklog.mts diff --git a/examples/src/basic.ts b/examples/src/basic.mts similarity index 100% rename from examples/src/basic.ts rename to examples/src/basic.mts diff --git a/examples/src/credentials.ts b/examples/src/credentials.mts similarity index 100% rename from examples/src/credentials.ts rename to examples/src/credentials.mts diff --git a/examples/src/getAllWorklogs.ts b/examples/src/getAllWorklogs.mts similarity index 100% rename from examples/src/getAllWorklogs.ts rename to examples/src/getAllWorklogs.mts diff --git a/examples/src/utils/addWorklog.ts b/examples/src/utils/addWorklog.mts similarity index 100% rename from examples/src/utils/addWorklog.ts rename to examples/src/utils/addWorklog.mts diff --git a/examples/src/utils/createIssue.ts b/examples/src/utils/createIssue.mts similarity index 100% rename from examples/src/utils/createIssue.ts rename to examples/src/utils/createIssue.mts diff --git a/examples/src/utils/index.ts b/examples/src/utils/index.mts similarity index 100% rename from examples/src/utils/index.ts rename to examples/src/utils/index.mts diff --git a/package-lock.json b/package-lock.json index 35e16de8a2..bf9924b716 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,23 +1,27 @@ { "name": "jira.js", - "version": "4.0.3", + "version": "5.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jira.js", - "version": "4.0.3", + "version": "5.0.0", "license": "MIT", "dependencies": { "axios": "^1.7.9", - "form-data": "^4.0.1", - "tslib": "^2.8.1" + "formdata-node": "^6.0.3" }, "devDependencies": { + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^28.0.2", + "@rollup/plugin-node-resolve": "^16.0.0", + "@rollup/plugin-typescript": "^12.1.2", "@types/node": "^18.19.69", "@types/sinon": "^17.0.3", "@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/parser": "^8.19.0", + "@vitest/coverage-v8": "^2.1.8", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", @@ -25,6 +29,7 @@ "eslint-plugin-import": "^2.31.0", "prettier": "^3.4.2", "prettier-plugin-jsdoc": "^1.3.0", + "rollup": "^4.29.1", "sinon": "^18.0.1", "typedoc": "^0.27.6", "typescript": "^5.7.2", @@ -32,6 +37,77 @@ "vitest": "^2.1.8" } }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.3.tgz", + "integrity": "sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.3" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", + "integrity": "sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true, + "license": "MIT" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -584,6 +660,98 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", @@ -591,6 +759,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -639,6 +818,137 @@ "node": ">=12.4.0" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@rollup/plugin-alias": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-5.1.1.tgz", + "integrity": "sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", + "integrity": "sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.0.tgz", + "integrity": "sha512-0FPvAeVUT/zdWoO0jnb/V5BlBsUSNfkIOtFHzMO4H9MOklrmQFY6FduVHKucNb/aTFxvnGhj4MNj/T1oNdDfNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.29.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.29.1.tgz", @@ -1051,6 +1361,13 @@ "undici-types": "~5.26.4" } }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/sinon": { "version": "17.0.3", "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", @@ -1275,6 +1592,39 @@ "dev": true, "license": "ISC" }, + "node_modules/@vitest/coverage-v8": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.8.tgz", + "integrity": "sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@bcoe/v8-coverage": "^0.2.3", + "debug": "^4.3.7", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.6", + "istanbul-reports": "^3.1.7", + "magic-string": "^0.30.12", + "magicast": "^0.3.5", + "std-env": "^3.8.0", + "test-exclude": "^7.0.1", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@vitest/browser": "2.1.8", + "vitest": "2.1.8" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + } + } + }, "node_modules/@vitest/expect": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", @@ -1318,6 +1668,16 @@ } } }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/@vitest/pretty-format": { "version": "2.1.8", "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", @@ -1827,6 +2187,13 @@ "node": ">= 12.0.0" } }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1959,6 +2326,16 @@ "dev": true, "license": "MIT" }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -2079,6 +2456,20 @@ "node": ">= 0.4" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, "node_modules/enhanced-resolve": { "version": "5.18.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", @@ -2678,14 +3069,11 @@ } }, "node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } + "license": "MIT" }, "node_modules/esutils": { "version": "2.0.3", @@ -2768,6 +3156,21 @@ "reusify": "^1.0.4" } }, + "node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2863,20 +3266,46 @@ "is-callable": "^1.1.3" } }, - "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==", - "license": "MIT", + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" }, "engines": { "node": ">= 6" } }, + "node_modules/formdata-node": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-6.0.3.tgz", + "integrity": "sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg==", + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3216,6 +3645,13 @@ "node": ">= 0.4" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3454,6 +3890,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-generator-function": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", @@ -3496,6 +3942,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3533,6 +3986,16 @@ "node": ">=8" } }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -3692,6 +4155,76 @@ "dev": true, "license": "ISC" }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", + "integrity": "sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -3817,6 +4350,13 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/lunr": { "version": "2.3.9", "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", @@ -3834,6 +4374,34 @@ "@jridgewell/sourcemap-codec": "^1.5.0" } }, + "node_modules/magicast": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.5.tgz", + "integrity": "sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.4", + "@babel/types": "^7.25.4", + "source-map-js": "^1.2.0" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/markdown-it": { "version": "14.1.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", @@ -4395,6 +4963,19 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -4442,6 +5023,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -4689,6 +5280,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -4739,6 +5337,23 @@ "dev": true, "license": "MIT" }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-to-regexp": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", @@ -4774,13 +5389,13 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "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": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -5298,6 +5913,19 @@ "dev": true, "license": "ISC" }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/sinon": { "version": "18.0.1", "resolved": "https://registry.npmjs.org/sinon/-/sinon-18.0.1.tgz", @@ -5348,6 +5976,76 @@ "dev": true, "license": "MIT" }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/string.prototype.trim": { "version": "1.2.10", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", @@ -5420,6 +6118,20 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -5479,6 +6191,42 @@ "node": ">=6" } }, + "node_modules/test-exclude": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz", + "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^9.0.4" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -5594,7 +6342,10 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" + "dev": true, + "license": "0BSD", + "optional": true, + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -6104,6 +6855,107 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index cce81d7b5f..b471822036 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,14 @@ { "name": "jira.js", - "version": "4.0.3", + "version": "5.0.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", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts", + "module": "dist/index.esm.js", "repository": "https://github.com/MrRefactoring/jira.js.git", "author": "Vladislav Tupikin ", "license": "MIT", + "type": "module", "keywords": [ "jira", "javascript", @@ -18,8 +20,14 @@ "client", "library" ], + "exports": { + ".": { + "require": "./dist/index.cjs.js", + "import": "./dist/index.esm.js" + } + }, "scripts": { - "build": "tsc", + "build": "rollup -c rollup.config.ts --configPlugin @rollup/plugin-typescript", "prettier": "prettier --write src", "lint": "npm run lint:tests && npm run lint:examples && npm run lint:src:agile && npm run lint:src:clients && npm run lint:src:services && npm run lint:src:version2 && npm run lint:src:version3 && npm run lint:src:files", "lint:tests": "npm run lint:base -- tests", @@ -36,7 +44,8 @@ "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:integration": "vitest run tests/integration --bail=1 --no-file-parallelism --max-concurrency 1 -c vitest.config.mts --hookTimeout 100000 --testTimeout 100000", + "test:unit:coverage": "npm run test:unit -- --coverage", + "test:integration": "vitest run tests/integration --bail=1 --no-file-parallelism --max-concurrency 1 -c vitest.config.mjs --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", "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'", @@ -53,10 +62,15 @@ "code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix" }, "devDependencies": { + "@rollup/plugin-alias": "^5.1.1", + "@rollup/plugin-commonjs": "^28.0.2", + "@rollup/plugin-node-resolve": "^16.0.0", + "@rollup/plugin-typescript": "^12.1.2", "@types/node": "^18.19.69", "@types/sinon": "^17.0.3", "@typescript-eslint/eslint-plugin": "^8.19.0", "@typescript-eslint/parser": "^8.19.0", + "@vitest/coverage-v8": "^2.1.8", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", @@ -64,6 +78,7 @@ "eslint-plugin-import": "^2.31.0", "prettier": "^3.4.2", "prettier-plugin-jsdoc": "^1.3.0", + "rollup": "^4.29.1", "sinon": "^18.0.1", "typedoc": "^0.27.6", "typescript": "^5.7.2", @@ -72,7 +87,6 @@ }, "dependencies": { "axios": "^1.7.9", - "form-data": "^4.0.1", - "tslib": "^2.8.1" + "formdata-node": "^6.0.3" } } diff --git a/rollup.config.ts b/rollup.config.ts new file mode 100644 index 0000000000..d605747acf --- /dev/null +++ b/rollup.config.ts @@ -0,0 +1,37 @@ +import alias from '@rollup/plugin-alias'; +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import typescript from '@rollup/plugin-typescript'; +import { defineConfig } from 'rollup'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +export default defineConfig({ + input: 'src/index.mts', + output: [ + { file: 'dist/index.cjs.js', format: 'cjs', sourcemap: true }, + { file: 'dist/index.esm.js', format: 'esm', sourcemap: true }, + ], + plugins: [ + alias({ + entries: [ + { find: '@', replacement: join(__dirname, 'src') }, + ], + }), + resolve({ + preferBuiltins: true, + }), + commonjs(), + typescript({ + tsconfig: './tsconfig.json', + }), + ], + external: [ + 'axios', + 'tslib', + 'form-data' + ], // todo +}); diff --git a/src/agile/backlog.mts b/src/agile/backlog.mts new file mode 100644 index 0000000000..47728b7881 --- /dev/null +++ b/src/agile/backlog.mts @@ -0,0 +1,73 @@ +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '@/clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Backlog { + constructor(private client: Client) {} + + /** + * Move issues to the backlog.\ + * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may + * be moved at once. + */ + async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback: Callback): Promise; + /** + * Move issues to the backlog.\ + * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may + * be moved at once. + */ + async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback?: never): Promise; + async moveIssuesToBacklog( + parameters: Parameters.MoveIssuesToBacklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/backlog/issue', + method: 'POST', + data: { + issues: parameters.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. + */ + async moveIssuesToBacklogForBoard( + parameters: Parameters.MoveIssuesToBacklogForBoard, + callback: Callback, + ): Promise; + /** + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. + */ + async moveIssuesToBacklogForBoard( + parameters: Parameters.MoveIssuesToBacklogForBoard, + callback?: never, + ): Promise; + async moveIssuesToBacklogForBoard( + parameters: Parameters.MoveIssuesToBacklogForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/backlog/${parameters.boardId}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/backlog.ts b/src/agile/backlog.ts deleted file mode 100644 index d596232039..0000000000 --- a/src/agile/backlog.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Backlog { - constructor(private client: Client) {} - - /** - * Move issues to the backlog.\ - * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may - * be moved at once. - */ - async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback: Callback): Promise; - /** - * Move issues to the backlog.\ - * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may - * be moved at once. - */ - async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback?: never): Promise; - async moveIssuesToBacklog( - parameters: Parameters.MoveIssuesToBacklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/backlog/issue', - method: 'POST', - data: { - issues: parameters.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Move issues to the backlog of a particular board (if they are already on that board).\ - * This operation is equivalent to remove future and active sprints from a given set of issues if the board has - * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most - * 50 issues may be moved at once. - */ - async moveIssuesToBacklogForBoard( - parameters: Parameters.MoveIssuesToBacklogForBoard, - callback: Callback, - ): Promise; - /** - * Move issues to the backlog of a particular board (if they are already on that board).\ - * This operation is equivalent to remove future and active sprints from a given set of issues if the board has - * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most - * 50 issues may be moved at once. - */ - async moveIssuesToBacklogForBoard( - parameters: Parameters.MoveIssuesToBacklogForBoard, - callback?: never, - ): Promise; - async moveIssuesToBacklogForBoard( - parameters: Parameters.MoveIssuesToBacklogForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/backlog/${parameters.boardId}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/board.mts b/src/agile/board.mts new file mode 100644 index 0000000000..edf5f0450f --- /dev/null +++ b/src/agile/board.mts @@ -0,0 +1,872 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Paginated } from '@/paginated.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Board { + constructor(private client: Client) {} + + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ + async getAllBoards( + parameters: Parameters.GetAllBoards | undefined, + callback: Callback, + ): Promise; + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ + async getAllBoards(parameters?: Parameters.GetAllBoards, callback?: never): Promise; + async getAllBoards( + parameters?: Parameters.GetAllBoards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/board', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + type: parameters?.type, + name: parameters?.name, + projectKeyOrId: parameters?.projectKeyOrId, + accountIdLocation: parameters?.accountIdLocation, + projectLocation: parameters?.projectLocation, + includePrivate: parameters?.includePrivate, + negateLocationFiltering: parameters?.negateLocationFiltering, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + projectTypeLocation: parameters?.projectTypeLocation, + filterId: parameters?.filterId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new board. Board name, type and filter ID is required. + * + * - `name` - Must be less than 255 characters. + * - `type` - Valid values: scrum, kanban + * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create + * shared objects' permission and tries to create a shared board, a private board will be created instead (remember + * that board sharing depends on the filter sharing). + * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid + * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in + * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not + * be provided. + * + * Note: + * + * - If you want to create a new project with an associated board, use the [Jira platform REST + * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create + * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and + * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or + * `com.pyxis.greenhopper.jira:gh-scrum-template`. + * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more + * information, see the [Create filter](#api-rest-api-3-filter-post) method. + * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the + * board. + */ + async createBoard(parameters: Parameters.CreateBoard, callback: Callback): Promise; + /** + * Creates a new board. Board name, type and filter ID is required. + * + * - `name` - Must be less than 255 characters. + * - `type` - Valid values: scrum, kanban + * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create + * shared objects' permission and tries to create a shared board, a private board will be created instead (remember + * that board sharing depends on the filter sharing). + * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid + * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in + * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not + * be provided. + * + * Note: + * + * - If you want to create a new project with an associated board, use the [Jira platform REST + * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create + * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and + * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or + * `com.pyxis.greenhopper.jira:gh-scrum-template`. + * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more + * information, see the [Create filter](#api-rest-api-3-filter-post) method. + * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the + * board. + */ + async createBoard(parameters: Parameters.CreateBoard, callback?: never): Promise; + async createBoard( + parameters: Parameters.CreateBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/board', + method: 'POST', + data: { + filterId: parameters.filterId, + location: parameters.location, + name: parameters.name, + type: parameters.type, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns any boards which use the provided filter id. This method can be executed by users without a valid software + * license in order to find which boards are using a particular filter. + */ + async getBoardByFilterId( + parameters: Parameters.GetBoardByFilterId, + callback: Callback, + ): Promise; + /** + * Returns any boards which use the provided filter id. This method can be executed by users without a valid software + * license in order to find which boards are using a particular filter. + */ + async getBoardByFilterId( + parameters: Parameters.GetBoardByFilterId, + callback?: never, + ): Promise; + async getBoardByFilterId( + parameters: Parameters.GetBoardByFilterId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/filter/${parameters.filterId}`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. + * Admins without the view permission will see the board as a private one, so will see only a subset of the board's + * data (board location for instance). + */ + async getBoard(parameters: Parameters.GetBoard, callback: Callback): Promise; + /** + * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. + * Admins without the view permission will see the board as a private one, so will see only a subset of the board's + * data (board location for instance). + */ + async getBoard(parameters: Parameters.GetBoard, callback?: never): Promise; + async getBoard(parameters: Parameters.GetBoard, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Deletes the board. Admin without the view permission can still remove the board. */ + async deleteBoard(parameters: Parameters.DeleteBoard, callback: Callback): Promise; + /** Deletes the board. Admin without the view permission can still remove the board. */ + async deleteBoard(parameters: Parameters.DeleteBoard, callback?: never): Promise; + async deleteBoard(parameters: Parameters.DeleteBoard, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has + * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. + * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned + * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned + * issues are ordered by rank. + */ + async getIssuesForBacklog( + parameters: Parameters.GetIssuesForBacklog, + callback: Callback, + ): Promise; + /** + * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has + * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. + * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned + * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned + * issues are ordered by rank. + */ + async getIssuesForBacklog( + parameters: Parameters.GetIssuesForBacklog, + callback?: never, + ): Promise; + async getIssuesForBacklog( + parameters: Parameters.GetIssuesForBacklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/backlog`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the board configuration. The response contains the following fields: + * + * - `id` - ID of the board. + * - `name` - Name of the board. + * - `filter` - Reference to the filter used by the given board. + * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: + * project, user). + * - `subQuery` (Kanban only) - Jql subquery used by the given board. + * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column + * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: + * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses + * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already + * completed. + * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, + * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is + * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, + * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order + * to update it "originalEstimate" in "timetracking" field should be updated. + * - `ranking` - Contains information about custom field used for ranking in the given board. + */ + async getConfiguration( + parameters: Parameters.GetConfiguration, + callback: Callback, + ): Promise; + /** + * Get the board configuration. The response contains the following fields: + * + * - `id` - ID of the board. + * - `name` - Name of the board. + * - `filter` - Reference to the filter used by the given board. + * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: + * project, user). + * - `subQuery` (Kanban only) - Jql subquery used by the given board. + * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column + * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: + * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses + * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already + * completed. + * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, + * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is + * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, + * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order + * to update it "originalEstimate" in "timetracking" field should be updated. + * - `ranking` - Contains information about custom field used for ranking in the given board. + */ + async getConfiguration( + parameters: Parameters.GetConfiguration, + callback?: never, + ): Promise; + async getConfiguration( + parameters: Parameters.GetConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/configuration`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to + * view. Note, if the user does not have permission to view the board, no epics will be returned at all. + */ + async getEpics>(parameters: Parameters.GetEpics, callback: Callback): Promise; + /** + * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to + * view. Note, if the user does not have permission to view the board, no epics will be returned at all. + */ + async getEpics>(parameters: Parameters.GetEpics, callback?: never): Promise; + async getEpics>( + parameters: Parameters.GetEpics, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/epic`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + done: parameters.done, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that + * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getIssuesWithoutEpicForBoard( + parameters: Parameters.GetIssuesWithoutEpicForBoard, + callback: Callback, + ): Promise; + /** + * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that + * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getIssuesWithoutEpicForBoard( + parameters: Parameters.GetIssuesWithoutEpicForBoard, + callback?: never, + ): Promise; + async getIssuesWithoutEpicForBoard( + parameters: Parameters.GetIssuesWithoutEpicForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/epic/none/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes + * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getBoardIssuesForEpic( + parameters: Parameters.GetBoardIssuesForEpic, + callback: Callback, + ): Promise; + /** + * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes + * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, + * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. + */ + async getBoardIssuesForEpic( + parameters: Parameters.GetBoardIssuesForEpic, + callback?: never, + ): Promise; + async getBoardIssuesForEpic( + parameters: Parameters.GetBoardIssuesForEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/epic/${parameters.epicId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + async getFeaturesForBoard( + parameters: Parameters.GetFeaturesForBoard, + callback: Callback, + ): Promise; + async getFeaturesForBoard( + parameters: Parameters.GetFeaturesForBoard, + callback?: never, + ): Promise; + async getFeaturesForBoard( + parameters: Parameters.GetFeaturesForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/features`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + async toggleFeatures( + parameters: Parameters.ToggleFeatures, + callback: Callback, + ): Promise; + async toggleFeatures(parameters: Parameters.ToggleFeatures, callback?: never): Promise; + async toggleFeatures( + parameters: Parameters.ToggleFeatures, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/features`, + method: 'PUT', + data: parameters.body, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to + * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to + * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. + */ + async getIssuesForBoard( + parameters: Parameters.GetIssuesForBoard, + callback: Callback, + ): Promise; + /** + * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to + * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to + * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. + */ + async getIssuesForBoard( + parameters: Parameters.GetIssuesForBoard, + callback?: never, + ): Promise; + async getIssuesForBoard( + parameters: Parameters.GetIssuesForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. + */ + async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback: Callback): Promise; + /** + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. + */ + async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback?: never): Promise; + async moveIssuesToBoard( + parameters: Parameters.MoveIssuesToBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all projects that are associated with the board, for the given board ID. If the user does not have + * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project or there is an issue from + * the project that belongs to the board. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + * + * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the + * scrum boards. + */ + async getProjects>( + parameters: Parameters.GetProjects, + callback: Callback, + ): Promise; + /** + * Returns all projects that are associated with the board, for the given board ID. If the user does not have + * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project or there is an issue from + * the project that belongs to the board. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + * + * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the + * scrum boards. + */ + async getProjects>(parameters: Parameters.GetProjects, callback?: never): Promise; + async getProjects>( + parameters: Parameters.GetProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/project`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are + * ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + */ + async getProjectsFull( + parameters: Parameters.GetProjectsFull, + callback: Callback, + ): Promise; + /** + * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are + * ordered by the name. + * + * A project is associated with a board if the board filter contains reference the project. + * + * The board filter contains reference the project only if Jql query guarantees that returned issues will be returned + * from the project set defined in Jql. For instance the query `project in (ABC, BCD) AND reporter = admin` have + * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to + * any project. + */ + async getProjectsFull(parameters: Parameters.GetProjectsFull, callback?: never): Promise; + async getProjectsFull( + parameters: Parameters.GetProjectsFull, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/project/full`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is + * required to have permissions to view the board. + */ + async getBoardPropertyKeys( + parameters: Parameters.GetBoardPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is + * required to have permissions to view the board. + */ + async getBoardPropertyKeys(parameters: Parameters.GetBoardPropertyKeys, callback?: never): Promise; + async getBoardPropertyKeys( + parameters: Parameters.GetBoardPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of the property with a given key from the board identified by the provided id. The user who + * retrieves the property is required to have permissions to view the board. + */ + async getBoardProperty(parameters: Parameters.GetBoardProperty, callback: Callback): Promise; + /** + * Returns the value of the property with a given key from the board identified by the provided id. The user who + * retrieves the property is required to have permissions to view the board. + */ + async getBoardProperty(parameters: Parameters.GetBoardProperty, callback?: never): Promise; + async getBoardProperty( + parameters: Parameters.GetBoardProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the specified board's property. + * + * You can use this resource to store a custom data against the board identified by the id. The user who stores the + * data is required to have permissions to modify the board. + */ + async setBoardProperty(parameters: Parameters.SetBoardProperty, callback: Callback): Promise; + /** + * Sets the value of the specified board's property. + * + * You can use this resource to store a custom data against the board identified by the id. The user who stores the + * data is required to have permissions to modify the board. + */ + async setBoardProperty(parameters: Parameters.SetBoardProperty, callback?: never): Promise; + async setBoardProperty( + parameters: Parameters.SetBoardProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes the property from the board identified by the id. Ths user removing the property is required to have + * permissions to modify the board. + */ + async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback: Callback): Promise; + /** + * Removes the property from the board identified by the id. Ths user removing the property is required to have + * permissions to modify the board. + */ + async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback?: never): Promise; + async deleteBoardProperty( + parameters: Parameters.DeleteBoardProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns all quick filters from a board, for a given board ID. */ + async getAllQuickFilters( + parameters: Parameters.GetAllQuickFilters, + callback: Callback, + ): Promise; + /** Returns all quick filters from a board, for a given board ID. */ + async getAllQuickFilters( + parameters: Parameters.GetAllQuickFilters, + callback?: never, + ): Promise; + async getAllQuickFilters( + parameters: Parameters.GetAllQuickFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view + * the board that the quick filter belongs to. + */ + async getQuickFilter( + parameters: Parameters.GetQuickFilter, + callback: Callback, + ): Promise; + /** + * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view + * the board that the quick filter belongs to. + */ + async getQuickFilter(parameters: Parameters.GetQuickFilter, callback?: never): Promise; + async getQuickFilter( + parameters: Parameters.GetQuickFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter/${parameters.quickFilterId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + async getReportsForBoard( + parameters: Parameters.GetReportsForBoard, + callback: Callback, + ): Promise; + async getReportsForBoard( + parameters: Parameters.GetReportsForBoard, + callback?: never, + ): Promise; + async getReportsForBoard( + parameters: Parameters.GetReportsForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/reports`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to + * view. + */ + async getAllSprints>( + parameters: Parameters.GetAllSprints, + callback: Callback, + ): Promise; + /** + * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to + * view. + */ + async getAllSprints>(parameters: Parameters.GetAllSprints, callback?: never): Promise; + async getAllSprints>( + parameters: Parameters.GetAllSprints, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/sprint`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource + * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. Jql + * order has higher priority than default rank. + */ + async getBoardIssuesForSprint( + parameters: Parameters.GetBoardIssuesForSprint, + callback: Callback, + ): Promise; + /** + * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource + * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. Jql + * order has higher priority than default rank. + */ + async getBoardIssuesForSprint( + parameters: Parameters.GetBoardIssuesForSprint, + callback?: never, + ): Promise; + async getBoardIssuesForSprint( + parameters: Parameters.GetBoardIssuesForSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/sprint/${parameters.sprintId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission + * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. + * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by + * user. + */ + async getAllVersions>( + parameters: Parameters.GetAllVersions, + callback: Callback, + ): Promise; + /** + * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission + * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. + * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by + * user. + */ + async getAllVersions>( + parameters: Parameters.GetAllVersions, + callback?: never, + ): Promise; + async getAllVersions>( + parameters: Parameters.GetAllVersions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/board/${parameters.boardId}/version`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + released: parameters.released, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/board.ts b/src/agile/board.ts deleted file mode 100644 index e6dbd3a395..0000000000 --- a/src/agile/board.ts +++ /dev/null @@ -1,872 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { Paginated } from '../paginated'; -import { RequestConfig } from '../requestConfig'; - -export class Board { - constructor(private client: Client) {} - - /** - * Returns all boards. This only includes boards that the user has permission to view. - * - * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. - * - * - `read:board-scope:jira-software`, `read:project:jira` - */ - async getAllBoards( - parameters: Parameters.GetAllBoards | undefined, - callback: Callback, - ): Promise; - /** - * Returns all boards. This only includes boards that the user has permission to view. - * - * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. - * - * - `read:board-scope:jira-software`, `read:project:jira` - */ - async getAllBoards(parameters?: Parameters.GetAllBoards, callback?: never): Promise; - async getAllBoards( - parameters?: Parameters.GetAllBoards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/board', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - name: parameters?.name, - projectKeyOrId: parameters?.projectKeyOrId, - accountIdLocation: parameters?.accountIdLocation, - projectLocation: parameters?.projectLocation, - includePrivate: parameters?.includePrivate, - negateLocationFiltering: parameters?.negateLocationFiltering, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - projectTypeLocation: parameters?.projectTypeLocation, - filterId: parameters?.filterId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new board. Board name, type and filter ID is required. - * - * - `name` - Must be less than 255 characters. - * - `type` - Valid values: scrum, kanban - * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create - * shared objects' permission and tries to create a shared board, a private board will be created instead (remember - * that board sharing depends on the filter sharing). - * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid - * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in - * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not - * be provided. - * - * Note: - * - * - If you want to create a new project with an associated board, use the [Jira platform REST - * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create - * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and - * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or - * `com.pyxis.greenhopper.jira:gh-scrum-template`. - * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more - * information, see the [Create filter](#api-rest-api-3-filter-post) method. - * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the - * board. - */ - async createBoard(parameters: Parameters.CreateBoard, callback: Callback): Promise; - /** - * Creates a new board. Board name, type and filter ID is required. - * - * - `name` - Must be less than 255 characters. - * - `type` - Valid values: scrum, kanban - * - `filterId` - ID of a filter that the user has permissions to view. Note, if the user does not have the 'Create - * shared objects' permission and tries to create a shared board, a private board will be created instead (remember - * that board sharing depends on the filter sharing). - * - `location` - The container that the board will be located in. `location` must include the `type` property (Valid - * values: project, user). If choosing 'project', then a project must be specified by a `projectKeyOrId` property in - * `location`. If choosing 'user', the current user is chosen by default. The `projectKeyOrId` property should not - * be provided. - * - * Note: - * - * - If you want to create a new project with an associated board, use the [Jira platform REST - * API](https://docs.atlassian.com/jira/REST/latest). For more information, see the [Create - * project](#api-rest-api-3-project-post) method. The `projectTypeKey` for software boards must be 'software' and - * the `projectTemplateKey` must be either `com.pyxis.greenhopper.jira:gh-kanban-template` or - * `com.pyxis.greenhopper.jira:gh-scrum-template`. - * - You can create a filter using the [Jira REST API](https://docs.atlassian.com/jira/REST/latest). For more - * information, see the [Create filter](#api-rest-api-3-filter-post) method. - * - If you do not ORDER BY the Rank field for the filter of your board, you will not be able to reorder issues on the - * board. - */ - async createBoard(parameters: Parameters.CreateBoard, callback?: never): Promise; - async createBoard( - parameters: Parameters.CreateBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/board', - method: 'POST', - data: { - filterId: parameters.filterId, - location: parameters.location, - name: parameters.name, - type: parameters.type, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns any boards which use the provided filter id. This method can be executed by users without a valid software - * license in order to find which boards are using a particular filter. - */ - async getBoardByFilterId( - parameters: Parameters.GetBoardByFilterId, - callback: Callback, - ): Promise; - /** - * Returns any boards which use the provided filter id. This method can be executed by users without a valid software - * license in order to find which boards are using a particular filter. - */ - async getBoardByFilterId( - parameters: Parameters.GetBoardByFilterId, - callback?: never, - ): Promise; - async getBoardByFilterId( - parameters: Parameters.GetBoardByFilterId, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/filter/${parameters.filterId}`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. - * Admins without the view permission will see the board as a private one, so will see only a subset of the board's - * data (board location for instance). - */ - async getBoard(parameters: Parameters.GetBoard, callback: Callback): Promise; - /** - * Returns the board for the given board ID. This board will only be returned if the user has permission to view it. - * Admins without the view permission will see the board as a private one, so will see only a subset of the board's - * data (board location for instance). - */ - async getBoard(parameters: Parameters.GetBoard, callback?: never): Promise; - async getBoard(parameters: Parameters.GetBoard, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Deletes the board. Admin without the view permission can still remove the board. */ - async deleteBoard(parameters: Parameters.DeleteBoard, callback: Callback): Promise; - /** Deletes the board. Admin without the view permission can still remove the board. */ - async deleteBoard(parameters: Parameters.DeleteBoard, callback?: never): Promise; - async deleteBoard(parameters: Parameters.DeleteBoard, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has - * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. - * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned - * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned - * issues are ordered by rank. - */ - async getIssuesForBacklog( - parameters: Parameters.GetIssuesForBacklog, - callback: Callback, - ): Promise; - /** - * Returns all issues from the board's backlog, for the given board ID. This only includes issues that the user has - * permission to view. The backlog contains incomplete issues that are not assigned to any future or active sprint. - * Note, if the user does not have permission to view the board, no issues will be returned at all. Issues returned - * from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, the returned - * issues are ordered by rank. - */ - async getIssuesForBacklog( - parameters: Parameters.GetIssuesForBacklog, - callback?: never, - ): Promise; - async getIssuesForBacklog( - parameters: Parameters.GetIssuesForBacklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/backlog`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the board configuration. The response contains the following fields: - * - * - `id` - ID of the board. - * - `name` - Name of the board. - * - `filter` - Reference to the filter used by the given board. - * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: - * project, user). - * - `subQuery` (Kanban only) - JQL subquery used by the given board. - * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column - * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: - * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses - * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already - * completed. - * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, - * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is - * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, - * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order - * to update it "originalEstimate" in "timetracking" field should be updated. - * - `ranking` - Contains information about custom field used for ranking in the given board. - */ - async getConfiguration( - parameters: Parameters.GetConfiguration, - callback: Callback, - ): Promise; - /** - * Get the board configuration. The response contains the following fields: - * - * - `id` - ID of the board. - * - `name` - Name of the board. - * - `filter` - Reference to the filter used by the given board. - * - `location` - Reference to the container that the board is located in. Includes the container type (Valid values: - * project, user). - * - `subQuery` (Kanban only) - JQL subquery used by the given board. - * - `columnConfig` - The column configuration lists the columns for the board, in the order defined in the column - * configuration. For each column, it shows the issue status mapping as well as the constraint type (Valid values: - * none, issueCount, issueCountExclSubs) for the min/max number of issues. Note, the last column with statuses - * mapped to it is treated as the "Done" column, which means that issues in that column will be marked as already - * completed. - * - `estimation` (Scrum only) - Contains information about type of estimation used for the board. Valid values: none, - * issueCount, field. If the estimation type is "field", the ID and display name of the field used for estimation is - * also returned. Note, estimates for an issue can be updated by a PUT /rest/api/3/issue/{issueIdOrKey} request, - * however the fields must be on the screen. "timeoriginalestimate" field will never be on the screen, so in order - * to update it "originalEstimate" in "timetracking" field should be updated. - * - `ranking` - Contains information about custom field used for ranking in the given board. - */ - async getConfiguration( - parameters: Parameters.GetConfiguration, - callback?: never, - ): Promise; - async getConfiguration( - parameters: Parameters.GetConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/configuration`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to - * view. Note, if the user does not have permission to view the board, no epics will be returned at all. - */ - async getEpics>(parameters: Parameters.GetEpics, callback: Callback): Promise; - /** - * Returns all epics from the board, for the given board ID. This only includes epics that the user has permission to - * view. Note, if the user does not have permission to view the board, no epics will be returned at all. - */ - async getEpics>(parameters: Parameters.GetEpics, callback?: never): Promise; - async getEpics>( - parameters: Parameters.GetEpics, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/epic`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - done: parameters.done, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that - * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getIssuesWithoutEpicForBoard( - parameters: Parameters.GetIssuesWithoutEpicForBoard, - callback: Callback, - ): Promise; - /** - * Returns all issues that do not belong to any epic on a board, for a given board ID. This only includes issues that - * the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getIssuesWithoutEpicForBoard( - parameters: Parameters.GetIssuesWithoutEpicForBoard, - callback?: never, - ): Promise; - async getIssuesWithoutEpicForBoard( - parameters: Parameters.GetIssuesWithoutEpicForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/epic/none/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes - * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getBoardIssuesForEpic( - parameters: Parameters.GetBoardIssuesForEpic, - callback: Callback, - ): Promise; - /** - * Returns all issues that belong to an epic on the board, for the given epic ID and the board ID. This only includes - * issues that the user has permission to view. Issues returned from this resource include Agile fields, like sprint, - * closedSprints, flagged, and epic. By default, the returned issues are ordered by rank. - */ - async getBoardIssuesForEpic( - parameters: Parameters.GetBoardIssuesForEpic, - callback?: never, - ): Promise; - async getBoardIssuesForEpic( - parameters: Parameters.GetBoardIssuesForEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/epic/${parameters.epicId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - async getFeaturesForBoard( - parameters: Parameters.GetFeaturesForBoard, - callback: Callback, - ): Promise; - async getFeaturesForBoard( - parameters: Parameters.GetFeaturesForBoard, - callback?: never, - ): Promise; - async getFeaturesForBoard( - parameters: Parameters.GetFeaturesForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/features`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - async toggleFeatures( - parameters: Parameters.ToggleFeatures, - callback: Callback, - ): Promise; - async toggleFeatures(parameters: Parameters.ToggleFeatures, callback?: never): Promise; - async toggleFeatures( - parameters: Parameters.ToggleFeatures, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/features`, - method: 'PUT', - data: parameters.body, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to - * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to - * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. - */ - async getIssuesForBoard( - parameters: Parameters.GetIssuesForBoard, - callback: Callback, - ): Promise; - /** - * Returns all issues from a board, for a given board ID. This only includes issues that the user has permission to - * view. An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to - * the scrum boards. Note, if the user does not have permission to view the board, no issues will be returned at all. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. - */ - async getIssuesForBoard( - parameters: Parameters.GetIssuesForBoard, - callback?: never, - ): Promise; - async getIssuesForBoard( - parameters: Parameters.GetIssuesForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Move issues from the backlog to the board (if they are already in the backlog of that board).\ - * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) - * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at - * once. - */ - async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback: Callback): Promise; - /** - * Move issues from the backlog to the board (if they are already in the backlog of that board).\ - * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) - * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at - * once. - */ - async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback?: never): Promise; - async moveIssuesToBoard( - parameters: Parameters.MoveIssuesToBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all projects that are associated with the board, for the given board ID. If the user does not have - * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project or there is an issue from - * the project that belongs to the board. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - * - * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the - * scrum boards. - */ - async getProjects>( - parameters: Parameters.GetProjects, - callback: Callback, - ): Promise; - /** - * Returns all projects that are associated with the board, for the given board ID. If the user does not have - * permission to view the board, no projects will be returned at all. Returned projects are ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project or there is an issue from - * the project that belongs to the board. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - * - * An issue belongs to the board if its status is mapped to the board's column. Epic issues do not belongs to the - * scrum boards. - */ - async getProjects>(parameters: Parameters.GetProjects, callback?: never): Promise; - async getProjects>( - parameters: Parameters.GetProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/project`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are - * ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - */ - async getProjectsFull( - parameters: Parameters.GetProjectsFull, - callback: Callback, - ): Promise; - /** - * Returns all projects that are statically associated with the board, for the given board ID. Returned projects are - * ordered by the name. - * - * A project is associated with a board if the board filter contains reference the project. - * - * The board filter contains reference the project only if JQL query guarantees that returned issues will be returned - * from the project set defined in JQL. For instance the query `project in (ABC, BCD) AND reporter = admin` have - * reference to ABC and BCD projects but query `project in (ABC, BCD) OR reporter = admin` doesn't have reference to - * any project. - */ - async getProjectsFull(parameters: Parameters.GetProjectsFull, callback?: never): Promise; - async getProjectsFull( - parameters: Parameters.GetProjectsFull, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/project/full`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is - * required to have permissions to view the board. - */ - async getBoardPropertyKeys( - parameters: Parameters.GetBoardPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for the board identified by the id. The user who retrieves the property keys is - * required to have permissions to view the board. - */ - async getBoardPropertyKeys(parameters: Parameters.GetBoardPropertyKeys, callback?: never): Promise; - async getBoardPropertyKeys( - parameters: Parameters.GetBoardPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of the property with a given key from the board identified by the provided id. The user who - * retrieves the property is required to have permissions to view the board. - */ - async getBoardProperty(parameters: Parameters.GetBoardProperty, callback: Callback): Promise; - /** - * Returns the value of the property with a given key from the board identified by the provided id. The user who - * retrieves the property is required to have permissions to view the board. - */ - async getBoardProperty(parameters: Parameters.GetBoardProperty, callback?: never): Promise; - async getBoardProperty( - parameters: Parameters.GetBoardProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the specified board's property. - * - * You can use this resource to store a custom data against the board identified by the id. The user who stores the - * data is required to have permissions to modify the board. - */ - async setBoardProperty(parameters: Parameters.SetBoardProperty, callback: Callback): Promise; - /** - * Sets the value of the specified board's property. - * - * You can use this resource to store a custom data against the board identified by the id. The user who stores the - * data is required to have permissions to modify the board. - */ - async setBoardProperty(parameters: Parameters.SetBoardProperty, callback?: never): Promise; - async setBoardProperty( - parameters: Parameters.SetBoardProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes the property from the board identified by the id. Ths user removing the property is required to have - * permissions to modify the board. - */ - async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback: Callback): Promise; - /** - * Removes the property from the board identified by the id. Ths user removing the property is required to have - * permissions to modify the board. - */ - async deleteBoardProperty(parameters: Parameters.DeleteBoardProperty, callback?: never): Promise; - async deleteBoardProperty( - parameters: Parameters.DeleteBoardProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** Returns all quick filters from a board, for a given board ID. */ - async getAllQuickFilters( - parameters: Parameters.GetAllQuickFilters, - callback: Callback, - ): Promise; - /** Returns all quick filters from a board, for a given board ID. */ - async getAllQuickFilters( - parameters: Parameters.GetAllQuickFilters, - callback?: never, - ): Promise; - async getAllQuickFilters( - parameters: Parameters.GetAllQuickFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view - * the board that the quick filter belongs to. - */ - async getQuickFilter( - parameters: Parameters.GetQuickFilter, - callback: Callback, - ): Promise; - /** - * Returns the quick filter for a given quick filter ID. The quick filter will only be returned if the user can view - * the board that the quick filter belongs to. - */ - async getQuickFilter(parameters: Parameters.GetQuickFilter, callback?: never): Promise; - async getQuickFilter( - parameters: Parameters.GetQuickFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/quickfilter/${parameters.quickFilterId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - async getReportsForBoard( - parameters: Parameters.GetReportsForBoard, - callback: Callback, - ): Promise; - async getReportsForBoard( - parameters: Parameters.GetReportsForBoard, - callback?: never, - ): Promise; - async getReportsForBoard( - parameters: Parameters.GetReportsForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/reports`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to - * view. - */ - async getAllSprints>( - parameters: Parameters.GetAllSprints, - callback: Callback, - ): Promise; - /** - * Returns all sprints from a board, for a given board ID. This only includes sprints that the user has permission to - * view. - */ - async getAllSprints>(parameters: Parameters.GetAllSprints, callback?: never): Promise; - async getAllSprints>( - parameters: Parameters.GetAllSprints, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/sprint`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource - * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. JQL - * order has higher priority than default rank. - */ - async getBoardIssuesForSprint( - parameters: Parameters.GetBoardIssuesForSprint, - callback: Callback, - ): Promise; - /** - * Get all issues you have access to that belong to the sprint from the board. Issue returned from this resource - * contains additional fields like: sprint, closedSprints, flagged and epic. Issues are returned ordered by rank. JQL - * order has higher priority than default rank. - */ - async getBoardIssuesForSprint( - parameters: Parameters.GetBoardIssuesForSprint, - callback?: never, - ): Promise; - async getBoardIssuesForSprint( - parameters: Parameters.GetBoardIssuesForSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/sprint/${parameters.sprintId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission - * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. - * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by - * user. - */ - async getAllVersions>( - parameters: Parameters.GetAllVersions, - callback: Callback, - ): Promise; - /** - * Returns all versions from a board, for a given board ID. This only includes versions that the user has permission - * to view. Note, if the user does not have permission to view the board, no versions will be returned at all. - * Returned versions are ordered by the name of the project from which they belong and then by sequence defined by - * user. - */ - async getAllVersions>( - parameters: Parameters.GetAllVersions, - callback?: never, - ): Promise; - async getAllVersions>( - parameters: Parameters.GetAllVersions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/board/${parameters.boardId}/version`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - released: parameters.released, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/builds.mts b/src/agile/builds.mts new file mode 100644 index 0000000000..14dbb67e4e --- /dev/null +++ b/src/agile/builds.mts @@ -0,0 +1,190 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Builds { + constructor(private client: Client) {} + + /** + * Update / insert builds data. + * + * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same + * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming + * data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. + * Details of which build failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitBuilds( + parameters: Parameters.SubmitBuilds, + callback: Callback, + ): Promise; + /** + * Update / insert builds data. + * + * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same + * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming + * data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. + * Details of which build failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitBuilds(parameters: Parameters.SubmitBuilds, callback?: never): Promise; + async submitBuilds( + parameters: Parameters.SubmitBuilds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/builds/0.1/bulk', + method: 'POST', + data: { + properties: parameters.properties, + builds: parameters.builds, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all builds data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitBuilds` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildsByProperty( + parameters: Parameters.DeleteBuildsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all builds data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitBuilds` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildsByProperty( + parameters: Parameters.DeleteBuildsByProperty, + callback?: never, + ): Promise; + async deleteBuildsByProperty( + parameters: Parameters.DeleteBuildsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/builds/0.1/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getBuildByKey( + parameters: Parameters.GetBuildByKey, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getBuildByKey(parameters: Parameters.GetBuildByKey, callback?: never): Promise; + async getBuildByKey( + parameters: Parameters.GetBuildByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback: Callback): Promise; + /** + * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. + * + * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback?: never): Promise; + async deleteBuildByKey( + parameters: Parameters.DeleteBuildByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/builds.ts b/src/agile/builds.ts deleted file mode 100644 index 87bdecbb5c..0000000000 --- a/src/agile/builds.ts +++ /dev/null @@ -1,190 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Builds { - constructor(private client: Client) {} - - /** - * Update / insert builds data. - * - * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same - * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming - * data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. - * Details of which build failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitBuilds( - parameters: Parameters.SubmitBuilds, - callback: Callback, - ): Promise; - /** - * Update / insert builds data. - * - * Builds are identified by the combination of `pipelineId` and `buildNumber`, and existing build data for the same - * build will be replaced if it exists and the `updateSequenceNumber` of the existing data is less than the incoming - * data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getBuildByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple builds being submitted in one request, each is validated individually prior to submission. - * Details of which build failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitBuilds(parameters: Parameters.SubmitBuilds, callback?: never): Promise; - async submitBuilds( - parameters: Parameters.SubmitBuilds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/builds/0.1/bulk', - method: 'POST', - data: { - properties: parameters.properties, - builds: parameters.builds, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all builds data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitBuilds` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildsByProperty( - parameters: Parameters.DeleteBuildsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all builds data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitBuilds` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildsByProperty( - parameters: Parameters.DeleteBuildsByProperty, - callback?: never, - ): Promise; - async deleteBuildsByProperty( - parameters: Parameters.DeleteBuildsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/builds/0.1/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getBuildByKey( - parameters: Parameters.GetBuildByKey, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored build data for the given `pipelineId` and `buildNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getBuildByKey(parameters: Parameters.GetBuildByKey, callback?: never): Promise; - async getBuildByKey( - parameters: Parameters.GetBuildByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback: Callback): Promise; - /** - * Delete the build data currently stored for the given `pipelineId` and `buildNumber` combination. - * - * Deletion is performed asynchronously. The `getBuildByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraBuildInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteBuildByKey(parameters: Parameters.DeleteBuildByKey, callback?: never): Promise; - async deleteBuildByKey( - parameters: Parameters.DeleteBuildByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/builds/0.1/pipelines/${parameters.pipelineId}/builds/${parameters.buildNumber}`, - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/client/agileClient.mts b/src/agile/client/agileClient.mts new file mode 100644 index 0000000000..36a329b015 --- /dev/null +++ b/src/agile/client/agileClient.mts @@ -0,0 +1,30 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { Backlog } from '@/agile/backlog.mjs'; +import { Board } from '@/agile/board.mjs'; +import { Builds } from '@/agile/builds.mjs'; +import { Deployments } from '@/agile/deployments.mjs'; +import { DevelopmentInformation } from '@/agile/developmentInformation.mjs'; +import { DevopsComponents } from '@/agile/devopsComponents.mjs'; +import { Epic } from '@/agile/epic.mjs'; +import { FeatureFlags } from '@/agile/featureFlags.mjs'; +import { Issue } from '@/agile/issue.mjs'; +import { Operations } from '@/agile/operations.mjs'; +import { RemoteLinks } from '@/agile/remoteLinks.mjs'; +import { SecurityInformation } from '@/agile/securityInformation.mjs'; +import { Sprint } from '@/agile/sprint.mjs'; + +export class AgileClient extends BaseClient { + backlog = new Backlog(this); + board = new Board(this); + builds = new Builds(this); + deployments = new Deployments(this); + developmentInformation = new DevelopmentInformation(this); + devopsComponents = new DevopsComponents(this); + epic = new Epic(this); + featureFlags = new FeatureFlags(this); + issue = new Issue(this); + operations = new Operations(this); + remoteLinks = new RemoteLinks(this); + securityInformation = new SecurityInformation(this); + sprint = new Sprint(this); +} diff --git a/src/agile/client/agileClient.ts b/src/agile/client/agileClient.ts deleted file mode 100644 index 7f98f186ac..0000000000 --- a/src/agile/client/agileClient.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { BaseClient } from '../../clients'; -import { - Backlog, - Board, - Builds, - Deployments, - DevelopmentInformation, - DevopsComponents, - Epic, - FeatureFlags, - Issue, - Operations, - RemoteLinks, - SecurityInformation, - Sprint, -} from '..'; - -export class AgileClient extends BaseClient { - backlog = new Backlog(this); - board = new Board(this); - builds = new Builds(this); - deployments = new Deployments(this); - developmentInformation = new DevelopmentInformation(this); - devopsComponents = new DevopsComponents(this); - epic = new Epic(this); - featureFlags = new FeatureFlags(this); - issue = new Issue(this); - operations = new Operations(this); - remoteLinks = new RemoteLinks(this); - securityInformation = new SecurityInformation(this); - sprint = new Sprint(this); -} diff --git a/src/agile/client/index.ts b/src/agile/client/index.ts deleted file mode 100644 index 124423f7e7..0000000000 --- a/src/agile/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './agileClient'; diff --git a/src/agile/deployments.mts b/src/agile/deployments.mts new file mode 100644 index 0000000000..d93505cb95 --- /dev/null +++ b/src/agile/deployments.mts @@ -0,0 +1,231 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Deployments { + constructor(private client: Client) {} + + /** + * Update / insert deployment data. + * + * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and + * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of + * existing data is less than the incoming data. + * + * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple deployments being submitted in one request, each is validated individually prior to + * submission. Details of which deployments failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitDeployments( + parameters: Parameters.SubmitDeployments, + callback: Callback, + ): Promise; + /** + * Update / insert deployment data. + * + * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and + * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of + * existing data is less than the incoming data. + * + * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple deployments being submitted in one request, each is validated individually prior to + * submission. Details of which deployments failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'WRITE' scope for Connect apps. + */ + async submitDeployments( + parameters: Parameters.SubmitDeployments, + callback?: never, + ): Promise; + async submitDeployments( + parameters: Parameters.SubmitDeployments, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/deployments/0.1/bulk', + method: 'POST', + data: { + properties: parameters.properties, + deployments: parameters.deployments, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all deployments that match the given request. + * + * One or more query params must be supplied to specify the Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation + * for more details. + * + * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentsByProperty( + parameters: Parameters.DeleteDeploymentsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all deployments that match the given request. + * + * One or more query params must be supplied to specify the Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation + * for more details. + * + * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentsByProperty( + parameters: Parameters.DeleteDeploymentsByProperty, + callback?: never, + ): Promise; + async deleteDeploymentsByProperty( + parameters: Parameters.DeleteDeploymentsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/deployments/0.1/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getDeploymentByKey( + parameters: Parameters.GetDeploymentByKey, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getDeploymentByKey( + parameters: Parameters.GetDeploymentByKey, + callback?: never, + ): Promise; + async getDeploymentByKey( + parameters: Parameters.GetDeploymentByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentByKey( + parameters: Parameters.DeleteDeploymentByKey, + callback: Callback, + ): Promise; + /** + * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and + * `deploymentSequenceNumber` combination. + * + * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteDeploymentByKey(parameters: Parameters.DeleteDeploymentByKey, callback?: never): Promise; + async deleteDeploymentByKey( + parameters: Parameters.DeleteDeploymentByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` + * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource + * requires the 'READ' scope. + */ + async getDeploymentGatingStatusByKey( + parameters: Parameters.GetDeploymentGatingStatusByKey, + callback: Callback, + ): Promise; + /** + * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` + * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource + * requires the 'READ' scope. + */ + async getDeploymentGatingStatusByKey( + parameters: Parameters.GetDeploymentGatingStatusByKey, + callback?: never, + ): Promise; + async getDeploymentGatingStatusByKey( + parameters: Parameters.GetDeploymentGatingStatusByKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}/gating-status`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/deployments.ts b/src/agile/deployments.ts deleted file mode 100644 index ef7d7a309c..0000000000 --- a/src/agile/deployments.ts +++ /dev/null @@ -1,231 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Deployments { - constructor(private client: Client) {} - - /** - * Update / insert deployment data. - * - * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and - * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of - * existing data is less than the incoming data. - * - * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple deployments being submitted in one request, each is validated individually prior to - * submission. Details of which deployments failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitDeployments( - parameters: Parameters.SubmitDeployments, - callback: Callback, - ): Promise; - /** - * Update / insert deployment data. - * - * Deployments are identified by the combination of `pipelineId`, `environmentId` and `deploymentSequenceNumber`, and - * existing deployment data for the same deployment will be replaced if it exists and the `updateSequenceNumber` of - * existing data is less than the incoming data. - * - * Submissions are processed asynchronously. Submitted data will eventually be available in Jira. Most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getDeploymentByKey` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple deployments being submitted in one request, each is validated individually prior to - * submission. Details of which deployments failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'WRITE' scope for Connect apps. - */ - async submitDeployments( - parameters: Parameters.SubmitDeployments, - callback?: never, - ): Promise; - async submitDeployments( - parameters: Parameters.SubmitDeployments, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/deployments/0.1/bulk', - method: 'POST', - data: { - properties: parameters.properties, - deployments: parameters.deployments, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all deployments that match the given request. - * - * One or more query params must be supplied to specify the Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation - * for more details. - * - * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentsByProperty( - parameters: Parameters.DeleteDeploymentsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all deployments that match the given request. - * - * One or more query params must be supplied to specify the Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (i.e. treated as AND). See the documentation for the `submitDeployments` operation - * for more details. - * - * Example operation: DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentsByProperty( - parameters: Parameters.DeleteDeploymentsByProperty, - callback?: never, - ): Promise; - async deleteDeploymentsByProperty( - parameters: Parameters.DeleteDeploymentsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/deployments/0.1/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getDeploymentByKey( - parameters: Parameters.GetDeploymentByKey, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getDeploymentByKey( - parameters: Parameters.GetDeploymentByKey, - callback?: never, - ): Promise; - async getDeploymentByKey( - parameters: Parameters.GetDeploymentByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentByKey( - parameters: Parameters.DeleteDeploymentByKey, - callback: Callback, - ): Promise; - /** - * Delete the currently stored deployment data for the given `pipelineId`, `environmentId` and - * `deploymentSequenceNumber` combination. - * - * Deletion is performed asynchronously. The `getDeploymentByKey` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDeploymentInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteDeploymentByKey(parameters: Parameters.DeleteDeploymentByKey, callback?: never): Promise; - async deleteDeploymentByKey( - parameters: Parameters.DeleteDeploymentByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}`, - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` - * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource - * requires the 'READ' scope. - */ - async getDeploymentGatingStatusByKey( - parameters: Parameters.GetDeploymentGatingStatusByKey, - callback: Callback, - ): Promise; - /** - * Retrieve the Deployment gating status for the given `pipelineId + environmentId + deploymentSequenceNumber` - * combination. Only apps that define the `jiraDeploymentInfoProvider` module can access this resource. This resource - * requires the 'READ' scope. - */ - async getDeploymentGatingStatusByKey( - parameters: Parameters.GetDeploymentGatingStatusByKey, - callback?: never, - ): Promise; - async getDeploymentGatingStatusByKey( - parameters: Parameters.GetDeploymentGatingStatusByKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/deployments/0.1/pipelines/${parameters.pipelineId}/environments/${parameters.environmentId}/deployments/${parameters.deploymentSequenceNumber}/gating-status`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/developmentInformation.mts b/src/agile/developmentInformation.mts new file mode 100644 index 0000000000..0a184af687 --- /dev/null +++ b/src/agile/developmentInformation.mts @@ -0,0 +1,189 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DevelopmentInformation { + constructor(private client: Client) {} + + /** + * Stores development information provided in the request to make it available when viewing issues in Jira. Existing + * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than + * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; + * most updates are available within a short period of time, but may take some time during peak load and/or + * maintenance times. + */ + async storeDevelopmentInformation( + parameters: Parameters.StoreDevelopmentInformation, + callback: Callback, + ): Promise; + /** + * Stores development information provided in the request to make it available when viewing issues in Jira. Existing + * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than + * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; + * most updates are available within a short period of time, but may take some time during peak load and/or + * maintenance times. + */ + async storeDevelopmentInformation( + parameters: Parameters.StoreDevelopmentInformation, + callback?: never, + ): Promise; + async storeDevelopmentInformation( + parameters: Parameters.StoreDevelopmentInformation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devinfo/0.10/bulk', + method: 'POST', + data: { + repositories: parameters.repositories, + preventTransitions: parameters.preventTransitions, + operationType: parameters.operationType, + properties: parameters.properties, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. + * The result will be what is currently stored, ignoring any pending updates or deletes. + */ + async getRepository( + parameters: Parameters.GetRepository, + callback: Callback, + ): Promise; + /** + * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. + * The result will be what is currently stored, ignoring any pending updates or deletes. + */ + async getRepository(parameters: Parameters.GetRepository, callback?: never): Promise; + async getRepository( + parameters: Parameters.GetRepository, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the repository data stored by the given ID and all related development information entities. Deletion is + * performed asynchronously. + */ + async deleteRepository(parameters: Parameters.DeleteRepository, callback: Callback): Promise; + /** + * Deletes the repository data stored by the given ID and all related development information entities. Deletion is + * performed asynchronously. + */ + async deleteRepository(parameters: Parameters.DeleteRepository, callback?: never): Promise; + async deleteRepository( + parameters: Parameters.DeleteRepository, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE + * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. + */ + async deleteByProperties( + parameters: Parameters.DeleteByProperties, + callback: Callback, + ): Promise; + /** + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE + * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. + */ + async deleteByProperties(parameters: Parameters.DeleteByProperties, callback?: never): Promise; + async deleteByProperties( + parameters: Parameters.DeleteByProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devinfo/0.10/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the + * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. + */ + async existsByProperties( + parameters: Parameters.ExistsByProperties, + callback: Callback, + ): Promise; + /** + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the + * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. + */ + async existsByProperties( + parameters: Parameters.ExistsByProperties, + callback?: never, + ): Promise; + async existsByProperties( + parameters: Parameters.ExistsByProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devinfo/0.10/existsByProperties', + method: 'GET', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Deletes particular development information entity. Deletion is performed asynchronously. */ + async deleteEntity(parameters: Parameters.DeleteEntity, callback: Callback): Promise; + /** Deletes particular development information entity. Deletion is performed asynchronously. */ + async deleteEntity(parameters: Parameters.DeleteEntity, callback?: never): Promise; + async deleteEntity(parameters: Parameters.DeleteEntity, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}/${parameters.entityType}/${parameters.entityId}`, + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/developmentInformation.ts b/src/agile/developmentInformation.ts deleted file mode 100644 index 6522636350..0000000000 --- a/src/agile/developmentInformation.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class DevelopmentInformation { - constructor(private client: Client) {} - - /** - * Stores development information provided in the request to make it available when viewing issues in Jira. Existing - * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than - * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; - * most updates are available within a short period of time, but may take some time during peak load and/or - * maintenance times. - */ - async storeDevelopmentInformation( - parameters: Parameters.StoreDevelopmentInformation, - callback: Callback, - ): Promise; - /** - * Stores development information provided in the request to make it available when viewing issues in Jira. Existing - * repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than - * the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira; - * most updates are available within a short period of time, but may take some time during peak load and/or - * maintenance times. - */ - async storeDevelopmentInformation( - parameters: Parameters.StoreDevelopmentInformation, - callback?: never, - ): Promise; - async storeDevelopmentInformation( - parameters: Parameters.StoreDevelopmentInformation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devinfo/0.10/bulk', - method: 'POST', - data: { - repositories: parameters.repositories, - preventTransitions: parameters.preventTransitions, - operationType: parameters.operationType, - properties: parameters.properties, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. - * The result will be what is currently stored, ignoring any pending updates or deletes. - */ - async getRepository( - parameters: Parameters.GetRepository, - callback: Callback, - ): Promise; - /** - * For the specified repository ID, retrieves the repository and the most recent 400 development information entities. - * The result will be what is currently stored, ignoring any pending updates or deletes. - */ - async getRepository(parameters: Parameters.GetRepository, callback?: never): Promise; - async getRepository( - parameters: Parameters.GetRepository, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the repository data stored by the given ID and all related development information entities. Deletion is - * performed asynchronously. - */ - async deleteRepository(parameters: Parameters.DeleteRepository, callback: Callback): Promise; - /** - * Deletes the repository data stored by the given ID and all related development information entities. Deletion is - * performed asynchronously. - */ - async deleteRepository(parameters: Parameters.DeleteRepository, callback?: never): Promise; - async deleteRepository( - parameters: Parameters.DeleteRepository, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`, - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes development information entities which have all the provided properties. Repositories which have properties - * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as - * commits, branches and pull requests), will be deleted. For example if request is `DELETE - * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified - * entities will eventually be removed from Jira. - */ - async deleteByProperties( - parameters: Parameters.DeleteByProperties, - callback: Callback, - ): Promise; - /** - * Deletes development information entities which have all the provided properties. Repositories which have properties - * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as - * commits, branches and pull requests), will be deleted. For example if request is `DELETE - * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified - * entities will eventually be removed from Jira. - */ - async deleteByProperties(parameters: Parameters.DeleteByProperties, callback?: never): Promise; - async deleteByProperties( - parameters: Parameters.DeleteByProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devinfo/0.10/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks if repositories which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one - * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be - * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the - * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. - */ - async existsByProperties( - parameters: Parameters.ExistsByProperties, - callback: Callback, - ): Promise; - /** - * Checks if repositories which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one - * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be - * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the - * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. - */ - async existsByProperties( - parameters: Parameters.ExistsByProperties, - callback?: never, - ): Promise; - async existsByProperties( - parameters: Parameters.ExistsByProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devinfo/0.10/existsByProperties', - method: 'GET', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** Deletes particular development information entity. Deletion is performed asynchronously. */ - async deleteEntity(parameters: Parameters.DeleteEntity, callback: Callback): Promise; - /** Deletes particular development information entity. Deletion is performed asynchronously. */ - async deleteEntity(parameters: Parameters.DeleteEntity, callback?: never): Promise; - async deleteEntity(parameters: Parameters.DeleteEntity, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}/${parameters.entityType}/${parameters.entityId}`, - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/devopsComponents.mts b/src/agile/devopsComponents.mts new file mode 100644 index 0000000000..d755abe37c --- /dev/null +++ b/src/agile/devopsComponents.mts @@ -0,0 +1,189 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DevopsComponents { + constructor(private client: Client) {} + + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback: Callback, + ): Promise; + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: never, + ): Promise; + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulk', + method: 'POST', + data: { + properties: parameters.properties, + components: parameters.components, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: never, + ): Promise; + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: never, + ): Promise; + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback: Callback): Promise; + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback?: never): Promise; + async deleteComponentById( + parameters: Parameters.DeleteComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/devopsComponents.ts b/src/agile/devopsComponents.ts deleted file mode 100644 index b53e2e40c4..0000000000 --- a/src/agile/devopsComponents.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class DevopsComponents { - constructor(private client: Client) {} - - /** - * Update / insert DevOps Component data. - * - * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists - * and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getComponentById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Components being submitted in one request, each is validated individually prior to - * submission. Details of which Components failed submission (if any) are available in the response object. - * - * A maximum of 1000 components can be submitted in one request. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitComponents( - parameters: Parameters.SubmitComponents, - callback: Callback, - ): Promise; - /** - * Update / insert DevOps Component data. - * - * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists - * and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getComponentById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Components being submitted in one request, each is validated individually prior to - * submission. Details of which Components failed submission (if any) are available in the response object. - * - * A maximum of 1000 components can be submitted in one request. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitComponents( - parameters: Parameters.SubmitComponents, - callback?: never, - ): Promise; - async submitComponents( - parameters: Parameters.SubmitComponents, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devopscomponents/1.0/bulk', - method: 'POST', - data: { - properties: parameters.properties, - components: parameters.components, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Components that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitComponents operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentsByProperty( - parameters: Parameters.DeleteComponentsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Components that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitComponents operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentsByProperty( - parameters: Parameters.DeleteComponentsByProperty, - callback?: never, - ): Promise; - async deleteComponentsByProperty( - parameters: Parameters.DeleteComponentsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/devopscomponents/1.0/bulkByProperties', - method: 'DELETE', - params: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Component data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getComponentById( - parameters: Parameters.GetComponentById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Component data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getComponentById( - parameters: Parameters.GetComponentById, - callback?: never, - ): Promise; - async getComponentById( - parameters: Parameters.GetComponentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devopscomponents/1.0/${parameters.componentId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Component data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentById(parameters: Parameters.DeleteComponentById, callback: Callback): Promise; - /** - * Delete the Component data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteComponentById(parameters: Parameters.DeleteComponentById, callback?: never): Promise; - async deleteComponentById( - parameters: Parameters.DeleteComponentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/devopscomponents/1.0/${parameters.componentId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/epic.mts b/src/agile/epic.mts new file mode 100644 index 0000000000..7a47d2e962 --- /dev/null +++ b/src/agile/epic.mts @@ -0,0 +1,232 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Epic { + constructor(private client: Client) {} + + /** + * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this + * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent is empty` clause. For more information on the `parent` + * Jql field, see [Advanced + * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesWithoutEpic( + parameters: Parameters.GetIssuesWithoutEpic | undefined, + callback: Callback, + ): Promise; + /** + * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. + * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, + * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this + * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent is empty` clause. For more information on the `parent` + * Jql field, see [Advanced + * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesWithoutEpic(parameters?: Parameters.GetIssuesWithoutEpic, callback?: never): Promise; + async getIssuesWithoutEpic( + parameters?: Parameters.GetIssuesWithoutEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/epic/none/issue', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + jql: parameters?.jql, + validateQuery: parameters?.validateQuery, + fields: parameters?.fields, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from + * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not + * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` + */ + async removeIssuesFromEpic( + parameters: Parameters.RemoveIssuesFromEpic | undefined, + callback: Callback, + ): Promise; + /** + * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from + * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not + * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` + */ + async removeIssuesFromEpic(parameters?: Parameters.RemoveIssuesFromEpic, callback?: never): Promise; + async removeIssuesFromEpic( + parameters?: Parameters.RemoveIssuesFromEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/epic/none/issue', + method: 'POST', + data: { + issues: parameters?.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. + * **Note:** This operation does not work for epics in next-gen projects. + */ + async getEpic(parameters: Parameters.GetEpic, callback: Callback): Promise; + /** + * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. + * **Note:** This operation does not work for epics in next-gen projects. + */ + async getEpic(parameters: Parameters.GetEpic, callback?: never): Promise; + async getEpic(parameters: Parameters.GetEpic, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not + * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in + * next-gen projects. + */ + async partiallyUpdateEpic( + parameters: Parameters.PartiallyUpdateEpic, + callback: Callback, + ): Promise; + /** + * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not + * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in + * next-gen projects. + */ + async partiallyUpdateEpic(parameters: Parameters.PartiallyUpdateEpic, callback?: never): Promise; + async partiallyUpdateEpic( + parameters: Parameters.PartiallyUpdateEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, + method: 'POST', + data: { + color: parameters.color, + done: parameters.done, + name: parameters.name, + summary: parameters.summary, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has + * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, + * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do + * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent` clause. For more information on the `parent` Jql field, + * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback: Callback): Promise; + /** + * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has + * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, + * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do + * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using + * Jql](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira + * platform REST API. Build your Jql query using the `parent` clause. For more information on the `parent` Jql field, + * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). + */ + async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback?: never): Promise; + async getIssuesForEpic( + parameters: Parameters.GetIssuesForEpic, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that + * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the + * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be + * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. + */ + async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback: Callback): Promise; + /** + * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that + * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the + * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be + * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. + */ + async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: never): Promise; + async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves (ranks) an epic before or after a given epic. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + * + * **Note:** This operation does not work for epics in next-gen projects. + */ + async rankEpics(parameters: Parameters.RankEpics, callback: Callback): Promise; + /** + * Moves (ranks) an epic before or after a given epic. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + * + * **Note:** This operation does not work for epics in next-gen projects. + */ + async rankEpics(parameters: Parameters.RankEpics, callback?: never): Promise; + async rankEpics(parameters: Parameters.RankEpics, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/rank`, + method: 'PUT', + data: { + rankAfterEpic: parameters.rankAfterEpic, + rankBeforeEpic: parameters.rankBeforeEpic, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/epic.ts b/src/agile/epic.ts deleted file mode 100644 index 67305a777f..0000000000 --- a/src/agile/epic.ts +++ /dev/null @@ -1,232 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Epic { - constructor(private client: Client) {} - - /** - * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this - * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent is empty` clause. For more information on the `parent` - * JQL field, see [Advanced - * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesWithoutEpic( - parameters: Parameters.GetIssuesWithoutEpic | undefined, - callback: Callback, - ): Promise; - /** - * Returns all issues that do not belong to any epic. This only includes issues that the user has permission to view. - * Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, and epic. By default, - * the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do not use this - * operation. Instead, search for issues that don't belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent is empty` clause. For more information on the `parent` - * JQL field, see [Advanced - * searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesWithoutEpic(parameters?: Parameters.GetIssuesWithoutEpic, callback?: never): Promise; - async getIssuesWithoutEpic( - parameters?: Parameters.GetIssuesWithoutEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/epic/none/issue', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - jql: parameters?.jql, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from - * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not - * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` - */ - async removeIssuesFromEpic( - parameters: Parameters.RemoveIssuesFromEpic | undefined, - callback: Callback, - ): Promise; - /** - * Removes issues from epics. The user needs to have the edit issue permission for all issue they want to remove from - * epics. The maximum number of issues that can be moved in one operation is 50. **Note:** This operation does not - * work for epics in next-gen projects. Instead, update the issue using `\{ fields: \{ parent: \{\} \} \}` - */ - async removeIssuesFromEpic(parameters?: Parameters.RemoveIssuesFromEpic, callback?: never): Promise; - async removeIssuesFromEpic( - parameters?: Parameters.RemoveIssuesFromEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/epic/none/issue', - method: 'POST', - data: { - issues: parameters?.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. - * **Note:** This operation does not work for epics in next-gen projects. - */ - async getEpic(parameters: Parameters.GetEpic, callback: Callback): Promise; - /** - * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. - * **Note:** This operation does not work for epics in next-gen projects. - */ - async getEpic(parameters: Parameters.GetEpic, callback?: never): Promise; - async getEpic(parameters: Parameters.GetEpic, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not - * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in - * next-gen projects. - */ - async partiallyUpdateEpic( - parameters: Parameters.PartiallyUpdateEpic, - callback: Callback, - ): Promise; - /** - * Performs a partial update of the epic. A partial update means that fields not present in the request JSON will not - * be updated. Valid values for color are `color_1` to `color_9`. **Note:** This operation does not work for epics in - * next-gen projects. - */ - async partiallyUpdateEpic(parameters: Parameters.PartiallyUpdateEpic, callback?: never): Promise; - async partiallyUpdateEpic( - parameters: Parameters.PartiallyUpdateEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, - method: 'POST', - data: { - color: parameters.color, - done: parameters.done, - name: parameters.name, - summary: parameters.summary, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has - * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, - * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do - * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent` clause. For more information on the `parent` JQL field, - * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback: Callback): Promise; - /** - * Returns all issues that belong to the epic, for the given epic ID. This only includes issues that the user has - * permission to view. Issues returned from this resource include Agile fields, like sprint, closedSprints, flagged, - * and epic. By default, the returned issues are ordered by rank. **Note:** If you are querying a next-gen project, do - * not use this operation. Instead, search for issues that belong to an epic by using the [Search for issues using - * JQL](https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-search-get) operation in the Jira - * platform REST API. Build your JQL query using the `parent` clause. For more information on the `parent` JQL field, - * see [Advanced searching](https://confluence.atlassian.com/x/dAiiLQ#Advancedsearching-fieldsreference-Parent). - */ - async getIssuesForEpic(parameters: Parameters.GetIssuesForEpic, callback?: never): Promise; - async getIssuesForEpic( - parameters: Parameters.GetIssuesForEpic, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that - * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the - * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be - * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. - */ - async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback: Callback): Promise; - /** - * Moves issues to an epic, for a given epic id. Issues can be only in a single epic at the same time. That means that - * already assigned issues to an epic, will not be assigned to the previous epic anymore. The user needs to have the - * edit issue permission for all issue they want to move and to the epic. The maximum number of issues that can be - * moved in one operation is 50. **Note:** This operation does not work for epics in next-gen projects. - */ - async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: never): Promise; - async moveIssuesToEpic(parameters: Parameters.MoveIssuesToEpic, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves (ranks) an epic before or after a given epic. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - * - * **Note:** This operation does not work for epics in next-gen projects. - */ - async rankEpics(parameters: Parameters.RankEpics, callback: Callback): Promise; - /** - * Moves (ranks) an epic before or after a given epic. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - * - * **Note:** This operation does not work for epics in next-gen projects. - */ - async rankEpics(parameters: Parameters.RankEpics, callback?: never): Promise; - async rankEpics(parameters: Parameters.RankEpics, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/rank`, - method: 'PUT', - data: { - rankAfterEpic: parameters.rankAfterEpic, - rankBeforeEpic: parameters.rankBeforeEpic, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/featureFlags.mts b/src/agile/featureFlags.mts new file mode 100644 index 0000000000..3d5e5d4972 --- /dev/null +++ b/src/agile/featureFlags.mts @@ -0,0 +1,193 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class FeatureFlags { + constructor(private client: Client) {} + + /** + * Update / insert Feature Flag data. + * + * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it + * exists and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to + * submission. Details of which Feature Flags failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitFeatureFlags( + parameters: Parameters.SubmitFeatureFlags, + callback: Callback, + ): Promise; + /** + * Update / insert Feature Flag data. + * + * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it + * exists and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to + * submission. Details of which Feature Flags failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitFeatureFlags( + parameters: Parameters.SubmitFeatureFlags, + callback?: never, + ): Promise; + async submitFeatureFlags( + parameters: Parameters.SubmitFeatureFlags, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/featureflags/0.1/bulk', + method: 'POST', + data: { + properties: parameters.properties, + flags: parameters.flags, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Feature Flags that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is + * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties + * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagsByProperty( + parameters: Parameters.DeleteFeatureFlagsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Feature Flags that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is + * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties + * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagsByProperty( + parameters: Parameters.DeleteFeatureFlagsByProperty, + callback?: never, + ): Promise; + async deleteFeatureFlagsByProperty( + parameters: Parameters.DeleteFeatureFlagsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/featureflags/0.1/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Feature Flag data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getFeatureFlagById( + parameters: Parameters.GetFeatureFlagById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Feature Flag data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getFeatureFlagById( + parameters: Parameters.GetFeatureFlagById, + callback?: never, + ): Promise; + async getFeatureFlagById( + parameters: Parameters.GetFeatureFlagById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Feature Flag data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagById( + parameters: Parameters.DeleteFeatureFlagById, + callback: Callback, + ): Promise; + /** + * Delete the Feature Flag data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteFeatureFlagById(parameters: Parameters.DeleteFeatureFlagById, callback?: never): Promise; + async deleteFeatureFlagById( + parameters: Parameters.DeleteFeatureFlagById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, + method: 'DELETE', + params: { + _updateSequenceId: parameters.updateSequenceId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/featureFlags.ts b/src/agile/featureFlags.ts deleted file mode 100644 index 4b5494c6f0..0000000000 --- a/src/agile/featureFlags.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class FeatureFlags { - constructor(private client: Client) {} - - /** - * Update / insert Feature Flag data. - * - * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it - * exists and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to - * submission. Details of which Feature Flags failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitFeatureFlags( - parameters: Parameters.SubmitFeatureFlags, - callback: Callback, - ): Promise; - /** - * Update / insert Feature Flag data. - * - * Feature Flags are identified by their ID, and existing Feature Flag data for the same ID will be replaced if it - * exists and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getFeatureFlagById operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Feature Flags being submitted in one request, each is validated individually prior to - * submission. Details of which Feature Flags failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitFeatureFlags( - parameters: Parameters.SubmitFeatureFlags, - callback?: never, - ): Promise; - async submitFeatureFlags( - parameters: Parameters.SubmitFeatureFlags, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/featureflags/0.1/bulk', - method: 'POST', - data: { - properties: parameters.properties, - flags: parameters.flags, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Feature Flags that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is - * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties - * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagsByProperty( - parameters: Parameters.DeleteFeatureFlagsByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Feature Flags that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param `_updateSequenceId` is - * no longer supported. If more than one Property is provided, data will be deleted that matches ALL of the Properties - * (e.g. treated as an AND). See the documentation for the submitFeatureFlags operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagsByProperty( - parameters: Parameters.DeleteFeatureFlagsByProperty, - callback?: never, - ): Promise; - async deleteFeatureFlagsByProperty( - parameters: Parameters.DeleteFeatureFlagsByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/featureflags/0.1/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Feature Flag data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getFeatureFlagById( - parameters: Parameters.GetFeatureFlagById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Feature Flag data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getFeatureFlagById( - parameters: Parameters.GetFeatureFlagById, - callback?: never, - ): Promise; - async getFeatureFlagById( - parameters: Parameters.GetFeatureFlagById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Feature Flag data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagById( - parameters: Parameters.DeleteFeatureFlagById, - callback: Callback, - ): Promise; - /** - * Delete the Feature Flag data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getFeatureFlagById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraFeatureFlagInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteFeatureFlagById(parameters: Parameters.DeleteFeatureFlagById, callback?: never): Promise; - async deleteFeatureFlagById( - parameters: Parameters.DeleteFeatureFlagById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/featureflags/0.1/flag/${parameters.featureFlagId}`, - method: 'DELETE', - params: { - _updateSequenceId: parameters.updateSequenceId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/index.mts b/src/agile/index.mts new file mode 100644 index 0000000000..23649722e5 --- /dev/null +++ b/src/agile/index.mts @@ -0,0 +1,17 @@ +export * from './backlog.mjs'; +export * from './board.mjs'; +export * from './builds.mjs'; +export * from './deployments.mjs'; +export * from './developmentInformation.mjs'; +export * from './devopsComponents.mjs'; +export * from './epic.mjs'; +export * from './featureFlags.mjs'; +export * from './issue.mjs'; +export * from './operations.mjs'; +export * from './remoteLinks.mjs'; +export * from './securityInformation.mjs'; +export * from './sprint.mjs'; + +export * as AgileModels from './models/index.mjs'; +export * as AgileParameters from './parameters/index.mjs'; +export * from './client/agileClient.mjs'; diff --git a/src/agile/index.ts b/src/agile/index.ts deleted file mode 100644 index 435eec8955..0000000000 --- a/src/agile/index.ts +++ /dev/null @@ -1,17 +0,0 @@ -export * from './backlog'; -export * from './board'; -export * from './builds'; -export * from './deployments'; -export * from './developmentInformation'; -export * from './devopsComponents'; -export * from './epic'; -export * from './featureFlags'; -export * from './issue'; -export * from './operations'; -export * from './remoteLinks'; -export * from './securityInformation'; -export * from './sprint'; - -export * as AgileModels from './models'; -export * as AgileParameters from './parameters'; -export * from './client'; diff --git a/src/agile/issue.mts b/src/agile/issue.mts new file mode 100644 index 0000000000..9441778dfd --- /dev/null +++ b/src/agile/issue.mts @@ -0,0 +1,160 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Issue { + constructor(private client: Client) {} + + /** + * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. + * + * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned + * for the whole response and detailed information regarding each issue is available in the response body. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + */ + async rankIssues(parameters: Parameters.RankIssues, callback: Callback): Promise; + /** + * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. + * + * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned + * for the whole response and detailed information regarding each issue is available in the response body. + * + * If rankCustomFieldId is not defined, the default rank field will be used. + */ + async rankIssues(parameters: Parameters.RankIssues, callback?: never): Promise; + async rankIssues(parameters: Parameters.RankIssues, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/issue/rank', + method: 'PUT', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, + * like sprint, closedSprints, flagged, and epic. + */ + async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; + /** + * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, + * like sprint, closedSprints, flagged, and epic. + */ + async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; + async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}`, + method: 'GET', + params: { + fields: parameters.fields, + expand: parameters.expand, + updateHistory: parameters.updateHistory, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. + * This param determines which field will be updated on a issue. + * + * Original time internally stores and returns the estimation as a number of seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). + */ + async getIssueEstimationForBoard( + parameters: Parameters.GetIssueEstimationForBoard, + callback: Callback, + ): Promise; + /** + * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. + * This param determines which field will be updated on a issue. + * + * Original time internally stores and returns the estimation as a number of seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). + */ + async getIssueEstimationForBoard( + parameters: Parameters.GetIssueEstimationForBoard, + callback?: never, + ): Promise; + async getIssueEstimationForBoard( + parameters: Parameters.GetIssueEstimationForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, + method: 'GET', + params: { + boardId: parameters.boardId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated + * on an issue. + * + * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. + * + * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which + * represent number of minutes. However, internally the field stores and returns the estimation as a number of + * seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). + */ + async estimateIssueForBoard( + parameters: Parameters.EstimateIssueForBoard, + callback: Callback, + ): Promise; + /** + * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated + * on an issue. + * + * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. + * + * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which + * represent number of minutes. However, internally the field stores and returns the estimation as a number of + * seconds. + * + * The field used for estimation on the given board can be obtained from [board configuration + * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta + * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). + */ + async estimateIssueForBoard(parameters: Parameters.EstimateIssueForBoard, callback?: never): Promise; + async estimateIssueForBoard( + parameters: Parameters.EstimateIssueForBoard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, + method: 'PUT', + params: { + boardId: parameters.boardId, + }, + data: { + value: parameters.value, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/issue.ts b/src/agile/issue.ts deleted file mode 100644 index 15e224d421..0000000000 --- a/src/agile/issue.ts +++ /dev/null @@ -1,160 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Issue { - constructor(private client: Client) {} - - /** - * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. - * - * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned - * for the whole response and detailed information regarding each issue is available in the response body. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - */ - async rankIssues(parameters: Parameters.RankIssues, callback: Callback): Promise; - /** - * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. - * - * This operation may fail for some issues, although this will be rare. In that case the 207 status code is returned - * for the whole response and detailed information regarding each issue is available in the response body. - * - * If rankCustomFieldId is not defined, the default rank field will be used. - */ - async rankIssues(parameters: Parameters.RankIssues, callback?: never): Promise; - async rankIssues(parameters: Parameters.RankIssues, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/issue/rank', - method: 'PUT', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, - * like sprint, closedSprints, flagged, and epic. - */ - async getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; - /** - * Returns a single issue, for a given issue ID or issue key. Issues returned from this resource include Agile fields, - * like sprint, closedSprints, flagged, and epic. - */ - async getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; - async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}`, - method: 'GET', - params: { - fields: parameters.fields, - expand: parameters.expand, - updateHistory: parameters.updateHistory, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. - * This param determines which field will be updated on a issue. - * - * Original time internally stores and returns the estimation as a number of seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). - */ - async getIssueEstimationForBoard( - parameters: Parameters.GetIssueEstimationForBoard, - callback: Callback, - ): Promise; - /** - * Returns the estimation of the issue and a fieldId of the field that is used for it. `boardId` param is required. - * This param determines which field will be updated on a issue. - * - * Original time internally stores and returns the estimation as a number of seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-getEditIssueMeta) or [field resource](#api-rest-api-3-field-get). - */ - async getIssueEstimationForBoard( - parameters: Parameters.GetIssueEstimationForBoard, - callback?: never, - ): Promise; - async getIssueEstimationForBoard( - parameters: Parameters.GetIssueEstimationForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, - method: 'GET', - params: { - boardId: parameters.boardId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated - * on an issue. - * - * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. - * - * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which - * represent number of minutes. However, internally the field stores and returns the estimation as a number of - * seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). - */ - async estimateIssueForBoard( - parameters: Parameters.EstimateIssueForBoard, - callback: Callback, - ): Promise; - /** - * Updates the estimation of the issue. boardId param is required. This param determines which field will be updated - * on an issue. - * - * Note that this resource changes the estimation field of the issue regardless of appearance the field on the screen. - * - * Original time tracking estimation field accepts estimation in formats like "1w", "2d", "3h", "20m" or number which - * represent number of minutes. However, internally the field stores and returns the estimation as a number of - * seconds. - * - * The field used for estimation on the given board can be obtained from [board configuration - * resource](#agile/1.0/board-getConfiguration). More information about the field are returned by [edit meta - * resource](#api-rest-api-3-issue-issueIdOrKey-editmeta-get) or [field resource](#api-rest-api-3-field-get). - */ - async estimateIssueForBoard(parameters: Parameters.EstimateIssueForBoard, callback?: never): Promise; - async estimateIssueForBoard( - parameters: Parameters.EstimateIssueForBoard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/issue/${parameters.issueIdOrKey}/estimation`, - method: 'PUT', - params: { - boardId: parameters.boardId, - }, - data: { - value: parameters.value, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/models/avatarUrls.ts b/src/agile/models/avatarUrls.mts similarity index 100% rename from src/agile/models/avatarUrls.ts rename to src/agile/models/avatarUrls.mts diff --git a/src/agile/models/board.mts b/src/agile/models/board.mts new file mode 100644 index 0000000000..d9d6438778 --- /dev/null +++ b/src/agile/models/board.mts @@ -0,0 +1,52 @@ +import { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a board. */ +export interface Board { + /** The users and groups who own the board. */ + admins?: { + groups?: { + name?: string; + self?: string; + }[]; + users?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ + self?: string; + }[]; + }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; + /** The container that the board is located in. */ + location?: { + avatarURI?: string; + displayName?: string; + name?: string; + projectId?: number; + projectKey?: string; + projectName?: string; + projectTypeKey?: string; + userAccountId?: string; + userId?: number; + }; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; +} diff --git a/src/agile/models/board.ts b/src/agile/models/board.ts deleted file mode 100644 index 96fc1d4a46..0000000000 --- a/src/agile/models/board.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** Details about a board. */ -export interface Board { - /** The users and groups who own the board. */ - admins?: { - groups?: { - name?: string; - self?: string; - }[]; - users?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The URL of the user. */ - self?: string; - }[]; - }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; - /** The ID of the board. */ - id?: number; - /** Whether the board is private. */ - isPrivate?: boolean; - /** The container that the board is located in. */ - location?: { - avatarURI?: string; - displayName?: string; - name?: string; - projectId?: number; - projectKey?: string; - projectName?: string; - projectTypeKey?: string; - userAccountId?: string; - userId?: number; - }; - /** The name of the board. */ - name?: string; - /** The URL of the board. */ - self?: string; - /** The type the board. */ - type?: string; -} diff --git a/src/agile/models/createBoard.mts b/src/agile/models/createBoard.mts new file mode 100644 index 0000000000..39bece3cab --- /dev/null +++ b/src/agile/models/createBoard.mts @@ -0,0 +1,52 @@ +import { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a board. */ +export interface CreateBoard { + /** The users and groups who own the board. */ + admins?: { + groups?: { + name?: string; + self?: string; + }[]; + users?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ + self?: string; + }[]; + }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; + /** The container that the board is located in. */ + location?: { + avatarURI?: string; + displayName?: string; + name?: string; + projectId?: number; + projectKey?: string; + projectName?: string; + projectTypeKey?: string; + userAccountId?: string; + userId?: number; + }; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; +} diff --git a/src/agile/models/createBoard.ts b/src/agile/models/createBoard.ts deleted file mode 100644 index a506fd0d0d..0000000000 --- a/src/agile/models/createBoard.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** Details about a board. */ -export interface CreateBoard { - /** The users and groups who own the board. */ - admins?: { - groups?: { - name?: string; - self?: string; - }[]; - users?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The URL of the user. */ - self?: string; - }[]; - }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; - /** The ID of the board. */ - id?: number; - /** Whether the board is private. */ - isPrivate?: boolean; - /** The container that the board is located in. */ - location?: { - avatarURI?: string; - displayName?: string; - name?: string; - projectId?: number; - projectKey?: string; - projectName?: string; - projectTypeKey?: string; - userAccountId?: string; - userId?: number; - }; - /** The name of the board. */ - name?: string; - /** The URL of the board. */ - self?: string; - /** The type the board. */ - type?: string; -} diff --git a/src/agile/models/epic.ts b/src/agile/models/epic.mts similarity index 100% rename from src/agile/models/epic.ts rename to src/agile/models/epic.mts diff --git a/src/agile/models/existsByProperties.ts b/src/agile/models/existsByProperties.mts similarity index 100% rename from src/agile/models/existsByProperties.ts rename to src/agile/models/existsByProperties.mts diff --git a/src/agile/models/fields.mts b/src/agile/models/fields.mts new file mode 100644 index 0000000000..c57facb2cf --- /dev/null +++ b/src/agile/models/fields.mts @@ -0,0 +1,85 @@ +import { Attachment } from '@/version3/models/index.mjs'; // todo why? +import { Epic } from './epic.mjs'; +import type { FixVersion } from './fixVersion.mjs'; +import type { Issue } from './issue.mjs'; +import { IssueType } from './issueType.mjs'; +import { Progress } from './progress.mjs'; +import type { Project } from './project.mjs'; +import { Sprint } from './sprint.mjs'; +import type { Status } from './status.mjs'; +import { User } from './user.mjs'; +import type { Version } from './version.mjs'; +import { + Comment, + IssueLink, + Priority, + ProjectComponent, + Resolution, + RichText, + TimeTrackingDetails, + Votes, + Watchers, + Worklog, +} from '@/version2/models/index.mjs'; + +export interface Fields { + [key: string]: any; + + aggregateprogress: Progress; + aggregatetimeestimate: number | null; + aggregatetimeoriginalestimate: number | null; + aggregatetimespent: number | null; + assignee: User; + attachment: Attachment[]; + comment: { + comments: Comment[]; + self: string; + maxResults: number; + total: number; + startAt: number; + }; + components: ProjectComponent[]; + created: string; + creator: User; + description: string | null; + duedate: string | null; + environment: RichText | null; + epic: Epic | null; + fixVersions: FixVersion[]; + flagged: boolean; + issuelinks: IssueLink[]; + issuerestriction: { + issuerestrictions: any; + shouldDisplay: boolean; + }; + issuetype: IssueType; + labels: string[]; + lastViewed: string | null; + priority: Priority; + progress: Progress; + project: Project; + reporter: User; + resolution: Resolution | null; + resolutiondate: string | null; + security: any | null; + sprint: Sprint; + status: Status; + statuscategorychangedate: string; + subtasks: Issue[]; + summary: string; + timeestimate: number | null; + timeoriginalestimate: any | null; + timespent: number | null; + timetracking: TimeTrackingDetails; + updated: string; + versions: Version[]; + votes: Votes; + watches: Watchers; + worklog: { + startAt: number; + maxResults: number; + total: number; + worklogs: Worklog[]; + }; + workratio: number; +} diff --git a/src/agile/models/fields.ts b/src/agile/models/fields.ts deleted file mode 100644 index 28742d48ad..0000000000 --- a/src/agile/models/fields.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Attachment } from '../../version3/models'; -import { Epic } from './epic'; -import { FixVersion } from './fixVersion'; -import { Issue } from './issue'; -import { IssueType } from './issueType'; -import { Progress } from './progress'; -import { Project } from './project'; -import { Sprint } from './sprint'; -import { Status } from './status'; -import { User } from './user'; -import { Version } from './version'; -import { - Comment, - IssueLink, - Priority, - ProjectComponent, - Resolution, - RichText, - TimeTrackingDetails, - Votes, - Watchers, - Worklog, -} from '../../version2/models'; - -export interface Fields { - [key: string]: any; - - aggregateprogress: Progress; - aggregatetimeestimate: number | null; - aggregatetimeoriginalestimate: number | null; - aggregatetimespent: number | null; - assignee: User; - attachment: Attachment[]; - comment: { - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - components: ProjectComponent[]; - created: string; - creator: User; - description: string | null; - duedate: string | null; - environment: RichText | null; - epic: Epic | null; - fixVersions: FixVersion[]; - flagged: boolean; - issuelinks: IssueLink[]; - issuerestriction: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - issuetype: IssueType; - labels: string[]; - lastViewed: string | null; - priority: Priority; - progress: Progress; - project: Project; - reporter: User; - resolution: Resolution | null; - resolutiondate: string | null; - security: any | null; - sprint: Sprint; - status: Status; - statuscategorychangedate: string; - subtasks: Issue[]; - summary: string; - timeestimate: number | null; - timeoriginalestimate: any | null; - timespent: number | null; - timetracking: TimeTrackingDetails; - updated: string; - versions: Version[]; - votes: Votes; - watches: Watchers; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - workratio: number; -} diff --git a/src/agile/models/fixVersion.ts b/src/agile/models/fixVersion.mts similarity index 100% rename from src/agile/models/fixVersion.ts rename to src/agile/models/fixVersion.mts diff --git a/src/agile/models/getAllBoards.mts b/src/agile/models/getAllBoards.mts new file mode 100644 index 0000000000..c71fb9ee1b --- /dev/null +++ b/src/agile/models/getAllBoards.mts @@ -0,0 +1,9 @@ +import { Board } from './board.mjs'; + +export interface GetAllBoards { + isLast?: boolean; + maxResults?: number; + startAt?: number; + total?: number; + values: Board[]; +} diff --git a/src/agile/models/getAllBoards.ts b/src/agile/models/getAllBoards.ts deleted file mode 100644 index 0b49271ec2..0000000000 --- a/src/agile/models/getAllBoards.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Board } from './board'; - -export interface GetAllBoards { - isLast?: boolean; - maxResults?: number; - startAt?: number; - total?: number; - values: Board[]; -} diff --git a/src/agile/models/getAllQuickFilters.ts b/src/agile/models/getAllQuickFilters.mts similarity index 100% rename from src/agile/models/getAllQuickFilters.ts rename to src/agile/models/getAllQuickFilters.mts diff --git a/src/agile/models/getBoard.mts b/src/agile/models/getBoard.mts new file mode 100644 index 0000000000..219c381f38 --- /dev/null +++ b/src/agile/models/getBoard.mts @@ -0,0 +1,52 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a board. */ +export interface GetBoard { + /** The users and groups who own the board. */ + admins?: { + groups?: { + name?: string; + self?: string; + }[]; + users?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ + self?: string; + }[]; + }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; + /** The container that the board is located in. */ + location?: { + avatarURI?: string; + displayName?: string; + name?: string; + projectId?: number; + projectKey?: string; + projectName?: string; + projectTypeKey?: string; + userAccountId?: string; + userId?: number; + }; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; +} diff --git a/src/agile/models/getBoard.ts b/src/agile/models/getBoard.ts deleted file mode 100644 index e53bd87b66..0000000000 --- a/src/agile/models/getBoard.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** Details about a board. */ -export interface GetBoard { - /** The users and groups who own the board. */ - admins?: { - groups?: { - name?: string; - self?: string; - }[]; - users?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The URL of the user. */ - self?: string; - }[]; - }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; - /** The ID of the board. */ - id?: number; - /** Whether the board is private. */ - isPrivate?: boolean; - /** The container that the board is located in. */ - location?: { - avatarURI?: string; - displayName?: string; - name?: string; - projectId?: number; - projectKey?: string; - projectName?: string; - projectTypeKey?: string; - userAccountId?: string; - userId?: number; - }; - /** The name of the board. */ - name?: string; - /** The URL of the board. */ - self?: string; - /** The type the board. */ - type?: string; -} diff --git a/src/agile/models/getBoardByFilterId.ts b/src/agile/models/getBoardByFilterId.mts similarity index 100% rename from src/agile/models/getBoardByFilterId.ts rename to src/agile/models/getBoardByFilterId.mts diff --git a/src/agile/models/getBuildByKey.ts b/src/agile/models/getBuildByKey.mts similarity index 100% rename from src/agile/models/getBuildByKey.ts rename to src/agile/models/getBuildByKey.mts diff --git a/src/agile/models/getComponentById.ts b/src/agile/models/getComponentById.mts similarity index 100% rename from src/agile/models/getComponentById.ts rename to src/agile/models/getComponentById.mts diff --git a/src/agile/models/getConfiguration.ts b/src/agile/models/getConfiguration.mts similarity index 100% rename from src/agile/models/getConfiguration.ts rename to src/agile/models/getConfiguration.mts diff --git a/src/agile/models/getDeploymentByKey.ts b/src/agile/models/getDeploymentByKey.mts similarity index 100% rename from src/agile/models/getDeploymentByKey.ts rename to src/agile/models/getDeploymentByKey.mts diff --git a/src/agile/models/getDeploymentGatingStatusByKey.ts b/src/agile/models/getDeploymentGatingStatusByKey.mts similarity index 100% rename from src/agile/models/getDeploymentGatingStatusByKey.ts rename to src/agile/models/getDeploymentGatingStatusByKey.mts diff --git a/src/agile/models/getFeatureFlagById.ts b/src/agile/models/getFeatureFlagById.mts similarity index 100% rename from src/agile/models/getFeatureFlagById.ts rename to src/agile/models/getFeatureFlagById.mts diff --git a/src/agile/models/getFeaturesForBoard.ts b/src/agile/models/getFeaturesForBoard.mts similarity index 100% rename from src/agile/models/getFeaturesForBoard.ts rename to src/agile/models/getFeaturesForBoard.mts diff --git a/src/agile/models/getIncidentById.ts b/src/agile/models/getIncidentById.mts similarity index 100% rename from src/agile/models/getIncidentById.ts rename to src/agile/models/getIncidentById.mts diff --git a/src/agile/models/getLinkedWorkspaceById.ts b/src/agile/models/getLinkedWorkspaceById.mts similarity index 100% rename from src/agile/models/getLinkedWorkspaceById.ts rename to src/agile/models/getLinkedWorkspaceById.mts diff --git a/src/agile/models/getLinkedWorkspaces.ts b/src/agile/models/getLinkedWorkspaces.mts similarity index 100% rename from src/agile/models/getLinkedWorkspaces.ts rename to src/agile/models/getLinkedWorkspaces.mts diff --git a/src/agile/models/getQuickFilter.ts b/src/agile/models/getQuickFilter.mts similarity index 100% rename from src/agile/models/getQuickFilter.ts rename to src/agile/models/getQuickFilter.mts diff --git a/src/agile/models/getRemoteLinkById.ts b/src/agile/models/getRemoteLinkById.mts similarity index 100% rename from src/agile/models/getRemoteLinkById.ts rename to src/agile/models/getRemoteLinkById.mts diff --git a/src/agile/models/getReportsForBoard.ts b/src/agile/models/getReportsForBoard.mts similarity index 100% rename from src/agile/models/getReportsForBoard.ts rename to src/agile/models/getReportsForBoard.mts diff --git a/src/agile/models/getRepository.ts b/src/agile/models/getRepository.mts similarity index 100% rename from src/agile/models/getRepository.ts rename to src/agile/models/getRepository.mts diff --git a/src/agile/models/getReviewById.ts b/src/agile/models/getReviewById.mts similarity index 100% rename from src/agile/models/getReviewById.ts rename to src/agile/models/getReviewById.mts diff --git a/src/agile/models/getVulnerabilityById.ts b/src/agile/models/getVulnerabilityById.mts similarity index 100% rename from src/agile/models/getVulnerabilityById.ts rename to src/agile/models/getVulnerabilityById.mts diff --git a/src/agile/models/getWorkspaces.ts b/src/agile/models/getWorkspaces.mts similarity index 100% rename from src/agile/models/getWorkspaces.ts rename to src/agile/models/getWorkspaces.mts diff --git a/src/agile/models/group.ts b/src/agile/models/group.mts similarity index 100% rename from src/agile/models/group.ts rename to src/agile/models/group.mts diff --git a/src/agile/models/index.mts b/src/agile/models/index.mts new file mode 100644 index 0000000000..cbb3689034 --- /dev/null +++ b/src/agile/models/index.mts @@ -0,0 +1,58 @@ +export * from './avatarUrls.mjs'; +export * from './board.mjs'; +export * from './createBoard.mjs'; +export * from './epic.mjs'; +export * from './existsByProperties.mjs'; +export * from './fields.mjs'; +export * from './fixVersion.mjs'; +export * from './getAllBoards.mjs'; +export * from './getAllQuickFilters.mjs'; +export * from './getBoard.mjs'; +export * from './getBoardByFilterId.mjs'; +export * from './getBuildByKey.mjs'; +export * from './getComponentById.mjs'; +export * from './getConfiguration.mjs'; +export * from './getDeploymentByKey.mjs'; +export * from './getDeploymentGatingStatusByKey.mjs'; +export * from './getFeatureFlagById.mjs'; +export * from './getFeaturesForBoard.mjs'; +export * from './getIncidentById.mjs'; +export * from './getLinkedWorkspaceById.mjs'; +export * from './getLinkedWorkspaces.mjs'; +export * from './getQuickFilter.mjs'; +export * from './getRemoteLinkById.mjs'; +export * from './getReportsForBoard.mjs'; +export * from './getRepository.mjs'; +export * from './getReviewById.mjs'; +export * from './getVulnerabilityById.mjs'; +export * from './getWorkspaces.mjs'; +export * from './group.mjs'; +export * from './issue.mjs'; +export * from './issueTransition.mjs'; +export * from './issueType.mjs'; +export * from './jsonType.mjs'; +export * from './linkedSecurityWorkspaceIds.mjs'; +export * from './linkedWorkspace.mjs'; +export * from './linkGroup.mjs'; +export * from './operations.mjs'; +export * from './scope.mjs'; +export * from './progress.mjs'; +export * from './project.mjs'; +export * from './projects.mjs'; +export * from './searchResults.mjs'; +export * from './sprint.mjs'; +export * from './status.mjs'; +export * from './statusCategory.mjs'; +export * from './storeDevelopmentInformation.mjs'; +export * from './submitBuilds.mjs'; +export * from './submitComponents.mjs'; +export * from './submitDeployments.mjs'; +export * from './submitEntity.mjs'; +export * from './submitFeatureFlags.mjs'; +export * from './submitOperationsWorkspaces.mjs'; +export * from './submitRemoteLinks.mjs'; +export * from './submitVulnerabilities.mjs'; +export * from './toggleFeatures.mjs'; +export * from './user.mjs'; +export * from './version.mjs'; +export * from './vulnerability.mjs'; diff --git a/src/agile/models/index.ts b/src/agile/models/index.ts deleted file mode 100644 index 2ced13b5d0..0000000000 --- a/src/agile/models/index.ts +++ /dev/null @@ -1,58 +0,0 @@ -export * from './avatarUrls'; -export * from './board'; -export * from './createBoard'; -export * from './epic'; -export * from './existsByProperties'; -export * from './fields'; -export * from './fixVersion'; -export * from './getAllBoards'; -export * from './getAllQuickFilters'; -export * from './getBoard'; -export * from './getBoardByFilterId'; -export * from './getBuildByKey'; -export * from './getComponentById'; -export * from './getConfiguration'; -export * from './getDeploymentByKey'; -export * from './getDeploymentGatingStatusByKey'; -export * from './getFeatureFlagById'; -export * from './getFeaturesForBoard'; -export * from './getIncidentById'; -export * from './getLinkedWorkspaceById'; -export * from './getLinkedWorkspaces'; -export * from './getQuickFilter'; -export * from './getRemoteLinkById'; -export * from './getReportsForBoard'; -export * from './getRepository'; -export * from './getReviewById'; -export * from './getVulnerabilityById'; -export * from './getWorkspaces'; -export * from './group'; -export * from './issue'; -export * from './issueTransition'; -export * from './issueType'; -export * from './jsonType'; -export * from './linkedSecurityWorkspaceIds'; -export * from './linkedWorkspace'; -export * from './linkGroup'; -export * from './operations'; -export * from './scope'; -export * from './progress'; -export * from './project'; -export * from './projects'; -export * from './searchResults'; -export * from './sprint'; -export * from './status'; -export * from './statusCategory'; -export * from './storeDevelopmentInformation'; -export * from './submitBuilds'; -export * from './submitComponents'; -export * from './submitDeployments'; -export * from './submitEntity'; -export * from './submitFeatureFlags'; -export * from './submitOperationsWorkspaces'; -export * from './submitRemoteLinks'; -export * from './submitVulnerabilities'; -export * from './toggleFeatures'; -export * from './user'; -export * from './version'; -export * from './vulnerability'; diff --git a/src/agile/models/issue.mts b/src/agile/models/issue.mts new file mode 100644 index 0000000000..02778b773d --- /dev/null +++ b/src/agile/models/issue.mts @@ -0,0 +1,216 @@ +import { Operations } from './operations.mjs'; +import { Fields } from './fields.mjs'; +import type { Scope } from './scope.mjs'; +import type { StatusCategory } from './statusCategory.mjs'; +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about an issue. */ +export interface Issue { + /** A page of changelogs. */ + changelog?: { + /** The list of changelogs. */ + histories?: { + /** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: + * + * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email + * is blank). User record corrupted: This occurs as a results of events such as a server import and can only + * happen to deleted users. In this case, `accountId` returns _unknown_ and all other parameters have fallback + * values. User record unavailable: This usually occurs due to an internal service outage. In this case, all + * parameters have fallback values. + */ + author?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' + * (application user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** The URL of the user. */ + self?: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned + * as null. + */ + timeZone?: string; + }; + /** The date on which the change took place. */ + created?: string; + /** Details of issue history metadata. */ + historyMetadata?: { + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + /** Details of user or system associated with a issue history metadata item. */ + actor?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + }; + /** Details of user or system associated with a issue history metadata item. */ + cause?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + }; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: {}; + /** Details of user or system associated with a issue history metadata item. */ + generator?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + }; + /** The type of the history record. */ + type?: string; + }; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: { + /** The name of the field changed. */ + field?: string; + /** The ID of the field changed. */ + fieldId?: string; + /** The type of the field changed. */ + fieldtype?: string; + /** The details of the original value. */ + from?: string; + /** The details of the original value as a string. */ + fromString?: string; + /** The details of the new value. */ + to?: string; + /** The details of the new value as a string. */ + toString?: string; + }[]; + }[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; + }; + /** A list of editable field details. */ + editmeta?: { + fields?: {}; + }; + /** Expand options that include additional issue details in the response. */ + expand?: string; + fields?: Fields; + fieldsToInclude?: { + actuallyIncluded?: string[]; + excluded?: string[]; + included?: string[]; + }; + /** The ID of the issue. */ + id?: string; + /** The key of the issue. */ + key?: string; + /** The ID and name of each field present on the issue. */ + names?: {}; + operations?: Operations; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The rendered value of each field present on the issue. */ + renderedFields?: {}; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The URL of the issue details. */ + self?: string; + /** The transitions that can be performed on the issue. */ + transitions?: { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** A status. */ + to?: { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; + /** A status category. */ + statusCategory?: StatusCategory; + }; + }[]; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; +} diff --git a/src/agile/models/issue.ts b/src/agile/models/issue.ts deleted file mode 100644 index dbb296af89..0000000000 --- a/src/agile/models/issue.ts +++ /dev/null @@ -1,216 +0,0 @@ -import { Operations } from './operations'; -import { Fields } from './fields'; -import { Scope } from './scope'; -import { StatusCategory } from './statusCategory'; -import { AvatarUrls } from './avatarUrls'; - -/** Details about an issue. */ -export interface Issue { - /** A page of changelogs. */ - changelog?: { - /** The list of changelogs. */ - histories?: { - /** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: - * - * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email - * is blank). User record corrupted: This occurs as a results of events such as a server import and can only - * happen to deleted users. In this case, `accountId` returns _unknown_ and all other parameters have fallback - * values. User record unavailable: This usually occurs due to an internal service outage. In this case, all - * parameters have fallback values. - */ - author?: { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' - * (application user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned - * as null. - */ - timeZone?: string; - }; - /** The date on which the change took place. */ - created?: string; - /** Details of issue history metadata. */ - historyMetadata?: { - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - /** Details of user or system associated with a issue history metadata item. */ - actor?: { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; - }; - /** Details of user or system associated with a issue history metadata item. */ - cause?: { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; - }; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - /** Additional arbitrary information about the history record. */ - extraData?: {}; - /** Details of user or system associated with a issue history metadata item. */ - generator?: { - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; - /** The display name of the user or system associated with a history record. */ - displayName?: string; - /** The key of the display name of the user or system associated with a history record. */ - displayNameKey?: string; - /** The ID of the user or system associated with a history record. */ - id?: string; - /** The type of the user or system associated with a history record. */ - type?: string; - /** The URL of the user or system associated with a history record. */ - url?: string; - }; - /** The type of the history record. */ - type?: string; - }; - /** The ID of the changelog. */ - id?: string; - /** The list of items changed. */ - items?: { - /** The name of the field changed. */ - field?: string; - /** The ID of the field changed. */ - fieldId?: string; - /** The type of the field changed. */ - fieldtype?: string; - /** The details of the original value. */ - from?: string; - /** The details of the original value as a string. */ - fromString?: string; - /** The details of the new value. */ - to?: string; - /** The details of the new value as a string. */ - toString?: string; - }[]; - }[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; - }; - /** A list of editable field details. */ - editmeta?: { - fields?: {}; - }; - /** Expand options that include additional issue details in the response. */ - expand?: string; - fields?: Fields; - fieldsToInclude?: { - actuallyIncluded?: string[]; - excluded?: string[]; - included?: string[]; - }; - /** The ID of the issue. */ - id?: string; - /** The key of the issue. */ - key?: string; - /** The ID and name of each field present on the issue. */ - names?: {}; - operations?: Operations; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The rendered value of each field present on the issue. */ - renderedFields?: {}; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The URL of the issue details. */ - self?: string; - /** The transitions that can be performed on the issue. */ - transitions?: { - /** Expand options that include additional transition details in the response. */ - expand?: string; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - looped?: boolean; - /** The name of the issue transition. */ - name?: string; - /** A status. */ - to?: { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ - scope?: Scope; - /** The URL of the status. */ - self?: string; - /** A status category. */ - statusCategory?: StatusCategory; - }; - }[]; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; -} diff --git a/src/agile/models/issueTransition.mts b/src/agile/models/issueTransition.mts new file mode 100644 index 0000000000..8dcad2d144 --- /dev/null +++ b/src/agile/models/issueTransition.mts @@ -0,0 +1,58 @@ +import type { Scope } from './scope.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** A status. */ + to?: { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; + /** A status category. */ + statusCategory?: { + /** The name of the color used to represent the status category. */ + colorName?: string; + /** The ID of the status category. */ + id?: number; + /** The key of the status category. */ + key?: string; + /** The name of the status category. */ + name?: string; + /** The URL of the status category. */ + self: string; + }; + }; +} diff --git a/src/agile/models/issueTransition.ts b/src/agile/models/issueTransition.ts deleted file mode 100644 index bb35bb723f..0000000000 --- a/src/agile/models/issueTransition.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Scope } from './scope'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** Expand options that include additional transition details in the response. */ - expand?: string; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - looped?: boolean; - /** The name of the issue transition. */ - name?: string; - /** A status. */ - to?: { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ - scope?: Scope; - /** The URL of the status. */ - self?: string; - /** A status category. */ - statusCategory?: { - /** The name of the color used to represent the status category. */ - colorName?: string; - /** The ID of the status category. */ - id?: number; - /** The key of the status category. */ - key?: string; - /** The name of the status category. */ - name?: string; - /** The URL of the status category. */ - self: string; - }; - }; -} diff --git a/src/agile/models/issueType.ts b/src/agile/models/issueType.mts similarity index 100% rename from src/agile/models/issueType.ts rename to src/agile/models/issueType.mts diff --git a/src/agile/models/jsonType.ts b/src/agile/models/jsonType.mts similarity index 100% rename from src/agile/models/jsonType.ts rename to src/agile/models/jsonType.mts diff --git a/src/agile/models/linkGroup.ts b/src/agile/models/linkGroup.mts similarity index 100% rename from src/agile/models/linkGroup.ts rename to src/agile/models/linkGroup.mts diff --git a/src/agile/models/linkedSecurityWorkspaceIds.ts b/src/agile/models/linkedSecurityWorkspaceIds.mts similarity index 100% rename from src/agile/models/linkedSecurityWorkspaceIds.ts rename to src/agile/models/linkedSecurityWorkspaceIds.mts diff --git a/src/agile/models/linkedWorkspace.ts b/src/agile/models/linkedWorkspace.mts similarity index 100% rename from src/agile/models/linkedWorkspace.ts rename to src/agile/models/linkedWorkspace.mts diff --git a/src/agile/models/operations.mts b/src/agile/models/operations.mts new file mode 100644 index 0000000000..abc4e9bf0e --- /dev/null +++ b/src/agile/models/operations.mts @@ -0,0 +1,7 @@ +import { LinkGroup } from './linkGroup.mjs'; + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; +} diff --git a/src/agile/models/operations.ts b/src/agile/models/operations.ts deleted file mode 100644 index 11702d0336..0000000000 --- a/src/agile/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { LinkGroup } from './linkGroup'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/agile/models/progress.ts b/src/agile/models/progress.mts similarity index 100% rename from src/agile/models/progress.ts rename to src/agile/models/progress.mts diff --git a/src/agile/models/project.mts b/src/agile/models/project.mts new file mode 100644 index 0000000000..edb6e2721a --- /dev/null +++ b/src/agile/models/project.mts @@ -0,0 +1,33 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** Details about a project. */ +export interface Project { + avatarUrls: AvatarUrls; + /** The ID of the project. */ + id: string; + /** The key of the project. */ + key: string; + /** The name of the project. */ + name: string; + /** A project category. */ + projectCategory: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id: string; + /** The description of the project category. */ + name: string; + /** The URL of the project category. */ + self: string; + }; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self: string; + /** Whether or not the project is simplified. */ + simplified: boolean; +} diff --git a/src/agile/models/project.ts b/src/agile/models/project.ts deleted file mode 100644 index f39fb048d4..0000000000 --- a/src/agile/models/project.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** Details about a project. */ -export interface Project { - avatarUrls: AvatarUrls; - /** The ID of the project. */ - id: string; - /** The key of the project. */ - key: string; - /** The name of the project. */ - name: string; - /** A project category. */ - projectCategory: { - /** The name of the project category. */ - description?: string; - /** The ID of the project category. */ - id: string; - /** The description of the project category. */ - name: string; - /** The URL of the project category. */ - self: string; - }; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey: 'software' | 'service_desk' | 'business' | string; - /** The URL of the project details. */ - self: string; - /** Whether or not the project is simplified. */ - simplified: boolean; -} diff --git a/src/agile/models/projects.mts b/src/agile/models/projects.mts new file mode 100644 index 0000000000..bded7f344d --- /dev/null +++ b/src/agile/models/projects.mts @@ -0,0 +1,21 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +export interface Projects { + self: string; + id: string; + key: string; + name: string; + avatarUrls: AvatarUrls; + projectCategory: { + self: string; + id: string; + name: string; + description: string; + }; + simplified: boolean; + style: string; + insight: { + totalIssueCount: number; + lastIssueUpdateTime: string; + }; +} diff --git a/src/agile/models/projects.ts b/src/agile/models/projects.ts deleted file mode 100644 index 99b2bcd597..0000000000 --- a/src/agile/models/projects.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -export interface Projects { - self: string; - id: string; - key: string; - name: string; - avatarUrls: AvatarUrls; - projectCategory: { - self: string; - id: string; - name: string; - description: string; - }; - simplified: boolean; - style: string; - insight: { - totalIssueCount: number; - lastIssueUpdateTime: string; - }; -} diff --git a/src/agile/models/scope.mts b/src/agile/models/scope.mts new file mode 100644 index 0000000000..66b29393d2 --- /dev/null +++ b/src/agile/models/scope.mts @@ -0,0 +1,41 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + /** Details about a project. */ + project?: { + avatarUrls?: AvatarUrls; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** A project category. */ + projectCategory?: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id?: string; + /** The description of the project category. */ + name?: string; + /** The URL of the project category. */ + self?: string; + }; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; + }; + /** The type of scope. */ + type?: 'PROJECT' | 'TEMPLATE' | string; +} diff --git a/src/agile/models/scope.ts b/src/agile/models/scope.ts deleted file mode 100644 index 0f0d631d05..0000000000 --- a/src/agile/models/scope.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - /** Details about a project. */ - project?: { - avatarUrls?: AvatarUrls; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** A project category. */ - projectCategory?: { - /** The name of the project category. */ - description?: string; - /** The ID of the project category. */ - id?: string; - /** The description of the project category. */ - name?: string; - /** The URL of the project category. */ - self?: string; - }; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: 'software' | 'service_desk' | 'business' | string; - /** The URL of the project details. */ - self?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; - }; - /** The type of scope. */ - type?: 'PROJECT' | 'TEMPLATE' | string; -} diff --git a/src/agile/models/searchResults.mts b/src/agile/models/searchResults.mts new file mode 100644 index 0000000000..eb6182fe09 --- /dev/null +++ b/src/agile/models/searchResults.mts @@ -0,0 +1,21 @@ +import type { Issue } from './issue.mjs'; + +/** The result of a Jql search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The list of issues found by the search. */ + issues: Issue[]; + /** The maximum number of results that could be on the page. */ + maxResults: number; + /** The ID and name of each field in the search results. */ + names?: {}; + /** The schema describing the field types in the search results. */ + schema?: {}; + /** The index of the first item returned on the page. */ + startAt: number; + /** The number of results on the page. */ + total: number; + /** Any warnings related to the Jql query. */ + warningMessages?: string[]; +} diff --git a/src/agile/models/searchResults.ts b/src/agile/models/searchResults.ts deleted file mode 100644 index 015ea5b3d2..0000000000 --- a/src/agile/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Issue } from './issue'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The list of issues found by the search. */ - issues: Issue[]; - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The ID and name of each field in the search results. */ - names?: {}; - /** The schema describing the field types in the search results. */ - schema?: {}; - /** The index of the first item returned on the page. */ - startAt: number; - /** The number of results on the page. */ - total: number; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; -} diff --git a/src/agile/models/sprint.ts b/src/agile/models/sprint.mts similarity index 100% rename from src/agile/models/sprint.ts rename to src/agile/models/sprint.mts diff --git a/src/agile/models/status.mts b/src/agile/models/status.mts new file mode 100644 index 0000000000..4f4e246b9c --- /dev/null +++ b/src/agile/models/status.mts @@ -0,0 +1,10 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +export interface Status { + self: string; + description: string; + iconUrl: string; + name: string; + id: string; + statusCategory: StatusCategory; +} diff --git a/src/agile/models/status.ts b/src/agile/models/status.ts deleted file mode 100644 index 7ef6e12c11..0000000000 --- a/src/agile/models/status.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { StatusCategory } from './statusCategory'; - -export interface Status { - self: string; - description: string; - iconUrl: string; - name: string; - id: string; - statusCategory: StatusCategory; -} diff --git a/src/agile/models/statusCategory.ts b/src/agile/models/statusCategory.mts similarity index 100% rename from src/agile/models/statusCategory.ts rename to src/agile/models/statusCategory.mts diff --git a/src/agile/models/storeDevelopmentInformation.ts b/src/agile/models/storeDevelopmentInformation.mts similarity index 100% rename from src/agile/models/storeDevelopmentInformation.ts rename to src/agile/models/storeDevelopmentInformation.mts diff --git a/src/agile/models/submitBuilds.ts b/src/agile/models/submitBuilds.mts similarity index 100% rename from src/agile/models/submitBuilds.ts rename to src/agile/models/submitBuilds.mts diff --git a/src/agile/models/submitComponents.ts b/src/agile/models/submitComponents.mts similarity index 100% rename from src/agile/models/submitComponents.ts rename to src/agile/models/submitComponents.mts diff --git a/src/agile/models/submitDeployments.ts b/src/agile/models/submitDeployments.mts similarity index 100% rename from src/agile/models/submitDeployments.ts rename to src/agile/models/submitDeployments.mts diff --git a/src/agile/models/submitEntity.ts b/src/agile/models/submitEntity.mts similarity index 100% rename from src/agile/models/submitEntity.ts rename to src/agile/models/submitEntity.mts diff --git a/src/agile/models/submitFeatureFlags.ts b/src/agile/models/submitFeatureFlags.mts similarity index 100% rename from src/agile/models/submitFeatureFlags.ts rename to src/agile/models/submitFeatureFlags.mts diff --git a/src/agile/models/submitOperationsWorkspaces.ts b/src/agile/models/submitOperationsWorkspaces.mts similarity index 100% rename from src/agile/models/submitOperationsWorkspaces.ts rename to src/agile/models/submitOperationsWorkspaces.mts diff --git a/src/agile/models/submitRemoteLinks.ts b/src/agile/models/submitRemoteLinks.mts similarity index 100% rename from src/agile/models/submitRemoteLinks.ts rename to src/agile/models/submitRemoteLinks.mts diff --git a/src/agile/models/submitVulnerabilities.ts b/src/agile/models/submitVulnerabilities.mts similarity index 100% rename from src/agile/models/submitVulnerabilities.ts rename to src/agile/models/submitVulnerabilities.mts diff --git a/src/agile/models/submittedVulnerabilitiesResult.ts b/src/agile/models/submittedVulnerabilitiesResult.mts similarity index 100% rename from src/agile/models/submittedVulnerabilitiesResult.ts rename to src/agile/models/submittedVulnerabilitiesResult.mts diff --git a/src/agile/models/toggleFeatures.ts b/src/agile/models/toggleFeatures.mts similarity index 100% rename from src/agile/models/toggleFeatures.ts rename to src/agile/models/toggleFeatures.mts diff --git a/src/agile/models/user.mts b/src/agile/models/user.mts new file mode 100644 index 0000000000..6a6aa8b9ff --- /dev/null +++ b/src/agile/models/user.mts @@ -0,0 +1,39 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface User { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType: string; + /** Whether the user is active. */ + active: boolean; + avatarUrls: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress: string; + /** The URL of the user. */ + self: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone: string | null; +} diff --git a/src/agile/models/user.ts b/src/agile/models/user.ts deleted file mode 100644 index 58b4caf41a..0000000000 --- a/src/agile/models/user.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType: string; - /** Whether the user is active. */ - active: boolean; - avatarUrls: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress: string; - /** The URL of the user. */ - self: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone: string | null; -} diff --git a/src/agile/models/version.ts b/src/agile/models/version.mts similarity index 100% rename from src/agile/models/version.ts rename to src/agile/models/version.mts diff --git a/src/agile/models/vulnerability.ts b/src/agile/models/vulnerability.mts similarity index 100% rename from src/agile/models/vulnerability.ts rename to src/agile/models/vulnerability.mts diff --git a/src/agile/operations.mts b/src/agile/operations.mts new file mode 100644 index 0000000000..bf0be7177e --- /dev/null +++ b/src/agile/operations.mts @@ -0,0 +1,357 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Operations { + constructor(private client: Client) {} + + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback: Callback, + ): Promise; + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: never, + ): Promise; + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'POST', + data: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback: Callback): Promise; + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: never): Promise; + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'DELETE', + params: { + workspaceIds: parameters.workspaceIds.join(','), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback: Callback, + ): Promise; + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces(parameters: Parameters.GetWorkspaces, callback?: never): Promise; + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces', + method: 'GET', + params: { + workspaceId: parameters.workspaceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity( + parameters: Parameters.SubmitEntity, + callback: Callback, + ): Promise; + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity(parameters: Parameters.SubmitEntity, callback?: never): Promise; + async submitEntity( + parameters: Parameters.SubmitEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulk', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: never, + ): Promise; + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: never, + ): Promise; + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback: Callback): Promise; + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback?: never): Promise; + async deleteIncidentById( + parameters: Parameters.DeleteIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById( + parameters: Parameters.GetReviewById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById(parameters: Parameters.GetReviewById, callback?: never): Promise; + async getReviewById( + parameters: Parameters.GetReviewById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback: Callback): Promise; + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: never): Promise; + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/operations.ts b/src/agile/operations.ts deleted file mode 100644 index 989e08fe1b..0000000000 --- a/src/agile/operations.ts +++ /dev/null @@ -1,357 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Operations { - constructor(private client: Client) {} - - /** - * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. - * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitOperationsWorkspaces( - parameters: Parameters.SubmitOperationsWorkspaces, - callback: Callback, - ): Promise; - /** - * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. - * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitOperationsWorkspaces( - parameters: Parameters.SubmitOperationsWorkspaces, - callback?: never, - ): Promise; - async submitOperationsWorkspaces( - parameters: Parameters.SubmitOperationsWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/linkedWorkspaces/bulk', - method: 'POST', - data: { - workspaceIds: parameters.workspaceIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Operations Workspaces that match the given request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback: Callback): Promise; - /** - * Bulk delete all Operations Workspaces that match the given request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: never): Promise; - async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/linkedWorkspaces/bulk', - method: 'DELETE', - params: { - workspaceIds: parameters.workspaceIds.join(','), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace - * ID for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * E.g. GET /workspace?workspaceId=111-222-333 - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getWorkspaces( - parameters: Parameters.GetWorkspaces, - callback: Callback, - ): Promise; - /** - * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace - * ID for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * E.g. GET /workspace?workspaceId=111-222-333 - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getWorkspaces(parameters: Parameters.GetWorkspaces, callback?: never): Promise; - async getWorkspaces( - parameters: Parameters.GetWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/linkedWorkspaces', - method: 'GET', - params: { - workspaceId: parameters.workspaceId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update / insert Incident or Review data. - * - * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be - * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if - * needed). - * - * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior - * to submission. Details of which entities failed submission (if any) are available in the response object. - * - * A maximum of 1000 incidents can be submitted in one request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitEntity( - parameters: Parameters.SubmitEntity, - callback: Callback, - ): Promise; - /** - * Update / insert Incident or Review data. - * - * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be - * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if - * needed). - * - * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior - * to submission. Details of which entities failed submission (if any) are available in the response object. - * - * A maximum of 1000 incidents can be submitted in one request. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitEntity(parameters: Parameters.SubmitEntity, callback?: never): Promise; - async submitEntity( - parameters: Parameters.SubmitEntity, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/bulk', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Entries that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitEntity operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteEntityByProperty( - parameters: Parameters.DeleteEntityByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Entries that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation - * for the submitEntity operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteEntityByProperty( - parameters: Parameters.DeleteEntityByProperty, - callback?: never, - ): Promise; - async deleteEntityByProperty( - parameters: Parameters.DeleteEntityByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/operations/1.0/bulkByProperties', - method: 'DELETE', - params: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Incident data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getIncidentById( - parameters: Parameters.GetIncidentById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Incident data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getIncidentById( - parameters: Parameters.GetIncidentById, - callback?: never, - ): Promise; - async getIncidentById( - parameters: Parameters.GetIncidentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Incident data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback: Callback): Promise; - /** - * Delete the Incident data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback?: never): Promise; - async deleteIncidentById( - parameters: Parameters.DeleteIncidentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Review data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getReviewById( - parameters: Parameters.GetReviewById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Review data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getReviewById(parameters: Parameters.GetReviewById, callback?: never): Promise; - async getReviewById( - parameters: Parameters.GetReviewById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Review data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted - * successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteReviewById(parameters: Parameters.DeleteReviewById, callback: Callback): Promise; - /** - * Delete the Review data currently stored for the given ID. - * - * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted - * successfully (if needed). - * - * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: never): Promise; - async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/parameters/createBoard.ts b/src/agile/parameters/createBoard.mts similarity index 100% rename from src/agile/parameters/createBoard.ts rename to src/agile/parameters/createBoard.mts diff --git a/src/agile/parameters/createSprint.ts b/src/agile/parameters/createSprint.mts similarity index 100% rename from src/agile/parameters/createSprint.ts rename to src/agile/parameters/createSprint.mts diff --git a/src/agile/parameters/deleteBoard.ts b/src/agile/parameters/deleteBoard.mts similarity index 100% rename from src/agile/parameters/deleteBoard.ts rename to src/agile/parameters/deleteBoard.mts diff --git a/src/agile/parameters/deleteBoardProperty.ts b/src/agile/parameters/deleteBoardProperty.mts similarity index 100% rename from src/agile/parameters/deleteBoardProperty.ts rename to src/agile/parameters/deleteBoardProperty.mts diff --git a/src/agile/parameters/deleteBuildByKey.ts b/src/agile/parameters/deleteBuildByKey.mts similarity index 100% rename from src/agile/parameters/deleteBuildByKey.ts rename to src/agile/parameters/deleteBuildByKey.mts diff --git a/src/agile/parameters/deleteBuildsByProperty.ts b/src/agile/parameters/deleteBuildsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteBuildsByProperty.ts rename to src/agile/parameters/deleteBuildsByProperty.mts diff --git a/src/agile/parameters/deleteByProperties.ts b/src/agile/parameters/deleteByProperties.mts similarity index 100% rename from src/agile/parameters/deleteByProperties.ts rename to src/agile/parameters/deleteByProperties.mts diff --git a/src/agile/parameters/deleteComponentById.ts b/src/agile/parameters/deleteComponentById.mts similarity index 100% rename from src/agile/parameters/deleteComponentById.ts rename to src/agile/parameters/deleteComponentById.mts diff --git a/src/agile/parameters/deleteComponentsByProperty.ts b/src/agile/parameters/deleteComponentsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteComponentsByProperty.ts rename to src/agile/parameters/deleteComponentsByProperty.mts diff --git a/src/agile/parameters/deleteDeploymentByKey.ts b/src/agile/parameters/deleteDeploymentByKey.mts similarity index 100% rename from src/agile/parameters/deleteDeploymentByKey.ts rename to src/agile/parameters/deleteDeploymentByKey.mts diff --git a/src/agile/parameters/deleteDeploymentsByProperty.ts b/src/agile/parameters/deleteDeploymentsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteDeploymentsByProperty.ts rename to src/agile/parameters/deleteDeploymentsByProperty.mts diff --git a/src/agile/parameters/deleteEntity.ts b/src/agile/parameters/deleteEntity.mts similarity index 100% rename from src/agile/parameters/deleteEntity.ts rename to src/agile/parameters/deleteEntity.mts diff --git a/src/agile/parameters/deleteEntityByProperty.ts b/src/agile/parameters/deleteEntityByProperty.mts similarity index 100% rename from src/agile/parameters/deleteEntityByProperty.ts rename to src/agile/parameters/deleteEntityByProperty.mts diff --git a/src/agile/parameters/deleteFeatureFlagById.ts b/src/agile/parameters/deleteFeatureFlagById.mts similarity index 100% rename from src/agile/parameters/deleteFeatureFlagById.ts rename to src/agile/parameters/deleteFeatureFlagById.mts diff --git a/src/agile/parameters/deleteFeatureFlagsByProperty.ts b/src/agile/parameters/deleteFeatureFlagsByProperty.mts similarity index 100% rename from src/agile/parameters/deleteFeatureFlagsByProperty.ts rename to src/agile/parameters/deleteFeatureFlagsByProperty.mts diff --git a/src/agile/parameters/deleteIncidentById.ts b/src/agile/parameters/deleteIncidentById.mts similarity index 100% rename from src/agile/parameters/deleteIncidentById.ts rename to src/agile/parameters/deleteIncidentById.mts diff --git a/src/agile/parameters/deleteLinkedWorkspaces.ts b/src/agile/parameters/deleteLinkedWorkspaces.mts similarity index 100% rename from src/agile/parameters/deleteLinkedWorkspaces.ts rename to src/agile/parameters/deleteLinkedWorkspaces.mts diff --git a/src/agile/parameters/deleteProperty.ts b/src/agile/parameters/deleteProperty.mts similarity index 100% rename from src/agile/parameters/deleteProperty.ts rename to src/agile/parameters/deleteProperty.mts diff --git a/src/agile/parameters/deleteRemoteLinkById.ts b/src/agile/parameters/deleteRemoteLinkById.mts similarity index 100% rename from src/agile/parameters/deleteRemoteLinkById.ts rename to src/agile/parameters/deleteRemoteLinkById.mts diff --git a/src/agile/parameters/deleteRemoteLinksByProperty.ts b/src/agile/parameters/deleteRemoteLinksByProperty.mts similarity index 100% rename from src/agile/parameters/deleteRemoteLinksByProperty.ts rename to src/agile/parameters/deleteRemoteLinksByProperty.mts diff --git a/src/agile/parameters/deleteRepository.ts b/src/agile/parameters/deleteRepository.mts similarity index 100% rename from src/agile/parameters/deleteRepository.ts rename to src/agile/parameters/deleteRepository.mts diff --git a/src/agile/parameters/deleteReviewById.ts b/src/agile/parameters/deleteReviewById.mts similarity index 100% rename from src/agile/parameters/deleteReviewById.ts rename to src/agile/parameters/deleteReviewById.mts diff --git a/src/agile/parameters/deleteSprint.ts b/src/agile/parameters/deleteSprint.mts similarity index 100% rename from src/agile/parameters/deleteSprint.ts rename to src/agile/parameters/deleteSprint.mts diff --git a/src/agile/parameters/deleteVulnerabilitiesByProperty.ts b/src/agile/parameters/deleteVulnerabilitiesByProperty.mts similarity index 100% rename from src/agile/parameters/deleteVulnerabilitiesByProperty.ts rename to src/agile/parameters/deleteVulnerabilitiesByProperty.mts diff --git a/src/agile/parameters/deleteVulnerabilityById.ts b/src/agile/parameters/deleteVulnerabilityById.mts similarity index 100% rename from src/agile/parameters/deleteVulnerabilityById.ts rename to src/agile/parameters/deleteVulnerabilityById.mts diff --git a/src/agile/parameters/deleteWorkspaces.ts b/src/agile/parameters/deleteWorkspaces.mts similarity index 100% rename from src/agile/parameters/deleteWorkspaces.ts rename to src/agile/parameters/deleteWorkspaces.mts diff --git a/src/agile/parameters/estimateIssueForBoard.ts b/src/agile/parameters/estimateIssueForBoard.mts similarity index 100% rename from src/agile/parameters/estimateIssueForBoard.ts rename to src/agile/parameters/estimateIssueForBoard.mts diff --git a/src/agile/parameters/existsByProperties.ts b/src/agile/parameters/existsByProperties.mts similarity index 100% rename from src/agile/parameters/existsByProperties.ts rename to src/agile/parameters/existsByProperties.mts diff --git a/src/agile/parameters/getAllBoards.ts b/src/agile/parameters/getAllBoards.mts similarity index 100% rename from src/agile/parameters/getAllBoards.ts rename to src/agile/parameters/getAllBoards.mts diff --git a/src/agile/parameters/getAllQuickFilters.ts b/src/agile/parameters/getAllQuickFilters.mts similarity index 100% rename from src/agile/parameters/getAllQuickFilters.ts rename to src/agile/parameters/getAllQuickFilters.mts diff --git a/src/agile/parameters/getAllSprints.ts b/src/agile/parameters/getAllSprints.mts similarity index 100% rename from src/agile/parameters/getAllSprints.ts rename to src/agile/parameters/getAllSprints.mts diff --git a/src/agile/parameters/getAllVersions.ts b/src/agile/parameters/getAllVersions.mts similarity index 100% rename from src/agile/parameters/getAllVersions.ts rename to src/agile/parameters/getAllVersions.mts diff --git a/src/agile/parameters/getBoard.ts b/src/agile/parameters/getBoard.mts similarity index 100% rename from src/agile/parameters/getBoard.ts rename to src/agile/parameters/getBoard.mts diff --git a/src/agile/parameters/getBoardByFilterId.ts b/src/agile/parameters/getBoardByFilterId.mts similarity index 100% rename from src/agile/parameters/getBoardByFilterId.ts rename to src/agile/parameters/getBoardByFilterId.mts diff --git a/src/agile/parameters/getBoardIssuesForEpic.mts b/src/agile/parameters/getBoardIssuesForEpic.mts new file mode 100644 index 0000000000..554fbfd1ff --- /dev/null +++ b/src/agile/parameters/getBoardIssuesForEpic.mts @@ -0,0 +1,28 @@ +export interface GetBoardIssuesForEpic { + /** The ID of the board that contains the requested issues. */ + boardId: number; + /** The ID of the epic that contains the requested issues. */ + epicId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page + * for more details. Note, the total number of issues returned is limited by the property + * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getBoardIssuesForEpic.ts b/src/agile/parameters/getBoardIssuesForEpic.ts deleted file mode 100644 index 9fed90d9e3..0000000000 --- a/src/agile/parameters/getBoardIssuesForEpic.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface GetBoardIssuesForEpic { - /** The ID of the board that contains the requested issues. */ - boardId: number; - /** The ID of the epic that contains the requested issues. */ - epicId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page - * for more details. Note, the total number of issues returned is limited by the property - * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getBoardIssuesForSprint.mts b/src/agile/parameters/getBoardIssuesForSprint.mts new file mode 100644 index 0000000000..bcf31125fd --- /dev/null +++ b/src/agile/parameters/getBoardIssuesForSprint.mts @@ -0,0 +1,29 @@ +export interface GetBoardIssuesForSprint { + /** The ID of the board that contains requested issues. */ + boardId: number; + /** The ID of the sprint that contains requested issues. */ + sprintId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getBoardIssuesForSprint.ts b/src/agile/parameters/getBoardIssuesForSprint.ts deleted file mode 100644 index 953fc47a64..0000000000 --- a/src/agile/parameters/getBoardIssuesForSprint.ts +++ /dev/null @@ -1,29 +0,0 @@ -export interface GetBoardIssuesForSprint { - /** The ID of the board that contains requested issues. */ - boardId: number; - /** The ID of the sprint that contains requested issues. */ - sprintId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getBoardProperty.ts b/src/agile/parameters/getBoardProperty.mts similarity index 100% rename from src/agile/parameters/getBoardProperty.ts rename to src/agile/parameters/getBoardProperty.mts diff --git a/src/agile/parameters/getBoardPropertyKeys.ts b/src/agile/parameters/getBoardPropertyKeys.mts similarity index 100% rename from src/agile/parameters/getBoardPropertyKeys.ts rename to src/agile/parameters/getBoardPropertyKeys.mts diff --git a/src/agile/parameters/getBuildByKey.ts b/src/agile/parameters/getBuildByKey.mts similarity index 100% rename from src/agile/parameters/getBuildByKey.ts rename to src/agile/parameters/getBuildByKey.mts diff --git a/src/agile/parameters/getComponentById.ts b/src/agile/parameters/getComponentById.mts similarity index 100% rename from src/agile/parameters/getComponentById.ts rename to src/agile/parameters/getComponentById.mts diff --git a/src/agile/parameters/getConfiguration.ts b/src/agile/parameters/getConfiguration.mts similarity index 100% rename from src/agile/parameters/getConfiguration.ts rename to src/agile/parameters/getConfiguration.mts diff --git a/src/agile/parameters/getDeploymentByKey.ts b/src/agile/parameters/getDeploymentByKey.mts similarity index 100% rename from src/agile/parameters/getDeploymentByKey.ts rename to src/agile/parameters/getDeploymentByKey.mts diff --git a/src/agile/parameters/getDeploymentGatingStatusByKey.ts b/src/agile/parameters/getDeploymentGatingStatusByKey.mts similarity index 100% rename from src/agile/parameters/getDeploymentGatingStatusByKey.ts rename to src/agile/parameters/getDeploymentGatingStatusByKey.mts diff --git a/src/agile/parameters/getEpic.ts b/src/agile/parameters/getEpic.mts similarity index 100% rename from src/agile/parameters/getEpic.ts rename to src/agile/parameters/getEpic.mts diff --git a/src/agile/parameters/getEpics.ts b/src/agile/parameters/getEpics.mts similarity index 100% rename from src/agile/parameters/getEpics.ts rename to src/agile/parameters/getEpics.mts diff --git a/src/agile/parameters/getFeatureFlagById.ts b/src/agile/parameters/getFeatureFlagById.mts similarity index 100% rename from src/agile/parameters/getFeatureFlagById.ts rename to src/agile/parameters/getFeatureFlagById.mts diff --git a/src/agile/parameters/getFeaturesForBoard.ts b/src/agile/parameters/getFeaturesForBoard.mts similarity index 100% rename from src/agile/parameters/getFeaturesForBoard.ts rename to src/agile/parameters/getFeaturesForBoard.mts diff --git a/src/agile/parameters/getIncidentById.ts b/src/agile/parameters/getIncidentById.mts similarity index 100% rename from src/agile/parameters/getIncidentById.ts rename to src/agile/parameters/getIncidentById.mts diff --git a/src/agile/parameters/getIssue.ts b/src/agile/parameters/getIssue.mts similarity index 100% rename from src/agile/parameters/getIssue.ts rename to src/agile/parameters/getIssue.mts diff --git a/src/agile/parameters/getIssueEstimationForBoard.ts b/src/agile/parameters/getIssueEstimationForBoard.mts similarity index 100% rename from src/agile/parameters/getIssueEstimationForBoard.ts rename to src/agile/parameters/getIssueEstimationForBoard.mts diff --git a/src/agile/parameters/getIssuesForBacklog.mts b/src/agile/parameters/getIssuesForBacklog.mts new file mode 100644 index 0000000000..9259b2b129 --- /dev/null +++ b/src/agile/parameters/getIssuesForBacklog.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForBacklog { + /** The ID of the board that has the backlog containing the requested issues. */ + boardId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page + * for more details. Note, the total number of issues returned is limited by the property + * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** This parameter is currently not used. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForBacklog.ts b/src/agile/parameters/getIssuesForBacklog.ts deleted file mode 100644 index 4c2bc7bc42..0000000000 --- a/src/agile/parameters/getIssuesForBacklog.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForBacklog { - /** The ID of the board that has the backlog containing the requested issues. */ - boardId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page - * for more details. Note, the total number of issues returned is limited by the property - * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** This parameter is currently not used. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesForBoard.mts b/src/agile/parameters/getIssuesForBoard.mts new file mode 100644 index 0000000000..95ada27af7 --- /dev/null +++ b/src/agile/parameters/getIssuesForBoard.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForBoard { + /** The ID of the board that contains the requested issues. */ + boardId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** This parameter is currently not used. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForBoard.ts b/src/agile/parameters/getIssuesForBoard.ts deleted file mode 100644 index 3a0a2418fb..0000000000 --- a/src/agile/parameters/getIssuesForBoard.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForBoard { - /** The ID of the board that contains the requested issues. */ - boardId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** This parameter is currently not used. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesForEpic.mts b/src/agile/parameters/getIssuesForEpic.mts new file mode 100644 index 0000000000..d1b4a4e1e4 --- /dev/null +++ b/src/agile/parameters/getIssuesForEpic.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForEpic { + /** The id or key of the epic that contains the requested issues. */ + epicIdOrKey: string; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page + * for more details. Note, the total number of issues returned is limited by the property + * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForEpic.ts b/src/agile/parameters/getIssuesForEpic.ts deleted file mode 100644 index 9becca9b72..0000000000 --- a/src/agile/parameters/getIssuesForEpic.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForEpic { - /** The id or key of the epic that contains the requested issues. */ - epicIdOrKey: string; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. Default: 50. See the 'Pagination' section at the top of this page - * for more details. Note, the total number of issues returned is limited by the property - * 'jira.search.views.default.max' in your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesForSprint.mts b/src/agile/parameters/getIssuesForSprint.mts new file mode 100644 index 0000000000..0b2b386e21 --- /dev/null +++ b/src/agile/parameters/getIssuesForSprint.mts @@ -0,0 +1,27 @@ +export interface GetIssuesForSprint { + /** The ID of the sprint that contains the requested issues. */ + sprintId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesForSprint.ts b/src/agile/parameters/getIssuesForSprint.ts deleted file mode 100644 index 3abdb543ba..0000000000 --- a/src/agile/parameters/getIssuesForSprint.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesForSprint { - /** The ID of the sprint that contains the requested issues. */ - sprintId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesWithoutEpic.mts b/src/agile/parameters/getIssuesWithoutEpic.mts new file mode 100644 index 0000000000..d2d59c5752 --- /dev/null +++ b/src/agile/parameters/getIssuesWithoutEpic.mts @@ -0,0 +1,24 @@ +export interface GetIssuesWithoutEpic { + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesWithoutEpic.ts b/src/agile/parameters/getIssuesWithoutEpic.ts deleted file mode 100644 index 4b0eba147a..0000000000 --- a/src/agile/parameters/getIssuesWithoutEpic.ts +++ /dev/null @@ -1,24 +0,0 @@ -export interface GetIssuesWithoutEpic { - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getIssuesWithoutEpicForBoard.mts b/src/agile/parameters/getIssuesWithoutEpicForBoard.mts new file mode 100644 index 0000000000..9e25b658c8 --- /dev/null +++ b/src/agile/parameters/getIssuesWithoutEpicForBoard.mts @@ -0,0 +1,27 @@ +export interface GetIssuesWithoutEpicForBoard { + /** The ID of the board that contains the requested issues. */ + boardId: number; + /** + * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for + * more details. + */ + startAt?: number; + /** + * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more + * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in + * your Jira instance. If you exceed this limit, your results will be truncated. + */ + maxResults?: number; + /** + * Filters results using a Jql query. If you define an order in your Jql query, it will override the default order of + * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to + * privacy reasons. Use `accountId` instead. + */ + jql?: string; + /** Specifies whether to validate the Jql query or not. Default: true. */ + validateQuery?: boolean; + /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ + fields?: string[]; + /** A comma-separated list of the parameters to expand. */ + expand?: string; +} diff --git a/src/agile/parameters/getIssuesWithoutEpicForBoard.ts b/src/agile/parameters/getIssuesWithoutEpicForBoard.ts deleted file mode 100644 index 9dfb1bd3bd..0000000000 --- a/src/agile/parameters/getIssuesWithoutEpicForBoard.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface GetIssuesWithoutEpicForBoard { - /** The ID of the board that contains the requested issues. */ - boardId: number; - /** - * The starting index of the returned issues. Base index: 0. See the 'Pagination' section at the top of this page for - * more details. - */ - startAt?: number; - /** - * The maximum number of issues to return per page. See the 'Pagination' section at the top of this page for more - * details. Note, the total number of issues returned is limited by the property 'jira.search.views.default.max' in - * your Jira instance. If you exceed this limit, your results will be truncated. - */ - maxResults?: number; - /** - * Filters results using a JQL query. If you define an order in your JQL query, it will override the default order of - * the returned issues. Note that `username` and `userkey` can't be used as search terms for this parameter due to - * privacy reasons. Use `accountId` instead. - */ - jql?: string; - /** Specifies whether to validate the JQL query or not. Default: true. */ - validateQuery?: boolean; - /** The list of fields to return for each issue. By default, all navigable and Agile fields are returned. */ - fields?: string[]; - /** A comma-separated list of the parameters to expand. */ - expand?: string; -} diff --git a/src/agile/parameters/getLinkedWorkspaceById.ts b/src/agile/parameters/getLinkedWorkspaceById.mts similarity index 100% rename from src/agile/parameters/getLinkedWorkspaceById.ts rename to src/agile/parameters/getLinkedWorkspaceById.mts diff --git a/src/agile/parameters/getProjects.ts b/src/agile/parameters/getProjects.mts similarity index 100% rename from src/agile/parameters/getProjects.ts rename to src/agile/parameters/getProjects.mts diff --git a/src/agile/parameters/getProjectsFull.ts b/src/agile/parameters/getProjectsFull.mts similarity index 100% rename from src/agile/parameters/getProjectsFull.ts rename to src/agile/parameters/getProjectsFull.mts diff --git a/src/agile/parameters/getPropertiesKeys.ts b/src/agile/parameters/getPropertiesKeys.mts similarity index 100% rename from src/agile/parameters/getPropertiesKeys.ts rename to src/agile/parameters/getPropertiesKeys.mts diff --git a/src/agile/parameters/getProperty.ts b/src/agile/parameters/getProperty.mts similarity index 100% rename from src/agile/parameters/getProperty.ts rename to src/agile/parameters/getProperty.mts diff --git a/src/agile/parameters/getQuickFilter.ts b/src/agile/parameters/getQuickFilter.mts similarity index 100% rename from src/agile/parameters/getQuickFilter.ts rename to src/agile/parameters/getQuickFilter.mts diff --git a/src/agile/parameters/getRemoteLinkById.ts b/src/agile/parameters/getRemoteLinkById.mts similarity index 100% rename from src/agile/parameters/getRemoteLinkById.ts rename to src/agile/parameters/getRemoteLinkById.mts diff --git a/src/agile/parameters/getReportsForBoard.ts b/src/agile/parameters/getReportsForBoard.mts similarity index 100% rename from src/agile/parameters/getReportsForBoard.ts rename to src/agile/parameters/getReportsForBoard.mts diff --git a/src/agile/parameters/getRepository.ts b/src/agile/parameters/getRepository.mts similarity index 100% rename from src/agile/parameters/getRepository.ts rename to src/agile/parameters/getRepository.mts diff --git a/src/agile/parameters/getReviewById.ts b/src/agile/parameters/getReviewById.mts similarity index 100% rename from src/agile/parameters/getReviewById.ts rename to src/agile/parameters/getReviewById.mts diff --git a/src/agile/parameters/getSprint.ts b/src/agile/parameters/getSprint.mts similarity index 100% rename from src/agile/parameters/getSprint.ts rename to src/agile/parameters/getSprint.mts diff --git a/src/agile/parameters/getVulnerabilityById.ts b/src/agile/parameters/getVulnerabilityById.mts similarity index 100% rename from src/agile/parameters/getVulnerabilityById.ts rename to src/agile/parameters/getVulnerabilityById.mts diff --git a/src/agile/parameters/getWorkspaces.ts b/src/agile/parameters/getWorkspaces.mts similarity index 100% rename from src/agile/parameters/getWorkspaces.ts rename to src/agile/parameters/getWorkspaces.mts diff --git a/src/agile/parameters/index.mts b/src/agile/parameters/index.mts new file mode 100644 index 0000000000..c4f7a7269f --- /dev/null +++ b/src/agile/parameters/index.mts @@ -0,0 +1,95 @@ +export * from './createBoard.mjs'; +export * from './createSprint.mjs'; +export * from './deleteBoard.mjs'; +export * from './deleteBoardProperty.mjs'; +export * from './deleteBuildByKey.mjs'; +export * from './deleteBuildsByProperty.mjs'; +export * from './deleteByProperties.mjs'; +export * from './deleteDeploymentByKey.mjs'; +export * from './deleteDeploymentsByProperty.mjs'; +export * from './deleteEntity.mjs'; +export * from './deleteFeatureFlagById.mjs'; +export * from './deleteFeatureFlagsByProperty.mjs'; +export * from './deleteLinkedWorkspaces.mjs'; +export * from './deleteProperty.mjs'; +export * from './deleteRemoteLinkById.mjs'; +export * from './deleteRemoteLinksByProperty.mjs'; +export * from './deleteRepository.mjs'; +export * from './deleteSprint.mjs'; +export * from './deleteVulnerabilitiesByProperty.mjs'; +export * from './deleteVulnerabilityById.mjs'; +export * from './estimateIssueForBoard.mjs'; +export * from './existsByProperties.mjs'; +export * from './getAllBoards.mjs'; +export * from './getAllQuickFilters.mjs'; +export * from './getAllSprints.mjs'; +export * from './getAllVersions.mjs'; +export * from './getBoard.mjs'; +export * from './getBoardByFilterId.mjs'; +export * from './getBoardIssuesForEpic.mjs'; +export * from './getBoardIssuesForSprint.mjs'; +export * from './getBoardProperty.mjs'; +export * from './getBoardPropertyKeys.mjs'; +export * from './getBuildByKey.mjs'; +export * from './getConfiguration.mjs'; +export * from './getDeploymentByKey.mjs'; +export * from './getDeploymentGatingStatusByKey.mjs'; +export * from './getEpic.mjs'; +export * from './getEpics.mjs'; +export * from './getFeatureFlagById.mjs'; +export * from './getFeaturesForBoard.mjs'; +export * from './getIssue.mjs'; +export * from './getIssueEstimationForBoard.mjs'; +export * from './getIssuesForBacklog.mjs'; +export * from './getIssuesForBoard.mjs'; +export * from './getIssuesForEpic.mjs'; +export * from './getIssuesForSprint.mjs'; +export * from './getIssuesWithoutEpic.mjs'; +export * from './getIssuesWithoutEpicForBoard.mjs'; +export * from './getLinkedWorkspaceById.mjs'; +export * from './getProjects.mjs'; +export * from './getProjectsFull.mjs'; +export * from './getPropertiesKeys.mjs'; +export * from './getProperty.mjs'; +export * from './getQuickFilter.mjs'; +export * from './getRemoteLinkById.mjs'; +export * from './getReportsForBoard.mjs'; +export * from './getRepository.mjs'; +export * from './getSprint.mjs'; +export * from './getVulnerabilityById.mjs'; +export * from './moveIssuesToBacklog.mjs'; +export * from './moveIssuesToBacklogForBoard.mjs'; +export * from './moveIssuesToBoard.mjs'; +export * from './moveIssuesToEpic.mjs'; +export * from './moveIssuesToSprintAndRank.mjs'; +export * from './partiallyUpdateEpic.mjs'; +export * from './partiallyUpdateSprint.mjs'; +export * from './rankEpics.mjs'; +export * from './rankIssues.mjs'; +export * from './removeIssuesFromEpic.mjs'; +export * from './searchEpics.mjs'; +export * from './setBoardProperty.mjs'; +export * from './setProperty.mjs'; +export * from './storeDevelopmentInformation.mjs'; +export * from './submitBuilds.mjs'; +export * from './submitDeployments.mjs'; +export * from './submitFeatureFlags.mjs'; +export * from './submitRemoteLinks.mjs'; +export * from './submitVulnerabilities.mjs'; +export * from './submitWorkspaces.mjs'; +export * from './swapSprint.mjs'; +export * from './toggleFeatures.mjs'; +export * from './updateSprint.mjs'; +export * from './getIncidentById.mjs'; +export * from './deleteIncidentById.mjs'; +export * from './deleteReviewById.mjs'; +export * from './getReviewById.mjs'; +export * from './deleteEntityByProperty.mjs'; +export * from './submitEntity.mjs'; +export * from './getWorkspaces.mjs'; +export * from './deleteWorkspaces.mjs'; +export * from './submitOperationsWorkspaces.mjs'; +export * from './submitComponents.mjs'; +export * from './deleteComponentById.mjs'; +export * from './deleteComponentsByProperty.mjs'; +export * from './getComponentById.mjs'; diff --git a/src/agile/parameters/index.ts b/src/agile/parameters/index.ts deleted file mode 100644 index 060a110180..0000000000 --- a/src/agile/parameters/index.ts +++ /dev/null @@ -1,95 +0,0 @@ -export * from './createBoard'; -export * from './createSprint'; -export * from './deleteBoard'; -export * from './deleteBoardProperty'; -export * from './deleteBuildByKey'; -export * from './deleteBuildsByProperty'; -export * from './deleteByProperties'; -export * from './deleteDeploymentByKey'; -export * from './deleteDeploymentsByProperty'; -export * from './deleteEntity'; -export * from './deleteFeatureFlagById'; -export * from './deleteFeatureFlagsByProperty'; -export * from './deleteLinkedWorkspaces'; -export * from './deleteProperty'; -export * from './deleteRemoteLinkById'; -export * from './deleteRemoteLinksByProperty'; -export * from './deleteRepository'; -export * from './deleteSprint'; -export * from './deleteVulnerabilitiesByProperty'; -export * from './deleteVulnerabilityById'; -export * from './estimateIssueForBoard'; -export * from './existsByProperties'; -export * from './getAllBoards'; -export * from './getAllQuickFilters'; -export * from './getAllSprints'; -export * from './getAllVersions'; -export * from './getBoard'; -export * from './getBoardByFilterId'; -export * from './getBoardIssuesForEpic'; -export * from './getBoardIssuesForSprint'; -export * from './getBoardProperty'; -export * from './getBoardPropertyKeys'; -export * from './getBuildByKey'; -export * from './getConfiguration'; -export * from './getDeploymentByKey'; -export * from './getDeploymentGatingStatusByKey'; -export * from './getEpic'; -export * from './getEpics'; -export * from './getFeatureFlagById'; -export * from './getFeaturesForBoard'; -export * from './getIssue'; -export * from './getIssueEstimationForBoard'; -export * from './getIssuesForBacklog'; -export * from './getIssuesForBoard'; -export * from './getIssuesForEpic'; -export * from './getIssuesForSprint'; -export * from './getIssuesWithoutEpic'; -export * from './getIssuesWithoutEpicForBoard'; -export * from './getLinkedWorkspaceById'; -export * from './getProjects'; -export * from './getProjectsFull'; -export * from './getPropertiesKeys'; -export * from './getProperty'; -export * from './getQuickFilter'; -export * from './getRemoteLinkById'; -export * from './getReportsForBoard'; -export * from './getRepository'; -export * from './getSprint'; -export * from './getVulnerabilityById'; -export * from './moveIssuesToBacklog'; -export * from './moveIssuesToBacklogForBoard'; -export * from './moveIssuesToBoard'; -export * from './moveIssuesToEpic'; -export * from './moveIssuesToSprintAndRank'; -export * from './partiallyUpdateEpic'; -export * from './partiallyUpdateSprint'; -export * from './rankEpics'; -export * from './rankIssues'; -export * from './removeIssuesFromEpic'; -export * from './searchEpics'; -export * from './setBoardProperty'; -export * from './setProperty'; -export * from './storeDevelopmentInformation'; -export * from './submitBuilds'; -export * from './submitDeployments'; -export * from './submitFeatureFlags'; -export * from './submitRemoteLinks'; -export * from './submitVulnerabilities'; -export * from './submitWorkspaces'; -export * from './swapSprint'; -export * from './toggleFeatures'; -export * from './updateSprint'; -export * from './getIncidentById'; -export * from './deleteIncidentById'; -export * from './deleteReviewById'; -export * from './getReviewById'; -export * from './deleteEntityByProperty'; -export * from './submitEntity'; -export * from './getWorkspaces'; -export * from './deleteWorkspaces'; -export * from './submitOperationsWorkspaces'; -export * from './submitComponents'; -export * from './deleteComponentById'; -export * from './deleteComponentsByProperty'; -export * from './getComponentById'; diff --git a/src/agile/parameters/moveIssuesToBacklog.ts b/src/agile/parameters/moveIssuesToBacklog.mts similarity index 100% rename from src/agile/parameters/moveIssuesToBacklog.ts rename to src/agile/parameters/moveIssuesToBacklog.mts diff --git a/src/agile/parameters/moveIssuesToBacklogForBoard.ts b/src/agile/parameters/moveIssuesToBacklogForBoard.mts similarity index 100% rename from src/agile/parameters/moveIssuesToBacklogForBoard.ts rename to src/agile/parameters/moveIssuesToBacklogForBoard.mts diff --git a/src/agile/parameters/moveIssuesToBoard.ts b/src/agile/parameters/moveIssuesToBoard.mts similarity index 100% rename from src/agile/parameters/moveIssuesToBoard.ts rename to src/agile/parameters/moveIssuesToBoard.mts diff --git a/src/agile/parameters/moveIssuesToEpic.ts b/src/agile/parameters/moveIssuesToEpic.mts similarity index 100% rename from src/agile/parameters/moveIssuesToEpic.ts rename to src/agile/parameters/moveIssuesToEpic.mts diff --git a/src/agile/parameters/moveIssuesToSprintAndRank.ts b/src/agile/parameters/moveIssuesToSprintAndRank.mts similarity index 100% rename from src/agile/parameters/moveIssuesToSprintAndRank.ts rename to src/agile/parameters/moveIssuesToSprintAndRank.mts diff --git a/src/agile/parameters/partiallyUpdateEpic.ts b/src/agile/parameters/partiallyUpdateEpic.mts similarity index 100% rename from src/agile/parameters/partiallyUpdateEpic.ts rename to src/agile/parameters/partiallyUpdateEpic.mts diff --git a/src/agile/parameters/partiallyUpdateSprint.ts b/src/agile/parameters/partiallyUpdateSprint.mts similarity index 100% rename from src/agile/parameters/partiallyUpdateSprint.ts rename to src/agile/parameters/partiallyUpdateSprint.mts diff --git a/src/agile/parameters/rankEpics.ts b/src/agile/parameters/rankEpics.mts similarity index 100% rename from src/agile/parameters/rankEpics.ts rename to src/agile/parameters/rankEpics.mts diff --git a/src/agile/parameters/rankIssues.ts b/src/agile/parameters/rankIssues.mts similarity index 100% rename from src/agile/parameters/rankIssues.ts rename to src/agile/parameters/rankIssues.mts diff --git a/src/agile/parameters/removeIssuesFromEpic.ts b/src/agile/parameters/removeIssuesFromEpic.mts similarity index 100% rename from src/agile/parameters/removeIssuesFromEpic.ts rename to src/agile/parameters/removeIssuesFromEpic.mts diff --git a/src/agile/parameters/searchEpics.ts b/src/agile/parameters/searchEpics.mts similarity index 100% rename from src/agile/parameters/searchEpics.ts rename to src/agile/parameters/searchEpics.mts diff --git a/src/agile/parameters/setBoardProperty.ts b/src/agile/parameters/setBoardProperty.mts similarity index 100% rename from src/agile/parameters/setBoardProperty.ts rename to src/agile/parameters/setBoardProperty.mts diff --git a/src/agile/parameters/setProperty.ts b/src/agile/parameters/setProperty.mts similarity index 100% rename from src/agile/parameters/setProperty.ts rename to src/agile/parameters/setProperty.mts diff --git a/src/agile/parameters/storeDevelopmentInformation.ts b/src/agile/parameters/storeDevelopmentInformation.mts similarity index 100% rename from src/agile/parameters/storeDevelopmentInformation.ts rename to src/agile/parameters/storeDevelopmentInformation.mts diff --git a/src/agile/parameters/submitBuilds.ts b/src/agile/parameters/submitBuilds.mts similarity index 100% rename from src/agile/parameters/submitBuilds.ts rename to src/agile/parameters/submitBuilds.mts diff --git a/src/agile/parameters/submitComponents.ts b/src/agile/parameters/submitComponents.mts similarity index 100% rename from src/agile/parameters/submitComponents.ts rename to src/agile/parameters/submitComponents.mts diff --git a/src/agile/parameters/submitDeployments.ts b/src/agile/parameters/submitDeployments.mts similarity index 100% rename from src/agile/parameters/submitDeployments.ts rename to src/agile/parameters/submitDeployments.mts diff --git a/src/agile/parameters/submitEntity.ts b/src/agile/parameters/submitEntity.mts similarity index 100% rename from src/agile/parameters/submitEntity.ts rename to src/agile/parameters/submitEntity.mts diff --git a/src/agile/parameters/submitFeatureFlags.ts b/src/agile/parameters/submitFeatureFlags.mts similarity index 100% rename from src/agile/parameters/submitFeatureFlags.ts rename to src/agile/parameters/submitFeatureFlags.mts diff --git a/src/agile/parameters/submitOperationsWorkspaces.ts b/src/agile/parameters/submitOperationsWorkspaces.mts similarity index 100% rename from src/agile/parameters/submitOperationsWorkspaces.ts rename to src/agile/parameters/submitOperationsWorkspaces.mts diff --git a/src/agile/parameters/submitRemoteLinks.ts b/src/agile/parameters/submitRemoteLinks.mts similarity index 100% rename from src/agile/parameters/submitRemoteLinks.ts rename to src/agile/parameters/submitRemoteLinks.mts diff --git a/src/agile/parameters/submitVulnerabilities.ts b/src/agile/parameters/submitVulnerabilities.mts similarity index 100% rename from src/agile/parameters/submitVulnerabilities.ts rename to src/agile/parameters/submitVulnerabilities.mts diff --git a/src/agile/parameters/submitWorkspaces.ts b/src/agile/parameters/submitWorkspaces.mts similarity index 100% rename from src/agile/parameters/submitWorkspaces.ts rename to src/agile/parameters/submitWorkspaces.mts diff --git a/src/agile/parameters/swapSprint.ts b/src/agile/parameters/swapSprint.mts similarity index 100% rename from src/agile/parameters/swapSprint.ts rename to src/agile/parameters/swapSprint.mts diff --git a/src/agile/parameters/toggleFeatures.ts b/src/agile/parameters/toggleFeatures.mts similarity index 100% rename from src/agile/parameters/toggleFeatures.ts rename to src/agile/parameters/toggleFeatures.mts diff --git a/src/agile/parameters/updateSprint.ts b/src/agile/parameters/updateSprint.mts similarity index 100% rename from src/agile/parameters/updateSprint.ts rename to src/agile/parameters/updateSprint.mts diff --git a/src/agile/remoteLinks.mts b/src/agile/remoteLinks.mts new file mode 100644 index 0000000000..1577551e94 --- /dev/null +++ b/src/agile/remoteLinks.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class RemoteLinks { + constructor(private client: Client) {} + + /** + * Update / insert Remote Link data. + * + * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists + * and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to + * submission. Details of which Remote LInk failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitRemoteLinks( + parameters: Parameters.SubmitRemoteLinks, + callback: Callback, + ): Promise; + /** + * Update / insert Remote Link data. + * + * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists + * and the updateSequenceId of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to + * submission. Details of which Remote LInk failed submission (if any) are available in the response object. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitRemoteLinks( + parameters: Parameters.SubmitRemoteLinks, + callback?: never, + ): Promise; + async submitRemoteLinks( + parameters: Parameters.SubmitRemoteLinks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/remotelinks/1.0/bulk', + method: 'POST', + data: { + properties: parameters.properties, + remoteLinks: parameters.remoteLinks, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Remote Links data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitRemoteLinks` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinksByProperty( + parameters: Parameters.DeleteRemoteLinksByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Remote Links data that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. Optional param + * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that + * matches ALL of the Properties (e.g. treated as an AND). + * + * See the documentation for the `submitRemoteLinks` operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinksByProperty( + parameters: Parameters.DeleteRemoteLinksByProperty, + callback?: never, + ): Promise; + async deleteRemoteLinksByProperty( + parameters: Parameters.DeleteRemoteLinksByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/remotelinks/1.0/bulkByProperties', + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + params: parameters.params, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Remote Link data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getRemoteLinkById( + parameters: Parameters.GetRemoteLinkById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Remote Link data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'READ' scope for Connect apps. + */ + async getRemoteLinkById( + parameters: Parameters.GetRemoteLinkById, + callback?: never, + ): Promise; + async getRemoteLinkById( + parameters: Parameters.GetRemoteLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Remote Link data currently stored for the given ID. + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinkById( + parameters: Parameters.DeleteRemoteLinkById, + callback: Callback, + ): Promise; + /** + * Delete the Remote Link data currently stored for the given ID. + * + * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this + * resource. This resource requires the 'DELETE' scope for Connect apps. + */ + async deleteRemoteLinkById(parameters: Parameters.DeleteRemoteLinkById, callback?: never): Promise; + async deleteRemoteLinkById( + parameters: Parameters.DeleteRemoteLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, + method: 'DELETE', + params: { + _updateSequenceNumber: parameters.updateSequenceNumber, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/remoteLinks.ts b/src/agile/remoteLinks.ts deleted file mode 100644 index 4981626111..0000000000 --- a/src/agile/remoteLinks.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class RemoteLinks { - constructor(private client: Client) {} - - /** - * Update / insert Remote Link data. - * - * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists - * and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to - * submission. Details of which Remote LInk failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitRemoteLinks( - parameters: Parameters.SubmitRemoteLinks, - callback: Callback, - ): Promise; - /** - * Update / insert Remote Link data. - * - * Remote Links are identified by their ID, existing Remote Link data for the same ID will be replaced if it exists - * and the updateSequenceId of existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are - * available within a short period of time, but may take some time during peak load and/or maintenance times. The - * `getRemoteLinkById` operation can be used to confirm that data has been stored successfully (if needed). - * - * In the case of multiple Remote Links being submitted in one request, each is validated individually prior to - * submission. Details of which Remote LInk failed submission (if any) are available in the response object. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitRemoteLinks( - parameters: Parameters.SubmitRemoteLinks, - callback?: never, - ): Promise; - async submitRemoteLinks( - parameters: Parameters.SubmitRemoteLinks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/remotelinks/1.0/bulk', - method: 'POST', - data: { - properties: parameters.properties, - remoteLinks: parameters.remoteLinks, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Remote Links data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitRemoteLinks` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinksByProperty( - parameters: Parameters.DeleteRemoteLinksByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Remote Links data that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. Optional param - * `_updateSequenceNumber` is no longer supported. If more than one Property is provided, data will be deleted that - * matches ALL of the Properties (e.g. treated as an AND). - * - * See the documentation for the `submitRemoteLinks` operation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&repoId=repo-345 - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinksByProperty( - parameters: Parameters.DeleteRemoteLinksByProperty, - callback?: never, - ): Promise; - async deleteRemoteLinksByProperty( - parameters: Parameters.DeleteRemoteLinksByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/remotelinks/1.0/bulkByProperties', - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - params: parameters.params, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Remote Link data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getRemoteLinkById( - parameters: Parameters.GetRemoteLinkById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Remote Link data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'READ' scope for Connect apps. - */ - async getRemoteLinkById( - parameters: Parameters.GetRemoteLinkById, - callback?: never, - ): Promise; - async getRemoteLinkById( - parameters: Parameters.GetRemoteLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Remote Link data currently stored for the given ID. - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinkById( - parameters: Parameters.DeleteRemoteLinkById, - callback: Callback, - ): Promise; - /** - * Delete the Remote Link data currently stored for the given ID. - * - * Deletion is performed asynchronously. The `getRemoteLinkById` operation can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraRemoteLinkInfoProvider` module, and on-premise integrations, can access this - * resource. This resource requires the 'DELETE' scope for Connect apps. - */ - async deleteRemoteLinkById(parameters: Parameters.DeleteRemoteLinkById, callback?: never): Promise; - async deleteRemoteLinkById( - parameters: Parameters.DeleteRemoteLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/remotelinks/1.0/remotelink/${parameters.remoteLinkId}`, - method: 'DELETE', - params: { - _updateSequenceNumber: parameters.updateSequenceNumber, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/securityInformation.mts b/src/agile/securityInformation.mts new file mode 100644 index 0000000000..3737c19e43 --- /dev/null +++ b/src/agile/securityInformation.mts @@ -0,0 +1,322 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class SecurityInformation { + constructor(private client: Client) {} + + /** + * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. + * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback: Callback): Promise; + /** + * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. + * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: never): Promise; + async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/linkedWorkspaces/bulk', + method: 'POST', + data: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all linked Security Workspaces that match the given request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteLinkedWorkspaces( + parameters: Parameters.DeleteLinkedWorkspaces, + callback: Callback, + ): Promise; + /** + * Bulk delete all linked Security Workspaces that match the given request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteLinkedWorkspaces(parameters: Parameters.DeleteLinkedWorkspaces, callback?: never): Promise; + async deleteLinkedWorkspaces( + parameters: Parameters.DeleteLinkedWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/linkedWorkspaces/bulk', + method: 'DELETE', + params: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve all Security Workspaces linked with the Jira site. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaces(callback: Callback): Promise; + /** + * Retrieve all Security Workspaces linked with the Jira site. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaces(callback?: never): Promise; + async getLinkedWorkspaces(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/linkedWorkspaces', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaceById( + parameters: Parameters.GetLinkedWorkspaceById, + callback: Callback, + ): Promise; + /** + * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getLinkedWorkspaceById( + parameters: Parameters.GetLinkedWorkspaceById, + callback?: never, + ): Promise; + async getLinkedWorkspaceById( + parameters: Parameters.GetLinkedWorkspaceById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/security/1.0/linkedWorkspaces/${parameters.workspaceId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update / Insert Vulnerability data. + * + * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it + * exists and the updateSequenceNumber of the existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Most updates are available within a short period of time but may take + * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that + * data has been stored successfully (if needed). + * + * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to + * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. + * + * A maximum of 1000 vulnerabilities can be submitted in one request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitVulnerabilities( + parameters: Parameters.SubmitVulnerabilities, + callback: Callback, + ): Promise; + /** + * Update / Insert Vulnerability data. + * + * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it + * exists and the updateSequenceNumber of the existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Most updates are available within a short period of time but may take + * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that + * data has been stored successfully (if needed). + * + * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to + * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. + * + * A maximum of 1000 vulnerabilities can be submitted in one request. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitVulnerabilities( + parameters: Parameters.SubmitVulnerabilities, + callback?: never, + ): Promise; + async submitVulnerabilities( + parameters: Parameters.SubmitVulnerabilities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/bulk', + method: 'POST', + data: { + operationType: parameters.operationType, + properties: parameters.properties, + vulnerabilities: parameters.vulnerabilities, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Vulnerabilities that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk + * endpoint documentation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilitiesByProperty( + parameters: Parameters.DeleteVulnerabilitiesByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Vulnerabilities that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk + * endpoint documentation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilitiesByProperty( + parameters: Parameters.DeleteVulnerabilitiesByProperty, + callback?: never, + ): Promise; + async deleteVulnerabilitiesByProperty( + parameters: Parameters.DeleteVulnerabilitiesByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/security/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Vulnerability data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getVulnerabilityById( + parameters: Parameters.GetVulnerabilityById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Vulnerability data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getVulnerabilityById( + parameters: Parameters.GetVulnerabilityById, + callback?: never, + ): Promise; + async getVulnerabilityById( + parameters: Parameters.GetVulnerabilityById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Vulnerability data currently stored for the given ID. + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilityById( + parameters: Parameters.DeleteVulnerabilityById, + callback: Callback, + ): Promise; + /** + * Delete the Vulnerability data currently stored for the given ID. + * + * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteVulnerabilityById(parameters: Parameters.DeleteVulnerabilityById, callback?: never): Promise; + async deleteVulnerabilityById( + parameters: Parameters.DeleteVulnerabilityById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/securityInformation.ts b/src/agile/securityInformation.ts deleted file mode 100644 index 36ca396a8e..0000000000 --- a/src/agile/securityInformation.ts +++ /dev/null @@ -1,322 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class SecurityInformation { - constructor(private client: Client) {} - - /** - * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. - * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback: Callback): Promise; - /** - * Insert Security Workspace IDs to establish a relationship between them and the Jira site the app is installed on. - * If a relationship between the workspace ID and Jira already exists then the workspace ID will be ignored and Jira - * will process the rest of the entries. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: never): Promise; - async submitWorkspaces(parameters: Parameters.SubmitWorkspaces, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/linkedWorkspaces/bulk', - method: 'POST', - data: { - workspaceIds: parameters.workspaceIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all linked Security Workspaces that match the given request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteLinkedWorkspaces( - parameters: Parameters.DeleteLinkedWorkspaces, - callback: Callback, - ): Promise; - /** - * Bulk delete all linked Security Workspaces that match the given request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - * - * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 - */ - async deleteLinkedWorkspaces(parameters: Parameters.DeleteLinkedWorkspaces, callback?: never): Promise; - async deleteLinkedWorkspaces( - parameters: Parameters.DeleteLinkedWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/linkedWorkspaces/bulk', - method: 'DELETE', - params: { - workspaceIds: parameters.workspaceIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve all Security Workspaces linked with the Jira site. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaces(callback: Callback): Promise; - /** - * Retrieve all Security Workspaces linked with the Jira site. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaces(callback?: never): Promise; - async getLinkedWorkspaces(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/linkedWorkspaces', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaceById( - parameters: Parameters.GetLinkedWorkspaceById, - callback: Callback, - ): Promise; - /** - * Retrieve a specific Security Workspace linked to the Jira site for the given workspace ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getLinkedWorkspaceById( - parameters: Parameters.GetLinkedWorkspaceById, - callback?: never, - ): Promise; - async getLinkedWorkspaceById( - parameters: Parameters.GetLinkedWorkspaceById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/security/1.0/linkedWorkspaces/${parameters.workspaceId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update / Insert Vulnerability data. - * - * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it - * exists and the updateSequenceNumber of the existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Most updates are available within a short period of time but may take - * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that - * data has been stored successfully (if needed). - * - * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to - * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. - * - * A maximum of 1000 vulnerabilities can be submitted in one request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitVulnerabilities( - parameters: Parameters.SubmitVulnerabilities, - callback: Callback, - ): Promise; - /** - * Update / Insert Vulnerability data. - * - * Vulnerabilities are identified by their ID, any existing Vulnerability data with the same ID will be replaced if it - * exists and the updateSequenceNumber of the existing data is less than the incoming data. - * - * Submissions are performed asynchronously. Most updates are available within a short period of time but may take - * some time during peak load and/or maintenance times. The GET vulnerability endpoint can be used to confirm that - * data has been stored successfully (if needed). - * - * In the case of multiple Vulnerabilities being submitted in one request, each is validated individually prior to - * submission. Details of Vulnerabilities that failed submission (if any) are available in the response object. - * - * A maximum of 1000 vulnerabilities can be submitted in one request. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'WRITE' scope for Connect apps. - */ - async submitVulnerabilities( - parameters: Parameters.SubmitVulnerabilities, - callback?: never, - ): Promise; - async submitVulnerabilities( - parameters: Parameters.SubmitVulnerabilities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/bulk', - method: 'POST', - data: { - operationType: parameters.operationType, - properties: parameters.properties, - vulnerabilities: parameters.vulnerabilities, - providerMetadata: parameters.providerMetadata, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk delete all Vulnerabilities that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk - * endpoint documentation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilitiesByProperty( - parameters: Parameters.DeleteVulnerabilitiesByProperty, - callback: Callback, - ): Promise; - /** - * Bulk delete all Vulnerabilities that match the given request. - * - * One or more query params must be supplied to specify Properties to delete by. If more than one Property is - * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). Read the POST bulk - * endpoint documentation for more details. - * - * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilitiesByProperty( - parameters: Parameters.DeleteVulnerabilitiesByProperty, - callback?: never, - ): Promise; - async deleteVulnerabilitiesByProperty( - parameters: Parameters.DeleteVulnerabilitiesByProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/security/1.0/bulkByProperties', - method: 'DELETE', - params: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Retrieve the currently stored Vulnerability data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getVulnerabilityById( - parameters: Parameters.GetVulnerabilityById, - callback: Callback, - ): Promise; - /** - * Retrieve the currently stored Vulnerability data for the given ID. - * - * The result will be what is currently stored, ignoring any pending updates or deletes. - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'READ' scope for Connect apps. - */ - async getVulnerabilityById( - parameters: Parameters.GetVulnerabilityById, - callback?: never, - ): Promise; - async getVulnerabilityById( - parameters: Parameters.GetVulnerabilityById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete the Vulnerability data currently stored for the given ID. - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilityById( - parameters: Parameters.DeleteVulnerabilityById, - callback: Callback, - ): Promise; - /** - * Delete the Vulnerability data currently stored for the given ID. - * - * Deletion is performed asynchronously. The GET vulnerability endpoint can be used to confirm that data has been - * deleted successfully (if needed). - * - * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource - * requires the 'DELETE' scope for Connect apps. - */ - async deleteVulnerabilityById(parameters: Parameters.DeleteVulnerabilityById, callback?: never): Promise; - async deleteVulnerabilityById( - parameters: Parameters.DeleteVulnerabilityById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/security/1.0/vulnerability/${parameters.vulnerabilityId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/agile/sprint.mts b/src/agile/sprint.mts new file mode 100644 index 0000000000..894fc372ba --- /dev/null +++ b/src/agile/sprint.mts @@ -0,0 +1,357 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Sprint { + constructor(private client: Client) {} + + /** + * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. + * + * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call + * is ignored and instead the last sprint's duration is used to fill the form. + */ + async createSprint(parameters: Parameters.CreateSprint, callback: Callback): Promise; + /** + * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. + * + * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call + * is ignored and instead the last sprint's duration is used to fill the form. + */ + async createSprint(parameters: Parameters.CreateSprint, callback?: never): Promise; + async createSprint( + parameters: Parameters.CreateSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/agile/1.0/sprint', + method: 'POST', + data: { + endDate: parameters.endDate, + goal: parameters.goal, + name: parameters.name, + originBoardId: parameters.originBoardId, + startDate: parameters.startDate, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the + * sprint was created on, or view at least one of the issues in the sprint. + */ + async getSprint(parameters: Parameters.GetSprint, callback: Callback): Promise; + /** + * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the + * sprint was created on, or view at least one of the issues in the sprint. + */ + async getSprint(parameters: Parameters.GetSprint, callback?: never): Promise; + async getSprint(parameters: Parameters.GetSprint, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not + * be updated. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async partiallyUpdateSprint( + parameters: Parameters.PartiallyUpdateSprint, + callback: Callback, + ): Promise; + /** + * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not + * be updated. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async partiallyUpdateSprint( + parameters: Parameters.PartiallyUpdateSprint, + callback?: never, + ): Promise; + async partiallyUpdateSprint( + parameters: Parameters.PartiallyUpdateSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'POST', + data: { + completeDate: parameters.completeDate, + createdDate: parameters.createdDate, + endDate: parameters.endDate, + goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request + * body. Any fields not present in the request JSON will be set to null. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async updateSprint(parameters: Parameters.UpdateSprint, callback: Callback): Promise; + /** + * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request + * body. Any fields not present in the request JSON will be set to null. + * + * Notes: + * + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. + * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and + * have a startDate and endDate set. + * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' + * state. This sets the completeDate to the time of the request. + * - Other changes to state are not allowed. + * - The completeDate field cannot be updated manually. + */ + async updateSprint(parameters: Parameters.UpdateSprint, callback?: never): Promise; + async updateSprint( + parameters: Parameters.UpdateSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'PUT', + data: { + completeDate: parameters.completeDate, + createdDate: parameters.createdDate, + endDate: parameters.endDate, + goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ + async deleteSprint(parameters: Parameters.DeleteSprint, callback: Callback): Promise; + /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ + async deleteSprint(parameters: Parameters.DeleteSprint, callback?: never): Promise; + async deleteSprint(parameters: Parameters.DeleteSprint, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to + * view. By default, the returned issues are ordered by rank. + */ + async getIssuesForSprint( + parameters: Parameters.GetIssuesForSprint, + callback: Callback, + ): Promise; + /** + * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to + * view. By default, the returned issues are ordered by rank. + */ + async getIssuesForSprint( + parameters: Parameters.GetIssuesForSprint, + callback?: never, + ): Promise; + async getIssuesForSprint( + parameters: Parameters.GetIssuesForSprint, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + jql: parameters.jql, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum + * number of issues that can be moved in one operation is 50. + */ + async moveIssuesToSprintAndRank( + parameters: Parameters.MoveIssuesToSprintAndRank, + callback: Callback, + ): Promise; + /** + * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum + * number of issues that can be moved in one operation is 50. + */ + async moveIssuesToSprintAndRank( + parameters: Parameters.MoveIssuesToSprintAndRank, + callback?: never, + ): Promise; + async moveIssuesToSprintAndRank( + parameters: Parameters.MoveIssuesToSprintAndRank, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, + method: 'POST', + data: { + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is + * required to have permissions to view the sprint. + */ + async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback: Callback): Promise; + /** + * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is + * required to have permissions to view the sprint. + */ + async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback?: never): Promise; + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of the property with a given key from the sprint identified by the provided id. The user who + * retrieves the property is required to have permissions to view the sprint. + */ + async getProperty(parameters: Parameters.GetProperty, callback: Callback): Promise; + /** + * Returns the value of the property with a given key from the sprint identified by the provided id. The user who + * retrieves the property is required to have permissions to view the sprint. + */ + async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; + async getProperty(parameters: Parameters.GetProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the specified sprint's property. + * + * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the + * data is required to have permissions to modify the sprint. + */ + async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; + /** + * Sets the value of the specified sprint's property. + * + * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the + * data is required to have permissions to modify the sprint. + */ + async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; + async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes the property from the sprint identified by the id. Ths user removing the property is required to have + * permissions to modify the sprint. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; + /** + * Removes the property from the sprint identified by the id. Ths user removing the property is required to have + * permissions to modify the sprint. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** Swap the position of the sprint with the second sprint. */ + async swapSprint(parameters: Parameters.SwapSprint, callback: Callback): Promise; + /** Swap the position of the sprint with the second sprint. */ + async swapSprint(parameters: Parameters.SwapSprint, callback?: never): Promise; + async swapSprint(parameters: Parameters.SwapSprint, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/agile/1.0/sprint/${parameters.sprintId}/swap`, + method: 'POST', + data: { + sprintToSwapWith: parameters.sprintToSwapWith, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/sprint.ts b/src/agile/sprint.ts deleted file mode 100644 index 83ea97225a..0000000000 --- a/src/agile/sprint.ts +++ /dev/null @@ -1,357 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Client } from '../clients'; -import { Callback } from '../callback'; -import { RequestConfig } from '../requestConfig'; - -export class Sprint { - constructor(private client: Client) {} - - /** - * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. - * - * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call - * is ignored and instead the last sprint's duration is used to fill the form. - */ - async createSprint(parameters: Parameters.CreateSprint, callback: Callback): Promise; - /** - * Creates a future sprint. Sprint name and origin board id are required. Start date, end date, and goal are optional. - * - * Note that the sprint name is trimmed. Also, when starting sprints from the UI, the "endDate" set through this call - * is ignored and instead the last sprint's duration is used to fill the form. - */ - async createSprint(parameters: Parameters.CreateSprint, callback?: never): Promise; - async createSprint( - parameters: Parameters.CreateSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/sprint', - method: 'POST', - data: { - endDate: parameters.endDate, - goal: parameters.goal, - name: parameters.name, - originBoardId: parameters.originBoardId, - startDate: parameters.startDate, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the - * sprint was created on, or view at least one of the issues in the sprint. - */ - async getSprint(parameters: Parameters.GetSprint, callback: Callback): Promise; - /** - * Returns the sprint for a given sprint ID. The sprint will only be returned if the user can view the board that the - * sprint was created on, or view at least one of the issues in the sprint. - */ - async getSprint(parameters: Parameters.GetSprint, callback?: never): Promise; - async getSprint(parameters: Parameters.GetSprint, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not - * be updated. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async partiallyUpdateSprint( - parameters: Parameters.PartiallyUpdateSprint, - callback: Callback, - ): Promise; - /** - * Performs a partial update of a sprint. A partial update means that fields not present in the request JSON will not - * be updated. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async partiallyUpdateSprint( - parameters: Parameters.PartiallyUpdateSprint, - callback?: never, - ): Promise; - async partiallyUpdateSprint( - parameters: Parameters.PartiallyUpdateSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'POST', - data: { - completeDate: parameters.completeDate, - createdDate: parameters.createdDate, - endDate: parameters.endDate, - goal: parameters.goal, - id: parameters.id, - name: parameters.name, - originBoardId: parameters.originBoardId, - self: parameters.self, - startDate: parameters.startDate, - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request - * body. Any fields not present in the request JSON will be set to null. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async updateSprint(parameters: Parameters.UpdateSprint, callback: Callback): Promise; - /** - * Performs a full update of a sprint. A full update means that the result will be exactly the same as the request - * body. Any fields not present in the request JSON will be set to null. - * - * Notes: - * - * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. - * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and - * have a startDate and endDate set. - * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' - * state. This sets the completeDate to the time of the request. - * - Other changes to state are not allowed. - * - The completeDate field cannot be updated manually. - */ - async updateSprint(parameters: Parameters.UpdateSprint, callback?: never): Promise; - async updateSprint( - parameters: Parameters.UpdateSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'PUT', - data: { - completeDate: parameters.completeDate, - createdDate: parameters.createdDate, - endDate: parameters.endDate, - goal: parameters.goal, - id: parameters.id, - name: parameters.name, - originBoardId: parameters.originBoardId, - self: parameters.self, - startDate: parameters.startDate, - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ - async deleteSprint(parameters: Parameters.DeleteSprint, callback: Callback): Promise; - /** Deletes a sprint. Once a sprint is deleted, all open issues in the sprint will be moved to the backlog. */ - async deleteSprint(parameters: Parameters.DeleteSprint, callback?: never): Promise; - async deleteSprint(parameters: Parameters.DeleteSprint, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to - * view. By default, the returned issues are ordered by rank. - */ - async getIssuesForSprint( - parameters: Parameters.GetIssuesForSprint, - callback: Callback, - ): Promise; - /** - * Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to - * view. By default, the returned issues are ordered by rank. - */ - async getIssuesForSprint( - parameters: Parameters.GetIssuesForSprint, - callback?: never, - ): Promise; - async getIssuesForSprint( - parameters: Parameters.GetIssuesForSprint, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - jql: parameters.jql, - validateQuery: parameters.validateQuery, - fields: parameters.fields, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum - * number of issues that can be moved in one operation is 50. - */ - async moveIssuesToSprintAndRank( - parameters: Parameters.MoveIssuesToSprintAndRank, - callback: Callback, - ): Promise; - /** - * Moves issues to a sprint, for a given sprint ID. Issues can only be moved to open or active sprints. The maximum - * number of issues that can be moved in one operation is 50. - */ - async moveIssuesToSprintAndRank( - parameters: Parameters.MoveIssuesToSprintAndRank, - callback?: never, - ): Promise; - async moveIssuesToSprintAndRank( - parameters: Parameters.MoveIssuesToSprintAndRank, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/issue`, - method: 'POST', - data: { - issues: parameters.issues, - rankAfterIssue: parameters.rankAfterIssue, - rankBeforeIssue: parameters.rankBeforeIssue, - rankCustomFieldId: parameters.rankCustomFieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is - * required to have permissions to view the sprint. - */ - async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback: Callback): Promise; - /** - * Returns the keys of all properties for the sprint identified by the id. The user who retrieves the property keys is - * required to have permissions to view the sprint. - */ - async getPropertiesKeys(parameters: Parameters.GetPropertiesKeys, callback?: never): Promise; - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of the property with a given key from the sprint identified by the provided id. The user who - * retrieves the property is required to have permissions to view the sprint. - */ - async getProperty(parameters: Parameters.GetProperty, callback: Callback): Promise; - /** - * Returns the value of the property with a given key from the sprint identified by the provided id. The user who - * retrieves the property is required to have permissions to view the sprint. - */ - async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; - async getProperty(parameters: Parameters.GetProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the specified sprint's property. - * - * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the - * data is required to have permissions to modify the sprint. - */ - async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; - /** - * Sets the value of the specified sprint's property. - * - * You can use this resource to store a custom data against the sprint identified by the id. The user who stores the - * data is required to have permissions to modify the sprint. - */ - async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; - async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes the property from the sprint identified by the id. Ths user removing the property is required to have - * permissions to modify the sprint. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; - /** - * Removes the property from the sprint identified by the id. Ths user removing the property is required to have - * permissions to modify the sprint. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** Swap the position of the sprint with the second sprint. */ - async swapSprint(parameters: Parameters.SwapSprint, callback: Callback): Promise; - /** Swap the position of the sprint with the second sprint. */ - async swapSprint(parameters: Parameters.SwapSprint, callback?: never): Promise; - async swapSprint(parameters: Parameters.SwapSprint, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/agile/1.0/sprint/${parameters.sprintId}/swap`, - method: 'POST', - data: { - sprintToSwapWith: parameters.sprintToSwapWith, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/callback.mts b/src/callback.mts new file mode 100644 index 0000000000..7b25091c05 --- /dev/null +++ b/src/callback.mts @@ -0,0 +1,3 @@ +import type { Config } from '@/config.mjs'; + +export type Callback = (err: Config.Error | null, data?: T) => void; diff --git a/src/callback.ts b/src/callback.ts deleted file mode 100644 index 9bcc05f52a..0000000000 --- a/src/callback.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Config } from './config'; - -export type Callback = (err: Config.Error | null, data?: T) => void; diff --git a/src/clients/baseClient.mts b/src/clients/baseClient.mts new file mode 100644 index 0000000000..db75c86dcf --- /dev/null +++ b/src/clients/baseClient.mts @@ -0,0 +1,165 @@ +import axios, { AxiosInstance, AxiosResponse } from 'axios'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from './client.mjs'; +import type { Config } from '@/config.mjs'; +import { getAuthenticationToken } from '@/services/authenticationService/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; +import { HttpException, isObject } from './httpException.mjs'; + +const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; +const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; +const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check'; + +export class BaseClient implements Client { + private instance: AxiosInstance; + + constructor(protected readonly config: Config) { + try { + // eslint-disable-next-line no-new + new URL(config.host); + } catch (e) { + throw new Error( + "Couldn't parse the host URL. Perhaps you forgot to add 'http://' or 'https://' at the beginning of the URL?", + ); + } + + this.instance = axios.create({ + paramsSerializer: this.paramSerializer.bind(this), + ...config.baseRequestConfig, + baseURL: config.host, + headers: this.removeUndefinedProperties({ + [STRICT_GDPR_FLAG]: config.strictGDPR, + [ATLASSIAN_TOKEN_CHECK_FLAG]: config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined, + ...config.baseRequestConfig?.headers, + }), + }); + } + + protected paramSerializer(parameters: Record): string { + const parts: string[] = []; + + Object.entries(parameters).forEach(([key, value]) => { + if (value === null || typeof value === 'undefined') { + return; + } + + if (Array.isArray(value)) { + // eslint-disable-next-line no-param-reassign + value = value.join(','); + } + + if (value instanceof Date) { + // eslint-disable-next-line no-param-reassign + value = value.toISOString(); + } else if (value !== null && typeof value === 'object') { + // eslint-disable-next-line no-param-reassign + value = JSON.stringify(value); + } else if (value instanceof Function) { + const part = value(); + + // eslint-disable-next-line consistent-return + return part && parts.push(part); + } + + parts.push(`${this.encode(key)}=${this.encode(value)}`); + }); + + return parts.join('&'); + } + + protected encode(value: string) { + return encodeURIComponent(value) + .replace(/%3A/gi, ':') + .replace(/%24/g, '$') + .replace(/%2C/gi, ',') + .replace(/%20/g, '+') + .replace(/%5B/gi, '[') + .replace(/%5D/gi, ']'); + } + + protected removeUndefinedProperties(obj: Record): Record { + return Object.entries(obj) + .filter(([, value]) => typeof value !== 'undefined') + .reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {}); + } + + async sendRequest(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise; + async sendRequest(requestConfig: RequestConfig, callback: Callback, telemetryData?: any): Promise; + async sendRequest(requestConfig: RequestConfig, callback: Callback | never): Promise { + try { + const response = await this.sendRequestFullResponse(requestConfig); + + return this.handleSuccessResponse(response.data, callback); + } catch (e: unknown) { + return this.handleFailedResponse(e, callback); + } + } + + async sendRequestFullResponse(requestConfig: RequestConfig): Promise> { + const modifiedRequestConfig = { + ...requestConfig, + headers: this.removeUndefinedProperties({ + Authorization: await getAuthenticationToken(this.config.authentication), + ...requestConfig.headers, + }), + }; + + return this.instance.request(modifiedRequestConfig); + } + + handleSuccessResponse(response: any, callback?: Callback | never): T | void { + const callbackResponseHandler = callback && ((data: T): void => callback(null, data)); + const defaultResponseHandler = (data: T): T => data; + + const responseHandler = callbackResponseHandler ?? defaultResponseHandler; + + this.config.middlewares?.onResponse?.(response.data); + + return responseHandler(response); + } + + handleFailedResponse(e: unknown, callback?: Callback | never): void { + const err = this.buildErrorHandlingResponse(e); + + const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); + const defaultErrorHandler = (error: Config.Error) => { + throw error; + }; + + const errorHandler = callbackErrorHandler ?? defaultErrorHandler; + + this.config.middlewares?.onError?.(err); + + return errorHandler(err); + } + + private buildErrorHandlingResponse(e: unknown): Config.Error { + if (axios.isAxiosError(e) && e.response) { + return new HttpException( + { + code: e.code, + message: e.message, + data: e.response.data, + status: e.response?.status, + statusText: e.response?.statusText, + }, + e.response.status, + { cause: e }, + ); + } + + if (axios.isAxiosError(e)) { + return e; + } + + if (isObject(e) && isObject((e as Record).response)) { + return new HttpException((e as Record).response); + } + + if (e instanceof Error) { + return new HttpException(e); + } + + return new HttpException('Unknown error occurred.', 500, { cause: e }); + } +} diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts deleted file mode 100644 index 5ade7e0b4b..0000000000 --- a/src/clients/baseClient.ts +++ /dev/null @@ -1,165 +0,0 @@ -import axios, { AxiosInstance, AxiosResponse } from 'axios'; -import type { Callback } from '../callback'; -import type { Client } from './client'; -import type { Config } from '../config'; -import { getAuthenticationToken } from '../services/authenticationService'; -import type { RequestConfig } from '../requestConfig'; -import { HttpException, isObject } from './httpException'; - -const STRICT_GDPR_FLAG = 'x-atlassian-force-account-id'; -const ATLASSIAN_TOKEN_CHECK_FLAG = 'X-Atlassian-Token'; -const ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE = 'no-check'; - -export class BaseClient implements Client { - private instance: AxiosInstance; - - constructor(protected readonly config: Config) { - try { - // eslint-disable-next-line no-new - new URL(config.host); - } catch (e) { - throw new Error( - "Couldn't parse the host URL. Perhaps you forgot to add 'http://' or 'https://' at the beginning of the URL?", - ); - } - - this.instance = axios.create({ - paramsSerializer: this.paramSerializer.bind(this), - ...config.baseRequestConfig, - baseURL: config.host, - headers: this.removeUndefinedProperties({ - [STRICT_GDPR_FLAG]: config.strictGDPR, - [ATLASSIAN_TOKEN_CHECK_FLAG]: config.noCheckAtlassianToken ? ATLASSIAN_TOKEN_CHECK_NOCHECK_VALUE : undefined, - ...config.baseRequestConfig?.headers, - }), - }); - } - - protected paramSerializer(parameters: Record): string { - const parts: string[] = []; - - Object.entries(parameters).forEach(([key, value]) => { - if (value === null || typeof value === 'undefined') { - return; - } - - if (Array.isArray(value)) { - // eslint-disable-next-line no-param-reassign - value = value.join(','); - } - - if (value instanceof Date) { - // eslint-disable-next-line no-param-reassign - value = value.toISOString(); - } else if (value !== null && typeof value === 'object') { - // eslint-disable-next-line no-param-reassign - value = JSON.stringify(value); - } else if (value instanceof Function) { - const part = value(); - - // eslint-disable-next-line consistent-return - return part && parts.push(part); - } - - parts.push(`${this.encode(key)}=${this.encode(value)}`); - }); - - return parts.join('&'); - } - - protected encode(value: string) { - return encodeURIComponent(value) - .replace(/%3A/gi, ':') - .replace(/%24/g, '$') - .replace(/%2C/gi, ',') - .replace(/%20/g, '+') - .replace(/%5B/gi, '[') - .replace(/%5D/gi, ']'); - } - - protected removeUndefinedProperties(obj: Record): Record { - return Object.entries(obj) - .filter(([, value]) => typeof value !== 'undefined') - .reduce((accumulator, [key, value]) => ({ ...accumulator, [key]: value }), {}); - } - - async sendRequest(requestConfig: RequestConfig, callback: never, telemetryData?: any): Promise; - async sendRequest(requestConfig: RequestConfig, callback: Callback, telemetryData?: any): Promise; - async sendRequest(requestConfig: RequestConfig, callback: Callback | never): Promise { - try { - const response = await this.sendRequestFullResponse(requestConfig); - - return this.handleSuccessResponse(response.data, callback); - } catch (e: unknown) { - return this.handleFailedResponse(e, callback); - } - } - - async sendRequestFullResponse(requestConfig: RequestConfig): Promise> { - const modifiedRequestConfig = { - ...requestConfig, - headers: this.removeUndefinedProperties({ - Authorization: await getAuthenticationToken(this.config.authentication), - ...requestConfig.headers, - }), - }; - - return this.instance.request(modifiedRequestConfig); - } - - handleSuccessResponse(response: any, callback?: Callback | never): T | void { - const callbackResponseHandler = callback && ((data: T): void => callback(null, data)); - const defaultResponseHandler = (data: T): T => data; - - const responseHandler = callbackResponseHandler ?? defaultResponseHandler; - - this.config.middlewares?.onResponse?.(response.data); - - return responseHandler(response); - } - - handleFailedResponse(e: unknown, callback?: Callback | never): void { - const err = this.buildErrorHandlingResponse(e); - - const callbackErrorHandler = callback && ((error: Config.Error) => callback(error)); - const defaultErrorHandler = (error: Config.Error) => { - throw error; - }; - - const errorHandler = callbackErrorHandler ?? defaultErrorHandler; - - this.config.middlewares?.onError?.(err); - - return errorHandler(err); - } - - private buildErrorHandlingResponse(e: unknown): Config.Error { - if (axios.isAxiosError(e) && e.response) { - return new HttpException( - { - code: e.code, - message: e.message, - data: e.response.data, - status: e.response?.status, - statusText: e.response?.statusText, - }, - e.response.status, - { cause: e }, - ); - } - - if (axios.isAxiosError(e)) { - return e; - } - - if (isObject(e) && isObject((e as Record).response)) { - return new HttpException((e as Record).response); - } - - if (e instanceof Error) { - return new HttpException(e); - } - - return new HttpException('Unknown error occurred.', 500, { cause: e }); - } -} diff --git a/src/clients/client.mts b/src/clients/client.mts new file mode 100644 index 0000000000..0ec6f7fa7f --- /dev/null +++ b/src/clients/client.mts @@ -0,0 +1,12 @@ +import type { AxiosResponse } from 'axios'; +import type { Callback } from '@/callback.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export interface Client { + sendRequest(requestConfig: RequestConfig, callback?: never, telemetryData?: any): Promise; + sendRequest(requestConfig: RequestConfig, callback?: Callback, telemetryData?: any): Promise; + + sendRequestFullResponse(requestConfig: RequestConfig): Promise>; + handleSuccessResponse(response: any, callback?: Callback | undefined | never): T | void; + handleFailedResponse(e: Error, callback?: Callback | never): void; +} diff --git a/src/clients/client.ts b/src/clients/client.ts deleted file mode 100644 index 2f697f1f6f..0000000000 --- a/src/clients/client.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { AxiosResponse } from 'axios'; -import type { Callback } from '../callback'; -import type { RequestConfig } from '../requestConfig'; - -export interface Client { - sendRequest(requestConfig: RequestConfig, callback?: never, telemetryData?: any): Promise; - sendRequest(requestConfig: RequestConfig, callback?: Callback, telemetryData?: any): Promise; - - sendRequestFullResponse(requestConfig: RequestConfig): Promise>; - handleSuccessResponse(response: any, callback?: Callback | undefined | never): T | void; - handleFailedResponse(e: Error, callback?: Callback | never): void; -} diff --git a/src/clients/httpException.ts b/src/clients/httpException.mts similarity index 100% rename from src/clients/httpException.ts rename to src/clients/httpException.mts diff --git a/src/clients/index.mts b/src/clients/index.mts new file mode 100644 index 0000000000..e466efddd7 --- /dev/null +++ b/src/clients/index.mts @@ -0,0 +1,8 @@ +export * from './baseClient.mjs'; +export * from './client.mjs'; +export * from './httpException.mjs'; + +export { AgileClient, type AgileModels, type AgileParameters } from '../agile/index.mjs'; +export { Version2Client, type Version2Models, type Version2Parameters } from '../version2/index.mjs'; +export { Version3Client, type Version3Models, type Version3Parameters } from '../version3/index.mjs'; +export { ServiceDeskClient, type ServiceDeskModels, type ServiceDeskParameters } from '../serviceDesk/index.mjs'; diff --git a/src/clients/index.ts b/src/clients/index.ts deleted file mode 100644 index 08682970ec..0000000000 --- a/src/clients/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export * from './baseClient'; -export * from './client'; -export * from './httpException'; - -export { AgileClient, AgileModels, AgileParameters } from '../agile'; - -export { Version2Client, Version2Models, Version2Parameters } from '../version2'; - -export { Version3Client, Version3Models, Version3Parameters } from '../version3'; - -export { ServiceDeskClient, ServiceDeskModels, ServiceDeskParameters } from '../serviceDesk'; diff --git a/src/config.mts b/src/config.mts new file mode 100644 index 0000000000..8cb9a7fdf0 --- /dev/null +++ b/src/config.mts @@ -0,0 +1,75 @@ +import type { AxiosError } from 'axios'; +import type { RequestConfig } from '@/requestConfig.mjs'; +import type { UtilityTypes } from '@/utilityTypes.mjs'; +import type { HttpException } from '@/clients/index.mjs'; + +export interface Config { + host: string; + strictGDPR?: boolean; + /** Adds `'X-Atlassian-Token': 'no-check'` to each request header */ + noCheckAtlassianToken?: boolean; + baseRequestConfig?: Config.BaseRequestConfig; + authentication?: Config.Authentication; + middlewares?: Config.Middlewares; +} + +export namespace Config { + export type BaseRequestConfig = RequestConfig; + export type Error = AxiosError | HttpException; + + export type Authentication = UtilityTypes.XOR3< + { + personalAccessToken: Authentication.PersonalAccessToken; + }, + { + basic: Authentication.Basic; + }, + { + oauth2: Authentication.OAuth2; + } + >; + + export interface Middlewares { + onError?: Config.Middlewares.OnErrorHandler; + onResponse?: Config.Middlewares.OnResponseHandler; + } + + export namespace Middlewares { + export type OnErrorHandler = (error: Config.Error) => void; + export type OnResponseHandler = (data: any) => void; + } + + export namespace Authentication { + export type JWT = { + /** The key from the app descriptor. */ + issuer: string; + /** The sharedsecret key received during the app installation handshake */ + secret: string; + /** Token expiry time (default 3 minutes after issuing) */ + expiryTimeSeconds?: number; + }; + + export type Basic = UtilityTypes.XOR< + { + email: string; + apiToken: string; + }, + { + username: string; + password: string; + } + >; + + export interface OAuth { + consumerKey: string; + consumerSecret: string; + accessToken: string; + tokenSecret: string; + } + + export type OAuth2 = { + accessToken: string; + }; + export type PersonalAccessToken = string; + } +} diff --git a/src/config.ts b/src/config.ts deleted file mode 100644 index 5d661c62dc..0000000000 --- a/src/config.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { AxiosError } from 'axios'; -import { RequestConfig } from './requestConfig'; -import { UtilityTypes } from './utilityTypes'; -import { HttpException } from './clients'; - -export interface Config { - host: string; - strictGDPR?: boolean; - /** Adds `'X-Atlassian-Token': 'no-check'` to each request header */ - noCheckAtlassianToken?: boolean; - baseRequestConfig?: Config.BaseRequestConfig; - authentication?: Config.Authentication; - middlewares?: Config.Middlewares; -} - -export namespace Config { - export type BaseRequestConfig = RequestConfig; - export type Error = AxiosError | HttpException; - - export type Authentication = UtilityTypes.XOR3< - { - personalAccessToken: Authentication.PersonalAccessToken; - }, - { - basic: Authentication.Basic; - }, - { - oauth2: Authentication.OAuth2; - } - >; - - export interface Middlewares { - onError?: Config.Middlewares.OnErrorHandler; - onResponse?: Config.Middlewares.OnResponseHandler; - } - - export namespace Middlewares { - export type OnErrorHandler = (error: Config.Error) => void; - export type OnResponseHandler = (data: any) => void; - } - - export namespace Authentication { - export type JWT = { - /** The key from the app descriptor. */ - issuer: string; - /** The sharedsecret key received during the app installation handshake */ - secret: string; - /** Token expiry time (default 3 minutes after issuing) */ - expiryTimeSeconds?: number; - }; - - export type Basic = UtilityTypes.XOR< - { - email: string; - apiToken: string; - }, - { - username: string; - password: string; - } - >; - - export interface OAuth { - consumerKey: string; - consumerSecret: string; - accessToken: string; - tokenSecret: string; - } - - export type OAuth2 = { - accessToken: string; - }; - export type PersonalAccessToken = string; - } -} diff --git a/src/createClient.ts b/src/createClient.ts deleted file mode 100644 index a71bb7b408..0000000000 --- a/src/createClient.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { AgileClient } from './agile'; -import { BaseClient } from './clients'; -import { Config } from './config'; -import { ServiceDeskClient } from './serviceDesk'; -import { Version2Client } from './version2'; -import { Version3Client } from './version3'; - -export enum ClientType { - Agile = 'agile', - Version2 = 'version2', - Version3 = 'version3', - ServiceDesk = 'serviceDesk', -} - -export function createClient(clientType: ClientType.Agile, config: Config): AgileClient; -export function createClient(clientType: ClientType.Version2, config: Config): Version2Client; -export function createClient(clientType: ClientType.Version3, config: Config): Version3Client; -export function createClient(clientType: ClientType, config: Config): BaseClient { - switch (clientType) { - case ClientType.Agile: - return new AgileClient(config); - case ClientType.Version2: - return new Version2Client(config); - case ClientType.Version3: - return new Version3Client(config); - case ClientType.ServiceDesk: - return new ServiceDeskClient(config); - default: - return new BaseClient(config); - } -} diff --git a/src/index.mts b/src/index.mts new file mode 100644 index 0000000000..ecd9a78d51 --- /dev/null +++ b/src/index.mts @@ -0,0 +1,11 @@ +export * from './clients/index.mjs'; +export * from './utilityTypes.mjs'; +export * from './config.mjs'; +export * from './callback.mjs'; +export * from './paginated.mjs'; +export * from './requestConfig.mjs'; + +export * as Agile from './agile/index.mjs'; +export * as Version2 from './version2/index.mjs'; +export * as Version3 from './version3/index.mjs'; +export * as ServiceDesk from './serviceDesk/index.mjs'; diff --git a/src/index.ts b/src/index.ts deleted file mode 100644 index 0ece6d8aaf..0000000000 --- a/src/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './createClient'; -export * from './clients'; -export * from './utilityTypes'; -export * from './config'; -export * from './callback'; -export * from './paginated'; -export * from './requestConfig'; - -export * as Agile from './agile'; -export * as Version2 from './version2'; -export * as Version3 from './version3'; -export * as ServiceDesk from './serviceDesk'; diff --git a/src/paginated.ts b/src/paginated.mts similarity index 100% rename from src/paginated.ts rename to src/paginated.mts diff --git a/src/paramSerializer.ts b/src/paramSerializer.mts similarity index 100% rename from src/paramSerializer.ts rename to src/paramSerializer.mts diff --git a/src/requestConfig.mts b/src/requestConfig.mts new file mode 100644 index 0000000000..256383f9cc --- /dev/null +++ b/src/requestConfig.mts @@ -0,0 +1,3 @@ +import type { AxiosRequestConfig } from 'axios'; + +export type RequestConfig = AxiosRequestConfig; diff --git a/src/requestConfig.ts b/src/requestConfig.ts deleted file mode 100644 index 0bc24c5ac1..0000000000 --- a/src/requestConfig.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { AxiosRequestConfig } from 'axios'; - -export type RequestConfig = AxiosRequestConfig; diff --git a/src/serviceDesk/client/index.ts b/src/serviceDesk/client/index.ts deleted file mode 100644 index c673752cb5..0000000000 --- a/src/serviceDesk/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './serviceDeskClient'; diff --git a/src/serviceDesk/client/serviceDeskClient.mts b/src/serviceDesk/client/serviceDeskClient.mts new file mode 100644 index 0000000000..fadeada805 --- /dev/null +++ b/src/serviceDesk/client/serviceDeskClient.mts @@ -0,0 +1,20 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { Customer } from '@/serviceDesk/customer.mjs'; +import { Info } from '@/serviceDesk/info.mjs'; +import { Insight } from '@/serviceDesk/insight.mjs'; +import { KnowledgeBase } from '@/serviceDesk/knowledgeBase.mjs'; +import { Organization } from '@/serviceDesk/organization.mjs'; +import { Request } from '@/serviceDesk/request.mjs'; +import { RequestType } from '@/serviceDesk/requestType.mjs'; +import { ServiceDesk } from '@/serviceDesk/serviceDesk.mjs'; + +export class ServiceDeskClient extends BaseClient { + customer = new Customer(this); + info = new Info(this); + insights = new Insight(this); + knowledgeBase = new KnowledgeBase(this); + organization = new Organization(this); + request = new Request(this); + requestType = new RequestType(this); + serviceDesk = new ServiceDesk(this); +} diff --git a/src/serviceDesk/client/serviceDeskClient.ts b/src/serviceDesk/client/serviceDeskClient.ts deleted file mode 100644 index c131004659..0000000000 --- a/src/serviceDesk/client/serviceDeskClient.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { BaseClient } from '../../clients'; -import { Customer } from '../customer'; -import { Info } from '../info'; -import { Insight } from '../insight'; -import { KnowledgeBase } from '../knowledgeBase'; -import { Organization } from '../organization'; -import { Request } from '../request'; -import { RequestType } from '../requestType'; -import { ServiceDesk } from '../serviceDesk'; - -export class ServiceDeskClient extends BaseClient { - customer = new Customer(this); - info = new Info(this); - insights = new Insight(this); - knowledgeBase = new KnowledgeBase(this); - organization = new Organization(this); - request = new Request(this); - requestType = new RequestType(this); - serviceDesk = new ServiceDesk(this); -} diff --git a/src/serviceDesk/customer.mts b/src/serviceDesk/customer.mts new file mode 100644 index 0000000000..18f589a6eb --- /dev/null +++ b/src/serviceDesk/customer.mts @@ -0,0 +1,46 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Customer { + constructor(private client: Client) {} + + /** + * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email + * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, + * are automatically generated from the request details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * Administrator Global permission + */ + async createCustomer( + parameters: Parameters.CreateCustomer | undefined, + callback: Callback, + ): Promise; + /** + * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email + * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, + * are automatically generated from the request details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * Administrator Global permission + */ + async createCustomer(parameters?: Parameters.CreateCustomer, callback?: never): Promise; + async createCustomer( + parameters?: Parameters.CreateCustomer, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/customer', + method: 'POST', + data: { + email: parameters?.email, + displayName: parameters?.displayName, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/customer.ts b/src/serviceDesk/customer.ts deleted file mode 100644 index 7f18dc9192..0000000000 --- a/src/serviceDesk/customer.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Customer { - constructor(private client: Client) {} - - /** - * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email - * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, - * are automatically generated from the request details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * Administrator Global permission - */ - async createCustomer( - parameters: Parameters.CreateCustomer | undefined, - callback: Callback, - ): Promise; - /** - * This method adds a customer to the Jira Service Management instance by passing a JSON file including an email - * address and display name. The display name does not need to be unique. The record's identifiers, `name` and `key`, - * are automatically generated from the request details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * Administrator Global permission - */ - async createCustomer(parameters?: Parameters.CreateCustomer, callback?: never): Promise; - async createCustomer( - parameters?: Parameters.CreateCustomer, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/customer', - method: 'POST', - data: { - email: parameters?.email, - displayName: parameters?.displayName, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/index.mts b/src/serviceDesk/index.mts new file mode 100644 index 0000000000..8415ed8f69 --- /dev/null +++ b/src/serviceDesk/index.mts @@ -0,0 +1,12 @@ +export * from './customer.mjs'; +export * from './info.mjs'; +export * from './insight.mjs'; +export * from './knowledgeBase.mjs'; +export * from './organization.mjs'; +export * from './request.mjs'; +export * from './requestType.mjs'; +export * from './serviceDesk.mjs'; + +export * as ServiceDeskModels from './models/index.mjs'; +export * as ServiceDeskParameters from './parameters/index.mjs'; +export * from './client/serviceDeskClient.mjs'; diff --git a/src/serviceDesk/index.ts b/src/serviceDesk/index.ts deleted file mode 100644 index 772d672c79..0000000000 --- a/src/serviceDesk/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * from './customer'; -export * from './info'; -export * from './insight'; -export * from './knowledgeBase'; -export * from './organization'; -export * from './request'; -export * from './requestType'; -export * from './serviceDesk'; - -export * as ServiceDeskModels from './models'; -export * as ServiceDeskParameters from './parameters'; -export * from './client'; diff --git a/src/serviceDesk/info.mts b/src/serviceDesk/info.mts new file mode 100644 index 0000000000..b809186507 --- /dev/null +++ b/src/serviceDesk/info.mts @@ -0,0 +1,33 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Info { + constructor(private client: Client) {} + + /** + * This method retrieves information about the Jira Service Management instance such as software version, builds, and + * related links. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, + * the user does not need to be logged in. + */ + async getInfo(callback: Callback): Promise; + /** + * This method retrieves information about the Jira Service Management instance such as software version, builds, and + * related links. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, + * the user does not need to be logged in. + */ + async getInfo(callback?: never): Promise; + async getInfo(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/info', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/info.ts b/src/serviceDesk/info.ts deleted file mode 100644 index 38dcf22c50..0000000000 --- a/src/serviceDesk/info.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Info { - constructor(private client: Client) {} - - /** - * This method retrieves information about the Jira Service Management instance such as software version, builds, and - * related links. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, - * the user does not need to be logged in. - */ - async getInfo(callback: Callback): Promise; - /** - * This method retrieves information about the Jira Service Management instance such as software version, builds, and - * related links. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: None, - * the user does not need to be logged in. - */ - async getInfo(callback?: never): Promise; - async getInfo(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/info', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/insight.mts b/src/serviceDesk/insight.mts new file mode 100644 index 0000000000..65def6fd0d --- /dev/null +++ b/src/serviceDesk/insight.mts @@ -0,0 +1,45 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Insight { + constructor(private client: Client) {} + + /** + * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST + * APIs](https://developer.atlassian.com/cloud/insight/rest). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getInsightWorkspaces( + parameters: Parameters.GetInsightWorkspaces | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST + * APIs](https://developer.atlassian.com/cloud/insight/rest). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getInsightWorkspaces( + parameters?: Parameters.GetInsightWorkspaces, + callback?: never, + ): Promise; + async getInsightWorkspaces( + parameters?: Parameters.GetInsightWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/insight/workspace', + method: 'GET', + params: { + start: parameters?.start, + limit: parameters?.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/insight.ts b/src/serviceDesk/insight.ts deleted file mode 100644 index 6d7502f65f..0000000000 --- a/src/serviceDesk/insight.ts +++ /dev/null @@ -1,45 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Insight { - constructor(private client: Client) {} - - /** - * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST - * APIs](https://developer.atlassian.com/cloud/insight/rest). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getInsightWorkspaces( - parameters: Parameters.GetInsightWorkspaces | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of Insight workspace IDs. Include a workspace ID in the path to access the [Insight REST - * APIs](https://developer.atlassian.com/cloud/insight/rest). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getInsightWorkspaces( - parameters?: Parameters.GetInsightWorkspaces, - callback?: never, - ): Promise; - async getInsightWorkspaces( - parameters?: Parameters.GetInsightWorkspaces, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/insight/workspace', - method: 'GET', - params: { - start: parameters?.start, - limit: parameters?.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/knowledgeBase.mts b/src/serviceDesk/knowledgeBase.mts new file mode 100644 index 0000000000..a6962e6c62 --- /dev/null +++ b/src/serviceDesk/knowledgeBase.mts @@ -0,0 +1,46 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class KnowledgeBase { + constructor(private client: Client) {} + + /** + * Returns articles which match the given query string across all service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + */ + async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; + /** + * Returns articles which match the given query string across all service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + */ + async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; + async getArticles( + parameters: Parameters.GetArticles, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/knowledgebase/article', + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + query: parameters.query, + highlight: parameters.highlight, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/knowledgeBase.ts b/src/serviceDesk/knowledgeBase.ts deleted file mode 100644 index 6a064b69f2..0000000000 --- a/src/serviceDesk/knowledgeBase.ts +++ /dev/null @@ -1,46 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class KnowledgeBase { - constructor(private client: Client) {} - - /** - * Returns articles which match the given query string across all service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - */ - async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; - /** - * Returns articles which match the given query string across all service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - */ - async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; - async getArticles( - parameters: Parameters.GetArticles, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/knowledgebase/article', - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - query: parameters.query, - highlight: parameters.highlight, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/models/additionalComment.ts b/src/serviceDesk/models/additionalComment.mts similarity index 100% rename from src/serviceDesk/models/additionalComment.ts rename to src/serviceDesk/models/additionalComment.mts diff --git a/src/serviceDesk/models/approval.mts b/src/serviceDesk/models/approval.mts new file mode 100644 index 0000000000..a54b76b12b --- /dev/null +++ b/src/serviceDesk/models/approval.mts @@ -0,0 +1,22 @@ +import { Approver } from './approver.mjs'; +import { Date } from './date.mjs'; +import { SelfLink } from './selfLink.mjs'; + +export interface Approval { + /** ID of the approval. */ + id?: string; + /** Description of the approval being sought or provided. */ + name?: string; + /** Outcome of the approval, based on the approvals provided by all approvers. */ + finalDecision?: string; + /** + * Indicates whether the user making the request is one of the approvers and can respond to the approval (true) or not + * (false). + */ + canAnswerApproval?: boolean; + /** Detailed list of the users who must provide a response to the approval. */ + approvers?: Approver[]; + createdDate?: Date; + completedDate?: Date; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/approval.ts b/src/serviceDesk/models/approval.ts deleted file mode 100644 index 3833c0a051..0000000000 --- a/src/serviceDesk/models/approval.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Approver } from './approver'; -import { Date } from './date'; -import { SelfLink } from './selfLink'; - -export interface Approval { - /** ID of the approval. */ - id?: string; - /** Description of the approval being sought or provided. */ - name?: string; - /** Outcome of the approval, based on the approvals provided by all approvers. */ - finalDecision?: string; - /** - * Indicates whether the user making the request is one of the approvers and can respond to the approval (true) or not - * (false). - */ - canAnswerApproval?: boolean; - /** Detailed list of the users who must provide a response to the approval. */ - approvers?: Approver[]; - createdDate?: Date; - completedDate?: Date; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/approvalDecisionRequest.ts b/src/serviceDesk/models/approvalDecisionRequest.mts similarity index 100% rename from src/serviceDesk/models/approvalDecisionRequest.ts rename to src/serviceDesk/models/approvalDecisionRequest.mts diff --git a/src/serviceDesk/models/approver.mts b/src/serviceDesk/models/approver.mts new file mode 100644 index 0000000000..7cdfcc5e85 --- /dev/null +++ b/src/serviceDesk/models/approver.mts @@ -0,0 +1,7 @@ +import { User } from './user.mjs'; + +export interface Approver { + approver?: User; + /** Decision made by the approver. */ + approverDecision?: string; +} diff --git a/src/serviceDesk/models/approver.ts b/src/serviceDesk/models/approver.ts deleted file mode 100644 index 0688e288ed..0000000000 --- a/src/serviceDesk/models/approver.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { User } from './user'; - -export interface Approver { - approver?: User; - /** Decision made by the approver. */ - approverDecision?: string; -} diff --git a/src/serviceDesk/models/article.mts b/src/serviceDesk/models/article.mts new file mode 100644 index 0000000000..c0c474daa7 --- /dev/null +++ b/src/serviceDesk/models/article.mts @@ -0,0 +1,11 @@ +import { Content } from './content.mjs'; +import { Source } from './source.mjs'; + +export interface Article { + /** Title of the article. */ + title?: string; + /** Excerpt of the article which matches the given query string. */ + excerpt?: string; + source?: Source; + content?: Content; +} diff --git a/src/serviceDesk/models/article.ts b/src/serviceDesk/models/article.ts deleted file mode 100644 index a5088f1850..0000000000 --- a/src/serviceDesk/models/article.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Content } from './content'; -import { Source } from './source'; - -export interface Article { - /** Title of the article. */ - title?: string; - /** Excerpt of the article which matches the given query string. */ - excerpt?: string; - source?: Source; - content?: Content; -} diff --git a/src/serviceDesk/models/attachment.mts b/src/serviceDesk/models/attachment.mts new file mode 100644 index 0000000000..1e33cc5861 --- /dev/null +++ b/src/serviceDesk/models/attachment.mts @@ -0,0 +1,15 @@ +import { AttachmentLink } from './attachmentLink.mjs'; +import { Date } from './date.mjs'; +import { User } from './user.mjs'; + +export interface Attachment { + /** Filename of the item attached. */ + filename?: string; + author?: User; + created?: Date; + /** Size of the attachment in bytes. */ + size?: number; + /** MIME type of the attachment. */ + mimeType?: string; + Links?: AttachmentLink; +} diff --git a/src/serviceDesk/models/attachment.ts b/src/serviceDesk/models/attachment.ts deleted file mode 100644 index 6b27329402..0000000000 --- a/src/serviceDesk/models/attachment.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttachmentLink } from './attachmentLink'; -import { Date } from './date'; -import { User } from './user'; - -export interface Attachment { - /** Filename of the item attached. */ - filename?: string; - author?: User; - created?: Date; - /** Size of the attachment in bytes. */ - size?: number; - /** MIME type of the attachment. */ - mimeType?: string; - Links?: AttachmentLink; -} diff --git a/src/serviceDesk/models/attachmentCreate.mts b/src/serviceDesk/models/attachmentCreate.mts new file mode 100644 index 0000000000..b9d5b76e29 --- /dev/null +++ b/src/serviceDesk/models/attachmentCreate.mts @@ -0,0 +1,9 @@ +import { AdditionalComment } from './additionalComment.mjs'; + +export interface AttachmentCreate { + /** List of IDs for the temporary attachments to be added to the customer request. */ + temporaryAttachmentIds?: string[]; + additionalComment?: AdditionalComment; + /** Indicates whether the attachments are to be public (true) or private/internal (false). */ + public?: boolean; +} diff --git a/src/serviceDesk/models/attachmentCreate.ts b/src/serviceDesk/models/attachmentCreate.ts deleted file mode 100644 index c333a767ec..0000000000 --- a/src/serviceDesk/models/attachmentCreate.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AdditionalComment } from './additionalComment'; - -export interface AttachmentCreate { - /** List of IDs for the temporary attachments to be added to the customer request. */ - temporaryAttachmentIds?: string[]; - additionalComment?: AdditionalComment; - /** Indicates whether the attachments are to be public (true) or private/internal (false). */ - public?: boolean; -} diff --git a/src/serviceDesk/models/attachmentCreateResult.mts b/src/serviceDesk/models/attachmentCreateResult.mts new file mode 100644 index 0000000000..55613ebb2e --- /dev/null +++ b/src/serviceDesk/models/attachmentCreateResult.mts @@ -0,0 +1,7 @@ +import type { Comment } from './comment.mjs'; +import { PagedAttachment } from './pagedAttachment.mjs'; + +export interface AttachmentCreateResult { + comment?: Comment; + attachments?: PagedAttachment; +} diff --git a/src/serviceDesk/models/attachmentCreateResult.ts b/src/serviceDesk/models/attachmentCreateResult.ts deleted file mode 100644 index f395d51561..0000000000 --- a/src/serviceDesk/models/attachmentCreateResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Comment } from './comment'; -import { PagedAttachment } from './pagedAttachment'; - -export interface AttachmentCreateResult { - comment?: Comment; - attachments?: PagedAttachment; -} diff --git a/src/serviceDesk/models/attachmentLink.ts b/src/serviceDesk/models/attachmentLink.mts similarity index 100% rename from src/serviceDesk/models/attachmentLink.ts rename to src/serviceDesk/models/attachmentLink.mts diff --git a/src/serviceDesk/models/avatarUrls.ts b/src/serviceDesk/models/avatarUrls.mts similarity index 100% rename from src/serviceDesk/models/avatarUrls.ts rename to src/serviceDesk/models/avatarUrls.mts diff --git a/src/serviceDesk/models/comment.mts b/src/serviceDesk/models/comment.mts new file mode 100644 index 0000000000..d0d0f62d68 --- /dev/null +++ b/src/serviceDesk/models/comment.mts @@ -0,0 +1,21 @@ +import { Date } from './date.mjs'; +import { PagedAttachment } from './pagedAttachment.mjs'; +import { RenderedValue } from './renderedValue.mjs'; +import { SelfLink } from './selfLink.mjs'; +import { User } from './user.mjs'; + +export interface Comment { + /** ID of the comment. */ + id?: string; + /** Content of the comment. */ + body?: string; + renderedBody?: RenderedValue; + author?: User; + created?: Date; + attachments?: PagedAttachment; + /** List of items that can be expanded in the response by specifying the expand query parameter. */ + Expands?: string[]; + /** Indicates whether the comment is public (true) or private/internal (false). */ + public?: boolean; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/comment.ts b/src/serviceDesk/models/comment.ts deleted file mode 100644 index 161a68ca8f..0000000000 --- a/src/serviceDesk/models/comment.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Date } from './date'; -import { PagedAttachment } from './pagedAttachment'; -import { RenderedValue } from './renderedValue'; -import { SelfLink } from './selfLink'; -import { User } from './user'; - -export interface Comment { - /** ID of the comment. */ - id?: string; - /** Content of the comment. */ - body?: string; - renderedBody?: RenderedValue; - author?: User; - created?: Date; - attachments?: PagedAttachment; - /** List of items that can be expanded in the response by specifying the expand query parameter. */ - Expands?: string[]; - /** Indicates whether the comment is public (true) or private/internal (false). */ - public?: boolean; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/commentCreate.ts b/src/serviceDesk/models/commentCreate.mts similarity index 100% rename from src/serviceDesk/models/commentCreate.ts rename to src/serviceDesk/models/commentCreate.mts diff --git a/src/serviceDesk/models/content.ts b/src/serviceDesk/models/content.mts similarity index 100% rename from src/serviceDesk/models/content.ts rename to src/serviceDesk/models/content.mts diff --git a/src/serviceDesk/models/csatFeedbackFull.mts b/src/serviceDesk/models/csatFeedbackFull.mts new file mode 100644 index 0000000000..1fccccf045 --- /dev/null +++ b/src/serviceDesk/models/csatFeedbackFull.mts @@ -0,0 +1,9 @@ +import { AdditionalComment } from './additionalComment.mjs'; + +export interface CsatFeedbackFull { + /** Indicates the type of feedback, supported values: `csat`. */ + type?: string; + /** A numeric representation of the rating, this must be an integer value between 1 and 5. */ + rating?: number; + comment?: AdditionalComment; +} diff --git a/src/serviceDesk/models/csatFeedbackFull.ts b/src/serviceDesk/models/csatFeedbackFull.ts deleted file mode 100644 index 28f375bee8..0000000000 --- a/src/serviceDesk/models/csatFeedbackFull.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AdditionalComment } from './additionalComment'; - -export interface CsatFeedbackFull { - /** Indicates the type of feedback, supported values: `csat`. */ - type?: string; - /** A numeric representation of the rating, this must be an integer value between 1 and 5. */ - rating?: number; - comment?: AdditionalComment; -} diff --git a/src/serviceDesk/models/customerCreate.ts b/src/serviceDesk/models/customerCreate.mts similarity index 100% rename from src/serviceDesk/models/customerCreate.ts rename to src/serviceDesk/models/customerCreate.mts diff --git a/src/serviceDesk/models/customerRequest.mts b/src/serviceDesk/models/customerRequest.mts new file mode 100644 index 0000000000..b1c51999f8 --- /dev/null +++ b/src/serviceDesk/models/customerRequest.mts @@ -0,0 +1,40 @@ +import { CustomerRequestActions } from './customerRequestActions.mjs'; +import { CustomerRequestFieldValue } from './customerRequestFieldValue.mjs'; +import { CustomerRequestLink } from './customerRequestLink.mjs'; +import { CustomerRequestStatus } from './customerRequestStatus.mjs'; +import { Date } from './date.mjs'; +import { PagedAttachment } from './pagedAttachment.mjs'; +import { PagedComment } from './pagedComment.mjs'; +import { PagedCustomerRequestStatus } from './pagedCustomerRequestStatus.mjs'; +import { PagedSlaInformation } from './pagedSlaInformation.mjs'; +import { PagedUser } from './pagedUser.mjs'; +import { RequestType } from './requestType.mjs'; +import { ServiceDesk } from './serviceDesk.mjs'; +import { User } from './user.mjs'; + +export interface CustomerRequest { + /** ID of the request, as the peer issue ID. */ + issueId?: string; + /** Key of the request, as the peer issue key. */ + issueKey?: string; + /** ID of the request type for the request. */ + requestTypeId?: string; + requestType?: RequestType; + /** ID of the service desk the request belongs to. */ + serviceDeskId?: string; + serviceDesk?: ServiceDesk; + createdDate?: Date; + reporter?: User; + /** JSON map of Jira field IDs and their values representing the content of the request. */ + requestFieldValues?: CustomerRequestFieldValue[]; + currentStatus?: CustomerRequestStatus; + status?: PagedCustomerRequestStatus; + participants?: PagedUser; + sla?: PagedSlaInformation; + attachments?: PagedAttachment; + comments?: PagedComment; + actions?: CustomerRequestActions; + /** List of items that can be expanded in the response by specifying the expand query parameter. */ + Expands?: string[]; + Links?: CustomerRequestLink; +} diff --git a/src/serviceDesk/models/customerRequest.ts b/src/serviceDesk/models/customerRequest.ts deleted file mode 100644 index 257efa3309..0000000000 --- a/src/serviceDesk/models/customerRequest.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { CustomerRequestActions } from './customerRequestActions'; -import { CustomerRequestFieldValue } from './customerRequestFieldValue'; -import { CustomerRequestLink } from './customerRequestLink'; -import { CustomerRequestStatus } from './customerRequestStatus'; -import { Date } from './date'; -import { PagedAttachment } from './pagedAttachment'; -import { PagedComment } from './pagedComment'; -import { PagedCustomerRequestStatus } from './pagedCustomerRequestStatus'; -import { PagedSlaInformation } from './pagedSlaInformation'; -import { PagedUser } from './pagedUser'; -import { RequestType } from './requestType'; -import { ServiceDesk } from './serviceDesk'; -import { User } from './user'; - -export interface CustomerRequest { - /** ID of the request, as the peer issue ID. */ - issueId?: string; - /** Key of the request, as the peer issue key. */ - issueKey?: string; - /** ID of the request type for the request. */ - requestTypeId?: string; - requestType?: RequestType; - /** ID of the service desk the request belongs to. */ - serviceDeskId?: string; - serviceDesk?: ServiceDesk; - createdDate?: Date; - reporter?: User; - /** JSON map of Jira field IDs and their values representing the content of the request. */ - requestFieldValues?: CustomerRequestFieldValue[]; - currentStatus?: CustomerRequestStatus; - status?: PagedCustomerRequestStatus; - participants?: PagedUser; - sla?: PagedSlaInformation; - attachments?: PagedAttachment; - comments?: PagedComment; - actions?: CustomerRequestActions; - /** List of items that can be expanded in the response by specifying the expand query parameter. */ - Expands?: string[]; - Links?: CustomerRequestLink; -} diff --git a/src/serviceDesk/models/customerRequestAction.ts b/src/serviceDesk/models/customerRequestAction.mts similarity index 100% rename from src/serviceDesk/models/customerRequestAction.ts rename to src/serviceDesk/models/customerRequestAction.mts diff --git a/src/serviceDesk/models/customerRequestActions.mts b/src/serviceDesk/models/customerRequestActions.mts new file mode 100644 index 0000000000..f6fae6bd1f --- /dev/null +++ b/src/serviceDesk/models/customerRequestActions.mts @@ -0,0 +1,8 @@ +import { CustomerRequestAction } from './customerRequestAction.mjs'; + +export interface CustomerRequestActions { + addAttachment?: CustomerRequestAction; + addComment?: CustomerRequestAction; + addParticipant?: CustomerRequestAction; + removeParticipant?: CustomerRequestAction; +} diff --git a/src/serviceDesk/models/customerRequestActions.ts b/src/serviceDesk/models/customerRequestActions.ts deleted file mode 100644 index 6499a26a4c..0000000000 --- a/src/serviceDesk/models/customerRequestActions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CustomerRequestAction } from './customerRequestAction'; - -export interface CustomerRequestActions { - addAttachment?: CustomerRequestAction; - addComment?: CustomerRequestAction; - addParticipant?: CustomerRequestAction; - removeParticipant?: CustomerRequestAction; -} diff --git a/src/serviceDesk/models/customerRequestCreateMeta.mts b/src/serviceDesk/models/customerRequestCreateMeta.mts new file mode 100644 index 0000000000..8232df1f43 --- /dev/null +++ b/src/serviceDesk/models/customerRequestCreateMeta.mts @@ -0,0 +1,10 @@ +import { RequestTypeField } from './requestTypeField.mjs'; + +export interface CustomerRequestCreateMeta { + /** List of the fields included in this request. */ + requestTypeFields?: RequestTypeField[]; + /** Flag indicating if a request can be raised on behalf of another user (true) or not. */ + canRaiseOnBehalfOf?: boolean; + /** Flag indicating if participants can be added to a request (true) or not. */ + canAddRequestParticipants?: boolean; +} diff --git a/src/serviceDesk/models/customerRequestCreateMeta.ts b/src/serviceDesk/models/customerRequestCreateMeta.ts deleted file mode 100644 index 2d7458030b..0000000000 --- a/src/serviceDesk/models/customerRequestCreateMeta.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { RequestTypeField } from './requestTypeField'; - -export interface CustomerRequestCreateMeta { - /** List of the fields included in this request. */ - requestTypeFields?: RequestTypeField[]; - /** Flag indicating if a request can be raised on behalf of another user (true) or not. */ - canRaiseOnBehalfOf?: boolean; - /** Flag indicating if participants can be added to a request (true) or not. */ - canAddRequestParticipants?: boolean; -} diff --git a/src/serviceDesk/models/customerRequestFieldValue.ts b/src/serviceDesk/models/customerRequestFieldValue.mts similarity index 100% rename from src/serviceDesk/models/customerRequestFieldValue.ts rename to src/serviceDesk/models/customerRequestFieldValue.mts diff --git a/src/serviceDesk/models/customerRequestLink.ts b/src/serviceDesk/models/customerRequestLink.mts similarity index 100% rename from src/serviceDesk/models/customerRequestLink.ts rename to src/serviceDesk/models/customerRequestLink.mts diff --git a/src/serviceDesk/models/customerRequestStatus.mts b/src/serviceDesk/models/customerRequestStatus.mts new file mode 100644 index 0000000000..7876bd7978 --- /dev/null +++ b/src/serviceDesk/models/customerRequestStatus.mts @@ -0,0 +1,9 @@ +import { Date } from './date.mjs'; + +export interface CustomerRequestStatus { + /** Name of the status condition. */ + status?: string; + /** Status category the status belongs to. */ + statusCategory?: string; + statusDate?: Date; +} diff --git a/src/serviceDesk/models/customerRequestStatus.ts b/src/serviceDesk/models/customerRequestStatus.ts deleted file mode 100644 index 8d108b4cf7..0000000000 --- a/src/serviceDesk/models/customerRequestStatus.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Date } from './date'; - -export interface CustomerRequestStatus { - /** Name of the status condition. */ - status?: string; - /** Status category the status belongs to. */ - statusCategory?: string; - statusDate?: Date; -} diff --git a/src/serviceDesk/models/customerTransition.ts b/src/serviceDesk/models/customerTransition.mts similarity index 100% rename from src/serviceDesk/models/customerTransition.ts rename to src/serviceDesk/models/customerTransition.mts diff --git a/src/serviceDesk/models/customerTransitionExecution.mts b/src/serviceDesk/models/customerTransitionExecution.mts new file mode 100644 index 0000000000..cb56fef14d --- /dev/null +++ b/src/serviceDesk/models/customerTransitionExecution.mts @@ -0,0 +1,7 @@ +import { AdditionalComment } from './additionalComment.mjs'; + +export interface CustomerTransitionExecution { + /** ID of the transition to be performed. */ + id?: string; + additionalComment?: AdditionalComment; +} diff --git a/src/serviceDesk/models/customerTransitionExecution.ts b/src/serviceDesk/models/customerTransitionExecution.ts deleted file mode 100644 index 6f1798e4a6..0000000000 --- a/src/serviceDesk/models/customerTransitionExecution.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AdditionalComment } from './additionalComment'; - -export interface CustomerTransitionExecution { - /** ID of the transition to be performed. */ - id?: string; - additionalComment?: AdditionalComment; -} diff --git a/src/serviceDesk/models/date.ts b/src/serviceDesk/models/date.mts similarity index 100% rename from src/serviceDesk/models/date.ts rename to src/serviceDesk/models/date.mts diff --git a/src/serviceDesk/models/duration.ts b/src/serviceDesk/models/duration.mts similarity index 100% rename from src/serviceDesk/models/duration.ts rename to src/serviceDesk/models/duration.mts diff --git a/src/serviceDesk/models/entityProperty.ts b/src/serviceDesk/models/entityProperty.mts similarity index 100% rename from src/serviceDesk/models/entityProperty.ts rename to src/serviceDesk/models/entityProperty.mts diff --git a/src/serviceDesk/models/index.mts b/src/serviceDesk/models/index.mts new file mode 100644 index 0000000000..26d2ac4369 --- /dev/null +++ b/src/serviceDesk/models/index.mts @@ -0,0 +1,79 @@ +export * from './additionalComment.mjs'; +export * from './approval.mjs'; +export * from './approvalDecisionRequest.mjs'; +export * from './approver.mjs'; +export * from './article.mjs'; +export * from './attachment.mjs'; +export * from './attachmentCreate.mjs'; +export * from './attachmentCreateResult.mjs'; +export * from './attachmentLink.mjs'; +export * from './avatarUrls.mjs'; +export * from './comment.mjs'; +export * from './commentCreate.mjs'; +export * from './content.mjs'; +export * from './csatFeedbackFull.mjs'; +export * from './customerCreate.mjs'; +export * from './customerRequest.mjs'; +export * from './customerRequestAction.mjs'; +export * from './customerRequestActions.mjs'; +export * from './customerRequestCreateMeta.mjs'; +export * from './customerRequestFieldValue.mjs'; +export * from './customerRequestLink.mjs'; +export * from './customerRequestStatus.mjs'; +export * from './customerTransition.mjs'; +export * from './customerTransitionExecution.mjs'; +export * from './date.mjs'; +export * from './duration.mjs'; +export * from './entityProperty.mjs'; +export * from './insightWorkspace.mjs'; +export * from './issue.mjs'; +export * from './issueTransition.mjs'; +export * from './jsonType.mjs'; +export * from './organization.mjs'; +export * from './organizationCreate.mjs'; +export * from './organizationServiceDeskUpdate.mjs'; +export * from './pagedApproval.mjs'; +export * from './pagedArticle.mjs'; +export * from './pagedAttachment.mjs'; +export * from './pagedComment.mjs'; +export * from './pagedCustomerRequest.mjs'; +export * from './pagedCustomerRequestStatus.mjs'; +export * from './pagedCustomerTransition.mjs'; +export * from './pagedInsightWorkspace.mjs'; +export * from './pagedIssue.mjs'; +export * from './pagedLink.mjs'; +export * from './pagedOrganization.mjs'; +export * from './pagedQueue.mjs'; +export * from './pagedRequestType.mjs'; +export * from './pagedRequestTypeGroup.mjs'; +export * from './pagedServiceDesk.mjs'; +export * from './pagedSlaInformation.mjs'; +export * from './pagedUser.mjs'; +export * from './propertyKey.mjs'; +export * from './propertyKeys.mjs'; +export * from './queue.mjs'; +export * from './renderedValue.mjs'; +export * from './requestCreate.mjs'; +export * from './requestNotificationSubscription.mjs'; +export * from './requestParticipantUpdate.mjs'; +export * from './requestType.mjs'; +export * from './requestTypeCreate.mjs'; +export * from './requestTypeField.mjs'; +export * from './requestTypeFieldValue.mjs'; +export * from './requestTypeGroup.mjs'; +export * from './requestTypeIcon.mjs'; +export * from './requestTypeIconLink.mjs'; +export * from './selfLink.mjs'; +export * from './serviceDesk.mjs'; +export * from './serviceDeskCustomer.mjs'; +export * from './slaInformation.mjs'; +export * from './slaInformationCompletedCycle.mjs'; +export * from './slaInformationOngoingCycle.mjs'; +export * from './softwareInfo.mjs'; +export * from './source.mjs'; +export * from './statusCategory.mjs'; +export * from './statusDetails.mjs'; +export * from './user.mjs'; +export * from './userDetails.mjs'; +export * from './userLink.mjs'; +export * from './usersOrganizationUpdate.mjs'; diff --git a/src/serviceDesk/models/index.ts b/src/serviceDesk/models/index.ts deleted file mode 100644 index 3d5914ce1d..0000000000 --- a/src/serviceDesk/models/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -export * from './additionalComment'; -export * from './approval'; -export * from './approvalDecisionRequest'; -export * from './approver'; -export * from './article'; -export * from './attachment'; -export * from './attachmentCreate'; -export * from './attachmentCreateResult'; -export * from './attachmentLink'; -export * from './avatarUrls'; -export * from './comment'; -export * from './commentCreate'; -export * from './content'; -export * from './csatFeedbackFull'; -export * from './customerCreate'; -export * from './customerRequest'; -export * from './customerRequestAction'; -export * from './customerRequestActions'; -export * from './customerRequestCreateMeta'; -export * from './customerRequestFieldValue'; -export * from './customerRequestLink'; -export * from './customerRequestStatus'; -export * from './customerTransition'; -export * from './customerTransitionExecution'; -export * from './date'; -export * from './duration'; -export * from './entityProperty'; -export * from './insightWorkspace'; -export * from './issue'; -export * from './issueTransition'; -export * from './jsonType'; -export * from './organization'; -export * from './organizationCreate'; -export * from './organizationServiceDeskUpdate'; -export * from './pagedApproval'; -export * from './pagedArticle'; -export * from './pagedAttachment'; -export * from './pagedComment'; -export * from './pagedCustomerRequest'; -export * from './pagedCustomerRequestStatus'; -export * from './pagedCustomerTransition'; -export * from './pagedInsightWorkspace'; -export * from './pagedIssue'; -export * from './pagedLink'; -export * from './pagedOrganization'; -export * from './pagedQueue'; -export * from './pagedRequestType'; -export * from './pagedRequestTypeGroup'; -export * from './pagedServiceDesk'; -export * from './pagedSlaInformation'; -export * from './pagedUser'; -export * from './propertyKey'; -export * from './propertyKeys'; -export * from './queue'; -export * from './renderedValue'; -export * from './requestCreate'; -export * from './requestNotificationSubscription'; -export * from './requestParticipantUpdate'; -export * from './requestType'; -export * from './requestTypeCreate'; -export * from './requestTypeField'; -export * from './requestTypeFieldValue'; -export * from './requestTypeGroup'; -export * from './requestTypeIcon'; -export * from './requestTypeIconLink'; -export * from './selfLink'; -export * from './serviceDesk'; -export * from './serviceDeskCustomer'; -export * from './slaInformation'; -export * from './slaInformationCompletedCycle'; -export * from './slaInformationOngoingCycle'; -export * from './softwareInfo'; -export * from './source'; -export * from './statusCategory'; -export * from './statusDetails'; -export * from './user'; -export * from './userDetails'; -export * from './userLink'; -export * from './usersOrganizationUpdate'; diff --git a/src/serviceDesk/models/insightWorkspace.ts b/src/serviceDesk/models/insightWorkspace.mts similarity index 100% rename from src/serviceDesk/models/insightWorkspace.ts rename to src/serviceDesk/models/insightWorkspace.mts diff --git a/src/serviceDesk/models/issue.mts b/src/serviceDesk/models/issue.mts new file mode 100644 index 0000000000..46cbd38e29 --- /dev/null +++ b/src/serviceDesk/models/issue.mts @@ -0,0 +1,4 @@ +import { Issue as ExternalIssueInterface } from '../../version2/models/issue.mjs'; + +/** Details about an issue. */ +export type Issue = ExternalIssueInterface; diff --git a/src/serviceDesk/models/issue.ts b/src/serviceDesk/models/issue.ts deleted file mode 100644 index cfa482d364..0000000000 --- a/src/serviceDesk/models/issue.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Issue as ExternalIssueInterface } from '../../version2/models/issue'; - -/** Details about an issue. */ -export type Issue = ExternalIssueInterface; diff --git a/src/serviceDesk/models/issueTransition.mts b/src/serviceDesk/models/issueTransition.mts new file mode 100644 index 0000000000..c9b9cf107b --- /dev/null +++ b/src/serviceDesk/models/issueTransition.mts @@ -0,0 +1,28 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** The name of the issue transition. */ + name?: string; + to?: StatusDetails; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Expand options that include additional transition details in the response. */ + expand?: string; + looped?: boolean; +} diff --git a/src/serviceDesk/models/issueTransition.ts b/src/serviceDesk/models/issueTransition.ts deleted file mode 100644 index dc7f8afd37..0000000000 --- a/src/serviceDesk/models/issueTransition.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { StatusDetails } from './statusDetails'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/serviceDesk/models/jsonType.ts b/src/serviceDesk/models/jsonType.mts similarity index 100% rename from src/serviceDesk/models/jsonType.ts rename to src/serviceDesk/models/jsonType.mts diff --git a/src/serviceDesk/models/organization.mts b/src/serviceDesk/models/organization.mts new file mode 100644 index 0000000000..e4a5050522 --- /dev/null +++ b/src/serviceDesk/models/organization.mts @@ -0,0 +1,9 @@ +import { SelfLink } from './selfLink.mjs'; + +export interface Organization { + /** A unique system generated ID for the organization. */ + id?: string; + /** Name of the organization. */ + name?: string; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/organization.ts b/src/serviceDesk/models/organization.ts deleted file mode 100644 index 7e6748dfd6..0000000000 --- a/src/serviceDesk/models/organization.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { SelfLink } from './selfLink'; - -export interface Organization { - /** A unique system generated ID for the organization. */ - id?: string; - /** Name of the organization. */ - name?: string; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/organizationCreate.ts b/src/serviceDesk/models/organizationCreate.mts similarity index 100% rename from src/serviceDesk/models/organizationCreate.ts rename to src/serviceDesk/models/organizationCreate.mts diff --git a/src/serviceDesk/models/organizationServiceDeskUpdate.ts b/src/serviceDesk/models/organizationServiceDeskUpdate.mts similarity index 100% rename from src/serviceDesk/models/organizationServiceDeskUpdate.ts rename to src/serviceDesk/models/organizationServiceDeskUpdate.mts diff --git a/src/serviceDesk/models/pagedApproval.mts b/src/serviceDesk/models/pagedApproval.mts new file mode 100644 index 0000000000..95046498b3 --- /dev/null +++ b/src/serviceDesk/models/pagedApproval.mts @@ -0,0 +1,17 @@ +import { Approval } from './approval.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedApproval { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Approval[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedApproval.ts b/src/serviceDesk/models/pagedApproval.ts deleted file mode 100644 index 0fb81fd0df..0000000000 --- a/src/serviceDesk/models/pagedApproval.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Approval } from './approval'; -import { PagedLink } from './pagedLink'; - -export interface PagedApproval { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Approval[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedArticle.mts b/src/serviceDesk/models/pagedArticle.mts new file mode 100644 index 0000000000..df80658726 --- /dev/null +++ b/src/serviceDesk/models/pagedArticle.mts @@ -0,0 +1,17 @@ +import { Article } from './article.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedArticle { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Article[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedArticle.ts b/src/serviceDesk/models/pagedArticle.ts deleted file mode 100644 index 4ae5ec5444..0000000000 --- a/src/serviceDesk/models/pagedArticle.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Article } from './article'; -import { PagedLink } from './pagedLink'; - -export interface PagedArticle { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Article[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedAttachment.mts b/src/serviceDesk/models/pagedAttachment.mts new file mode 100644 index 0000000000..ccff8f75bf --- /dev/null +++ b/src/serviceDesk/models/pagedAttachment.mts @@ -0,0 +1,17 @@ +import type { Attachment } from './attachment.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedAttachment { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Attachment[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedAttachment.ts b/src/serviceDesk/models/pagedAttachment.ts deleted file mode 100644 index 2e6c9d6385..0000000000 --- a/src/serviceDesk/models/pagedAttachment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Attachment } from './attachment'; -import { PagedLink } from './pagedLink'; - -export interface PagedAttachment { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Attachment[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedComment.mts b/src/serviceDesk/models/pagedComment.mts new file mode 100644 index 0000000000..d7e3a90e50 --- /dev/null +++ b/src/serviceDesk/models/pagedComment.mts @@ -0,0 +1,17 @@ +import type { Comment } from './comment.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedComment { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Comment[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedComment.ts b/src/serviceDesk/models/pagedComment.ts deleted file mode 100644 index ede838c2d7..0000000000 --- a/src/serviceDesk/models/pagedComment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Comment } from './comment'; -import { PagedLink } from './pagedLink'; - -export interface PagedComment { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Comment[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedCustomerRequest.mts b/src/serviceDesk/models/pagedCustomerRequest.mts new file mode 100644 index 0000000000..8cc6ebfa90 --- /dev/null +++ b/src/serviceDesk/models/pagedCustomerRequest.mts @@ -0,0 +1,17 @@ +import { CustomerRequest } from './customerRequest.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedCustomerRequest { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: CustomerRequest[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedCustomerRequest.ts b/src/serviceDesk/models/pagedCustomerRequest.ts deleted file mode 100644 index 040644cea3..0000000000 --- a/src/serviceDesk/models/pagedCustomerRequest.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CustomerRequest } from './customerRequest'; -import { PagedLink } from './pagedLink'; - -export interface PagedCustomerRequest { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: CustomerRequest[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedCustomerRequestStatus.mts b/src/serviceDesk/models/pagedCustomerRequestStatus.mts new file mode 100644 index 0000000000..3e7fe3501f --- /dev/null +++ b/src/serviceDesk/models/pagedCustomerRequestStatus.mts @@ -0,0 +1,17 @@ +import { CustomerRequestStatus } from './customerRequestStatus.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedCustomerRequestStatus { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: CustomerRequestStatus[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedCustomerRequestStatus.ts b/src/serviceDesk/models/pagedCustomerRequestStatus.ts deleted file mode 100644 index 6044759131..0000000000 --- a/src/serviceDesk/models/pagedCustomerRequestStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CustomerRequestStatus } from './customerRequestStatus'; -import { PagedLink } from './pagedLink'; - -export interface PagedCustomerRequestStatus { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: CustomerRequestStatus[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedCustomerTransition.mts b/src/serviceDesk/models/pagedCustomerTransition.mts new file mode 100644 index 0000000000..33f7102e09 --- /dev/null +++ b/src/serviceDesk/models/pagedCustomerTransition.mts @@ -0,0 +1,17 @@ +import { CustomerTransition } from './customerTransition.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedCustomerTransition { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: CustomerTransition[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedCustomerTransition.ts b/src/serviceDesk/models/pagedCustomerTransition.ts deleted file mode 100644 index 60febcf1dc..0000000000 --- a/src/serviceDesk/models/pagedCustomerTransition.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CustomerTransition } from './customerTransition'; -import { PagedLink } from './pagedLink'; - -export interface PagedCustomerTransition { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: CustomerTransition[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedInsightWorkspace.mts b/src/serviceDesk/models/pagedInsightWorkspace.mts new file mode 100644 index 0000000000..ea319685fa --- /dev/null +++ b/src/serviceDesk/models/pagedInsightWorkspace.mts @@ -0,0 +1,17 @@ +import { InsightWorkspace } from './insightWorkspace.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedInsightWorkspace { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: InsightWorkspace[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedInsightWorkspace.ts b/src/serviceDesk/models/pagedInsightWorkspace.ts deleted file mode 100644 index 0cf996bccc..0000000000 --- a/src/serviceDesk/models/pagedInsightWorkspace.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { InsightWorkspace } from './insightWorkspace'; -import { PagedLink } from './pagedLink'; - -export interface PagedInsightWorkspace { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: InsightWorkspace[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedIssue.mts b/src/serviceDesk/models/pagedIssue.mts new file mode 100644 index 0000000000..486534403e --- /dev/null +++ b/src/serviceDesk/models/pagedIssue.mts @@ -0,0 +1,17 @@ +import type { Issue } from './issue.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedIssue { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Issue[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedIssue.ts b/src/serviceDesk/models/pagedIssue.ts deleted file mode 100644 index 3adc22944e..0000000000 --- a/src/serviceDesk/models/pagedIssue.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Issue } from './issue'; -import { PagedLink } from './pagedLink'; - -export interface PagedIssue { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Issue[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedLink.ts b/src/serviceDesk/models/pagedLink.mts similarity index 100% rename from src/serviceDesk/models/pagedLink.ts rename to src/serviceDesk/models/pagedLink.mts diff --git a/src/serviceDesk/models/pagedOrganization.mts b/src/serviceDesk/models/pagedOrganization.mts new file mode 100644 index 0000000000..fcae235ca5 --- /dev/null +++ b/src/serviceDesk/models/pagedOrganization.mts @@ -0,0 +1,17 @@ +import { Organization } from './organization.mjs'; +import { PagedLink } from './pagedLink.mjs'; + +export interface PagedOrganization { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Organization[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedOrganization.ts b/src/serviceDesk/models/pagedOrganization.ts deleted file mode 100644 index d2f07a56c1..0000000000 --- a/src/serviceDesk/models/pagedOrganization.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Organization } from './organization'; -import { PagedLink } from './pagedLink'; - -export interface PagedOrganization { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Organization[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedQueue.mts b/src/serviceDesk/models/pagedQueue.mts new file mode 100644 index 0000000000..90f50e0699 --- /dev/null +++ b/src/serviceDesk/models/pagedQueue.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { Queue } from './queue.mjs'; + +export interface PagedQueue { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: Queue[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedQueue.ts b/src/serviceDesk/models/pagedQueue.ts deleted file mode 100644 index 17056ef6de..0000000000 --- a/src/serviceDesk/models/pagedQueue.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PagedLink } from './pagedLink'; -import { Queue } from './queue'; - -export interface PagedQueue { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: Queue[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedRequestType.mts b/src/serviceDesk/models/pagedRequestType.mts new file mode 100644 index 0000000000..aa1c41b893 --- /dev/null +++ b/src/serviceDesk/models/pagedRequestType.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { RequestType } from './requestType.mjs'; + +export interface PagedRequestType { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: RequestType[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedRequestType.ts b/src/serviceDesk/models/pagedRequestType.ts deleted file mode 100644 index eb118bc746..0000000000 --- a/src/serviceDesk/models/pagedRequestType.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PagedLink } from './pagedLink'; -import { RequestType } from './requestType'; - -export interface PagedRequestType { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: RequestType[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedRequestTypeGroup.mts b/src/serviceDesk/models/pagedRequestTypeGroup.mts new file mode 100644 index 0000000000..8c4cd4460b --- /dev/null +++ b/src/serviceDesk/models/pagedRequestTypeGroup.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { RequestTypeGroup } from './requestTypeGroup.mjs'; + +export interface PagedRequestTypeGroup { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: RequestTypeGroup[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedRequestTypeGroup.ts b/src/serviceDesk/models/pagedRequestTypeGroup.ts deleted file mode 100644 index 45c4eada00..0000000000 --- a/src/serviceDesk/models/pagedRequestTypeGroup.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PagedLink } from './pagedLink'; -import { RequestTypeGroup } from './requestTypeGroup'; - -export interface PagedRequestTypeGroup { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: RequestTypeGroup[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedServiceDesk.mts b/src/serviceDesk/models/pagedServiceDesk.mts new file mode 100644 index 0000000000..4b066d2810 --- /dev/null +++ b/src/serviceDesk/models/pagedServiceDesk.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { ServiceDesk } from './serviceDesk.mjs'; + +export interface PagedServiceDesk { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: ServiceDesk[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedServiceDesk.ts b/src/serviceDesk/models/pagedServiceDesk.ts deleted file mode 100644 index 2fe154c90b..0000000000 --- a/src/serviceDesk/models/pagedServiceDesk.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PagedLink } from './pagedLink'; -import { ServiceDesk } from './serviceDesk'; - -export interface PagedServiceDesk { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: ServiceDesk[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedSlaInformation.mts b/src/serviceDesk/models/pagedSlaInformation.mts new file mode 100644 index 0000000000..8e37756918 --- /dev/null +++ b/src/serviceDesk/models/pagedSlaInformation.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { SlaInformation } from './slaInformation.mjs'; + +export interface PagedSlaInformation { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: SlaInformation[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedSlaInformation.ts b/src/serviceDesk/models/pagedSlaInformation.ts deleted file mode 100644 index 40099d11bc..0000000000 --- a/src/serviceDesk/models/pagedSlaInformation.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PagedLink } from './pagedLink'; -import { SlaInformation } from './slaInformation'; - -export interface PagedSlaInformation { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: SlaInformation[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/pagedUser.mts b/src/serviceDesk/models/pagedUser.mts new file mode 100644 index 0000000000..159b19c489 --- /dev/null +++ b/src/serviceDesk/models/pagedUser.mts @@ -0,0 +1,17 @@ +import { PagedLink } from './pagedLink.mjs'; +import { User } from './user.mjs'; + +export interface PagedUser { + /** Number of items returned in the page. */ + size?: number; + /** Index of the first item returned in the page. */ + start?: number; + /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ + limit?: number; + /** Indicates if this is the last page of records (true) or not (false). */ + isLastPage?: boolean; + /** Details of the items included in the page. */ + values?: User[]; + Expands?: string[]; + Links?: PagedLink; +} diff --git a/src/serviceDesk/models/pagedUser.ts b/src/serviceDesk/models/pagedUser.ts deleted file mode 100644 index b260a28775..0000000000 --- a/src/serviceDesk/models/pagedUser.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { PagedLink } from './pagedLink'; -import { User } from './user'; - -export interface PagedUser { - /** Number of items returned in the page. */ - size?: number; - /** Index of the first item returned in the page. */ - start?: number; - /** Number of items to be returned per page, up to the maximum set for these objects in the current implementation. */ - limit?: number; - /** Indicates if this is the last page of records (true) or not (false). */ - isLastPage?: boolean; - /** Details of the items included in the page. */ - values?: User[]; - Expands?: string[]; - Links?: PagedLink; -} diff --git a/src/serviceDesk/models/propertyKey.ts b/src/serviceDesk/models/propertyKey.mts similarity index 100% rename from src/serviceDesk/models/propertyKey.ts rename to src/serviceDesk/models/propertyKey.mts diff --git a/src/serviceDesk/models/propertyKeys.mts b/src/serviceDesk/models/propertyKeys.mts new file mode 100644 index 0000000000..3db8a9493c --- /dev/null +++ b/src/serviceDesk/models/propertyKeys.mts @@ -0,0 +1,7 @@ +import type { PropertyKey } from './propertyKey.mjs'; + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} diff --git a/src/serviceDesk/models/propertyKeys.ts b/src/serviceDesk/models/propertyKeys.ts deleted file mode 100644 index f4e13a499e..0000000000 --- a/src/serviceDesk/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PropertyKey } from './propertyKey'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/serviceDesk/models/queue.mts b/src/serviceDesk/models/queue.mts new file mode 100644 index 0000000000..c6aaa74166 --- /dev/null +++ b/src/serviceDesk/models/queue.mts @@ -0,0 +1,15 @@ +import { SelfLink } from './selfLink.mjs'; + +export interface Queue { + /** ID for the queue. */ + id?: string; + /** Short name for the queue. */ + name?: string; + /** Jql query that filters reqeusts for the queue. */ + jql?: string; + /** Fields returned for each request in the queue. */ + fields?: string[]; + /** The count of customer requests in the queue. */ + issueCount?: number; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/queue.ts b/src/serviceDesk/models/queue.ts deleted file mode 100644 index 3d78e724a1..0000000000 --- a/src/serviceDesk/models/queue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SelfLink } from './selfLink'; - -export interface Queue { - /** ID for the queue. */ - id?: string; - /** Short name for the queue. */ - name?: string; - /** JQL query that filters reqeusts for the queue. */ - jql?: string; - /** Fields returned for each request in the queue. */ - fields?: string[]; - /** The count of customer requests in the queue. */ - issueCount?: number; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/renderedValue.ts b/src/serviceDesk/models/renderedValue.mts similarity index 100% rename from src/serviceDesk/models/renderedValue.ts rename to src/serviceDesk/models/renderedValue.mts diff --git a/src/serviceDesk/models/requestCreate.ts b/src/serviceDesk/models/requestCreate.mts similarity index 100% rename from src/serviceDesk/models/requestCreate.ts rename to src/serviceDesk/models/requestCreate.mts diff --git a/src/serviceDesk/models/requestNotificationSubscription.ts b/src/serviceDesk/models/requestNotificationSubscription.mts similarity index 100% rename from src/serviceDesk/models/requestNotificationSubscription.ts rename to src/serviceDesk/models/requestNotificationSubscription.mts diff --git a/src/serviceDesk/models/requestParticipantUpdate.ts b/src/serviceDesk/models/requestParticipantUpdate.mts similarity index 100% rename from src/serviceDesk/models/requestParticipantUpdate.ts rename to src/serviceDesk/models/requestParticipantUpdate.mts diff --git a/src/serviceDesk/models/requestType.mts b/src/serviceDesk/models/requestType.mts new file mode 100644 index 0000000000..a8c38c2aa7 --- /dev/null +++ b/src/serviceDesk/models/requestType.mts @@ -0,0 +1,29 @@ +import { CustomerRequestCreateMeta } from './customerRequestCreateMeta.mjs'; +import { RequestTypeIcon } from './requestTypeIcon.mjs'; +import { SelfLink } from './selfLink.mjs'; + +export interface RequestType { + /** ID for the request type. */ + id?: string; + /** Short name for the request type. */ + name?: string; + /** Description of the request type. */ + description?: string; + /** Help text for the request type. */ + helpText?: string; + /** ID of the issue type the request type is based upon. */ + issueTypeId?: string; + /** ID of the service desk the request type belongs to. */ + serviceDeskId?: string; + /** ID of the customer portal associated with the service desk project. */ + portalId?: string; + /** List of the request type groups the request type belongs to. */ + groupIds?: string[]; + icon?: RequestTypeIcon; + fields?: CustomerRequestCreateMeta; + /** The request type's practice */ + practice?: string; + /** List of items that can be expanded in the response by specifying the expand query parameter. */ + Expands?: string[]; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/requestType.ts b/src/serviceDesk/models/requestType.ts deleted file mode 100644 index bd66bcba73..0000000000 --- a/src/serviceDesk/models/requestType.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { CustomerRequestCreateMeta } from './customerRequestCreateMeta'; -import { RequestTypeIcon } from './requestTypeIcon'; -import { SelfLink } from './selfLink'; - -export interface RequestType { - /** ID for the request type. */ - id?: string; - /** Short name for the request type. */ - name?: string; - /** Description of the request type. */ - description?: string; - /** Help text for the request type. */ - helpText?: string; - /** ID of the issue type the request type is based upon. */ - issueTypeId?: string; - /** ID of the service desk the request type belongs to. */ - serviceDeskId?: string; - /** ID of the customer portal associated with the service desk project. */ - portalId?: string; - /** List of the request type groups the request type belongs to. */ - groupIds?: string[]; - icon?: RequestTypeIcon; - fields?: CustomerRequestCreateMeta; - /** The request type's practice */ - practice?: string; - /** List of items that can be expanded in the response by specifying the expand query parameter. */ - Expands?: string[]; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/requestTypeCreate.ts b/src/serviceDesk/models/requestTypeCreate.mts similarity index 100% rename from src/serviceDesk/models/requestTypeCreate.ts rename to src/serviceDesk/models/requestTypeCreate.mts diff --git a/src/serviceDesk/models/requestTypeField.mts b/src/serviceDesk/models/requestTypeField.mts new file mode 100644 index 0000000000..fc97717cf2 --- /dev/null +++ b/src/serviceDesk/models/requestTypeField.mts @@ -0,0 +1,21 @@ +import { JsonType } from './jsonType.mjs'; +import { RequestTypeFieldValue } from './requestTypeFieldValue.mjs'; + +export interface RequestTypeField { + /** ID of the field. */ + fieldId?: string; + /** Name of the field. */ + name?: string; + /** Description of the field. */ + description?: string; + /** Indicates if the field is required (true) or not (false). */ + required?: boolean; + /** List of default values for the field. */ + defaultValues?: RequestTypeFieldValue[]; + /** List of valid values for the field. */ + validValues?: RequestTypeFieldValue[]; + /** List of preset values for the field. */ + presetValues?: string[]; + jiraSchema?: JsonType; + visible?: boolean; +} diff --git a/src/serviceDesk/models/requestTypeField.ts b/src/serviceDesk/models/requestTypeField.ts deleted file mode 100644 index 3265dc4be3..0000000000 --- a/src/serviceDesk/models/requestTypeField.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { JsonType } from './jsonType'; -import { RequestTypeFieldValue } from './requestTypeFieldValue'; - -export interface RequestTypeField { - /** ID of the field. */ - fieldId?: string; - /** Name of the field. */ - name?: string; - /** Description of the field. */ - description?: string; - /** Indicates if the field is required (true) or not (false). */ - required?: boolean; - /** List of default values for the field. */ - defaultValues?: RequestTypeFieldValue[]; - /** List of valid values for the field. */ - validValues?: RequestTypeFieldValue[]; - /** List of preset values for the field. */ - presetValues?: string[]; - jiraSchema?: JsonType; - visible?: boolean; -} diff --git a/src/serviceDesk/models/requestTypeFieldValue.ts b/src/serviceDesk/models/requestTypeFieldValue.mts similarity index 100% rename from src/serviceDesk/models/requestTypeFieldValue.ts rename to src/serviceDesk/models/requestTypeFieldValue.mts diff --git a/src/serviceDesk/models/requestTypeGroup.ts b/src/serviceDesk/models/requestTypeGroup.mts similarity index 100% rename from src/serviceDesk/models/requestTypeGroup.ts rename to src/serviceDesk/models/requestTypeGroup.mts diff --git a/src/serviceDesk/models/requestTypeIcon.mts b/src/serviceDesk/models/requestTypeIcon.mts new file mode 100644 index 0000000000..cb3cc979bc --- /dev/null +++ b/src/serviceDesk/models/requestTypeIcon.mts @@ -0,0 +1,7 @@ +import { RequestTypeIconLink } from './requestTypeIconLink.mjs'; + +export interface RequestTypeIcon { + /** ID of the request type icon. */ + id?: string; + Links?: RequestTypeIconLink; +} diff --git a/src/serviceDesk/models/requestTypeIcon.ts b/src/serviceDesk/models/requestTypeIcon.ts deleted file mode 100644 index fc7ccb24fa..0000000000 --- a/src/serviceDesk/models/requestTypeIcon.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { RequestTypeIconLink } from './requestTypeIconLink'; - -export interface RequestTypeIcon { - /** ID of the request type icon. */ - id?: string; - Links?: RequestTypeIconLink; -} diff --git a/src/serviceDesk/models/requestTypeIconLink.ts b/src/serviceDesk/models/requestTypeIconLink.mts similarity index 100% rename from src/serviceDesk/models/requestTypeIconLink.ts rename to src/serviceDesk/models/requestTypeIconLink.mts diff --git a/src/serviceDesk/models/selfLink.ts b/src/serviceDesk/models/selfLink.mts similarity index 100% rename from src/serviceDesk/models/selfLink.ts rename to src/serviceDesk/models/selfLink.mts diff --git a/src/serviceDesk/models/serviceDesk.mts b/src/serviceDesk/models/serviceDesk.mts new file mode 100644 index 0000000000..3a8368e121 --- /dev/null +++ b/src/serviceDesk/models/serviceDesk.mts @@ -0,0 +1,13 @@ +import { SelfLink } from './selfLink.mjs'; + +export interface ServiceDesk { + /** ID of the service desk. */ + id?: string; + /** ID of the peer project for the service desk. */ + projectId?: string; + /** Name of the project and service desk. */ + projectName?: string; + /** Key of the peer project of the service desk. */ + projectKey?: string; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/serviceDesk.ts b/src/serviceDesk/models/serviceDesk.ts deleted file mode 100644 index e220ce0f7f..0000000000 --- a/src/serviceDesk/models/serviceDesk.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { SelfLink } from './selfLink'; - -export interface ServiceDesk { - /** ID of the service desk. */ - id?: string; - /** ID of the peer project for the service desk. */ - projectId?: string; - /** Name of the project and service desk. */ - projectName?: string; - /** Key of the peer project of the service desk. */ - projectKey?: string; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/serviceDeskCustomer.ts b/src/serviceDesk/models/serviceDeskCustomer.mts similarity index 100% rename from src/serviceDesk/models/serviceDeskCustomer.ts rename to src/serviceDesk/models/serviceDeskCustomer.mts diff --git a/src/serviceDesk/models/slaInformation.mts b/src/serviceDesk/models/slaInformation.mts new file mode 100644 index 0000000000..9bc615f199 --- /dev/null +++ b/src/serviceDesk/models/slaInformation.mts @@ -0,0 +1,16 @@ +import { SelfLink } from './selfLink.mjs'; +import { SlaInformationCompletedCycle } from './slaInformationCompletedCycle.mjs'; +import { SlaInformationOngoingCycle } from './slaInformationOngoingCycle.mjs'; + +export interface SlaInformation { + /** ID of the Service Level Agreement (SLA). */ + id?: string; + /** Description of the SLA. */ + name?: string; + /** List of completed cycles for the SLA. */ + completedCycles?: SlaInformationCompletedCycle[]; + ongoingCycle?: SlaInformationOngoingCycle; + /** Format in which SLA is to be displayed in the UI */ + slaDisplayFormat?: string; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/slaInformation.ts b/src/serviceDesk/models/slaInformation.ts deleted file mode 100644 index 0673726d4e..0000000000 --- a/src/serviceDesk/models/slaInformation.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { SelfLink } from './selfLink'; -import { SlaInformationCompletedCycle } from './slaInformationCompletedCycle'; -import { SlaInformationOngoingCycle } from './slaInformationOngoingCycle'; - -export interface SlaInformation { - /** ID of the Service Level Agreement (SLA). */ - id?: string; - /** Description of the SLA. */ - name?: string; - /** List of completed cycles for the SLA. */ - completedCycles?: SlaInformationCompletedCycle[]; - ongoingCycle?: SlaInformationOngoingCycle; - /** Format in which SLA is to be displayed in the UI */ - slaDisplayFormat?: string; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/slaInformationCompletedCycle.mts b/src/serviceDesk/models/slaInformationCompletedCycle.mts new file mode 100644 index 0000000000..5424b89262 --- /dev/null +++ b/src/serviceDesk/models/slaInformationCompletedCycle.mts @@ -0,0 +1,13 @@ +import { Date } from './date.mjs'; +import { Duration } from './duration.mjs'; + +export interface SlaInformationCompletedCycle { + startTime?: Date; + stopTime?: Date; + breachTime?: Date; + /** Indicates if the SLA (duration) was exceeded (true) or not (false). */ + breached?: boolean; + goalDuration?: Duration; + elapsedTime?: Duration; + remainingTime?: Duration; +} diff --git a/src/serviceDesk/models/slaInformationCompletedCycle.ts b/src/serviceDesk/models/slaInformationCompletedCycle.ts deleted file mode 100644 index 2e37c2d35a..0000000000 --- a/src/serviceDesk/models/slaInformationCompletedCycle.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Date } from './date'; -import { Duration } from './duration'; - -export interface SlaInformationCompletedCycle { - startTime?: Date; - stopTime?: Date; - breachTime?: Date; - /** Indicates if the SLA (duration) was exceeded (true) or not (false). */ - breached?: boolean; - goalDuration?: Duration; - elapsedTime?: Duration; - remainingTime?: Duration; -} diff --git a/src/serviceDesk/models/slaInformationOngoingCycle.mts b/src/serviceDesk/models/slaInformationOngoingCycle.mts new file mode 100644 index 0000000000..3cd7b0beea --- /dev/null +++ b/src/serviceDesk/models/slaInformationOngoingCycle.mts @@ -0,0 +1,16 @@ +import { Date } from './date.mjs'; +import { Duration } from './duration.mjs'; + +export interface SlaInformationOngoingCycle { + startTime?: Date; + breachTime?: Date; + /** Indicates whether the SLA has been breached (true) or not (false). */ + breached?: boolean; + /** Indicates whether the SLA is paused (true) or not (false). */ + paused?: boolean; + /** Indicates whether the SLA it timed during calendared working hours only (true) or not (false). */ + withinCalendarHours?: boolean; + goalDuration?: Duration; + elapsedTime?: Duration; + remainingTime?: Duration; +} diff --git a/src/serviceDesk/models/slaInformationOngoingCycle.ts b/src/serviceDesk/models/slaInformationOngoingCycle.ts deleted file mode 100644 index 6101df6d90..0000000000 --- a/src/serviceDesk/models/slaInformationOngoingCycle.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Date } from './date'; -import { Duration } from './duration'; - -export interface SlaInformationOngoingCycle { - startTime?: Date; - breachTime?: Date; - /** Indicates whether the SLA has been breached (true) or not (false). */ - breached?: boolean; - /** Indicates whether the SLA is paused (true) or not (false). */ - paused?: boolean; - /** Indicates whether the SLA it timed during calendared working hours only (true) or not (false). */ - withinCalendarHours?: boolean; - goalDuration?: Duration; - elapsedTime?: Duration; - remainingTime?: Duration; -} diff --git a/src/serviceDesk/models/softwareInfo.mts b/src/serviceDesk/models/softwareInfo.mts new file mode 100644 index 0000000000..7c4a44e825 --- /dev/null +++ b/src/serviceDesk/models/softwareInfo.mts @@ -0,0 +1,15 @@ +import { Date } from './date.mjs'; +import { SelfLink } from './selfLink.mjs'; + +export interface SoftwareInfo { + /** Jira Service Management version. */ + version?: string; + /** Jira Platform version upon which Service Desk is based. */ + platformVersion?: string; + buildDate?: Date; + /** Reference of the change set included in the build. */ + buildChangeSet?: string; + /** Indicates whether the instance is licensed (true) or not (false). */ + isLicensedForUse?: boolean; + Links?: SelfLink; +} diff --git a/src/serviceDesk/models/softwareInfo.ts b/src/serviceDesk/models/softwareInfo.ts deleted file mode 100644 index 6af9a5e04f..0000000000 --- a/src/serviceDesk/models/softwareInfo.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Date } from './date'; -import { SelfLink } from './selfLink'; - -export interface SoftwareInfo { - /** Jira Service Management version. */ - version?: string; - /** Jira Platform version upon which Service Desk is based. */ - platformVersion?: string; - buildDate?: Date; - /** Reference of the change set included in the build. */ - buildChangeSet?: string; - /** Indicates whether the instance is licensed (true) or not (false). */ - isLicensedForUse?: boolean; - Links?: SelfLink; -} diff --git a/src/serviceDesk/models/source.ts b/src/serviceDesk/models/source.mts similarity index 100% rename from src/serviceDesk/models/source.ts rename to src/serviceDesk/models/source.mts diff --git a/src/serviceDesk/models/statusCategory.ts b/src/serviceDesk/models/statusCategory.mts similarity index 100% rename from src/serviceDesk/models/statusCategory.ts rename to src/serviceDesk/models/statusCategory.mts diff --git a/src/serviceDesk/models/statusDetails.mts b/src/serviceDesk/models/statusDetails.mts new file mode 100644 index 0000000000..affd80d616 --- /dev/null +++ b/src/serviceDesk/models/statusDetails.mts @@ -0,0 +1,16 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +/** A status. */ +export interface StatusDetails { + /** The URL of the status. */ + self?: string; + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The name of the status. */ + name?: string; + /** The ID of the status. */ + id?: string; + statusCategory?: StatusCategory; +} diff --git a/src/serviceDesk/models/statusDetails.ts b/src/serviceDesk/models/statusDetails.ts deleted file mode 100644 index cff803cfad..0000000000 --- a/src/serviceDesk/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { StatusCategory } from './statusCategory'; - -/** A status. */ -export interface StatusDetails { - /** The URL of the status. */ - self?: string; - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The name of the status. */ - name?: string; - /** The ID of the status. */ - id?: string; - statusCategory?: StatusCategory; -} diff --git a/src/serviceDesk/models/user.mts b/src/serviceDesk/models/user.mts new file mode 100644 index 0000000000..3c038e2654 --- /dev/null +++ b/src/serviceDesk/models/user.mts @@ -0,0 +1,21 @@ +import { UserLink } from './userLink.mjs'; + +export interface User { + /** + * The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** Customer's email address. Depending on the customer’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** + * Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative + * value. + */ + displayName?: string; + /** Indicates if the customer is active (true) or inactive (false) */ + active?: boolean; + /** Customer time zone. Depending on the customer’s privacy settings, this may be returned as null. */ + timeZone?: string; + Links?: UserLink; +} diff --git a/src/serviceDesk/models/user.ts b/src/serviceDesk/models/user.ts deleted file mode 100644 index 5c2079efff..0000000000 --- a/src/serviceDesk/models/user.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { UserLink } from './userLink'; - -export interface User { - /** - * The accountId of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** Customer's email address. Depending on the customer’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** - * Customer's name for display in a UI. Depending on the customer’s privacy settings, this may return an alternative - * value. - */ - displayName?: string; - /** Indicates if the customer is active (true) or inactive (false) */ - active?: boolean; - /** Customer time zone. Depending on the customer’s privacy settings, this may be returned as null. */ - timeZone?: string; - Links?: UserLink; -} diff --git a/src/serviceDesk/models/userDetails.mts b/src/serviceDesk/models/userDetails.mts new file mode 100644 index 0000000000..5537a8b923 --- /dev/null +++ b/src/serviceDesk/models/userDetails.mts @@ -0,0 +1,51 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface UserDetails { + /** The URL of the user. */ + self?: 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. + */ + name?: 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. + */ + key?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; +} diff --git a/src/serviceDesk/models/userDetails.ts b/src/serviceDesk/models/userDetails.ts deleted file mode 100644 index bcc42c2042..0000000000 --- a/src/serviceDesk/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** The URL of the user. */ - self?: 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. - */ - name?: 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. - */ - key?: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; -} diff --git a/src/serviceDesk/models/userLink.ts b/src/serviceDesk/models/userLink.mts similarity index 100% rename from src/serviceDesk/models/userLink.ts rename to src/serviceDesk/models/userLink.mts diff --git a/src/serviceDesk/models/usersOrganizationUpdate.ts b/src/serviceDesk/models/usersOrganizationUpdate.mts similarity index 100% rename from src/serviceDesk/models/usersOrganizationUpdate.ts rename to src/serviceDesk/models/usersOrganizationUpdate.mts diff --git a/src/serviceDesk/organization.mts b/src/serviceDesk/organization.mts new file mode 100644 index 0000000000..f5f0de89f8 --- /dev/null +++ b/src/serviceDesk/organization.mts @@ -0,0 +1,516 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Organization { + constructor(private client: Client) {} + + /** + * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want + * to present a list of organizations or want to locate an organization by name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. + * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. + * + * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are + * listed. + */ + async getOrganizations( + parameters: Parameters.GetOrganizations | undefined, + callback: Callback, + ): Promise; + /** + * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want + * to present a list of organizations or want to locate an organization by name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. + * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. + * + * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are + * listed. + */ + async getOrganizations( + parameters?: Parameters.GetOrganizations, + callback?: never, + ): Promise; + async getOrganizations( + parameters?: Parameters.GetOrganizations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/organization', + method: 'GET', + params: { + start: parameters?.start, + limit: parameters?.limit, + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method creates an organization by passing the name of the organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the + * Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async createOrganization( + parameters: Parameters.CreateOrganization | undefined, + callback: Callback, + ): Promise; + /** + * This method creates an organization by passing the name of the organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the + * Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async createOrganization( + parameters?: Parameters.CreateOrganization, + callback?: never, + ): Promise; + async createOrganization( + parameters?: Parameters.CreateOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/organization', + method: 'POST', + data: { + name: parameters?.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns details of an organization. Use this method to get organization details whenever your + * application component is passed an organization ID but needs to display other organization details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only retrieve organization of which they are members. + */ + async getOrganization( + parameters: Parameters.GetOrganization, + callback: Callback, + ): Promise; + /** + * This method returns details of an organization. Use this method to get organization details whenever your + * application component is passed an organization ID but needs to display other organization details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only retrieve organization of which they are members. + */ + async getOrganization(parameters: Parameters.GetOrganization, callback?: never): Promise; + async getOrganization( + parameters: Parameters.GetOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method deletes an organization. Note that the organization is deleted regardless of other associations it may + * have. For example, associations with service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * administrator. + */ + async deleteOrganization(parameters: Parameters.DeleteOrganization, callback: Callback): Promise; + /** + * This method deletes an organization. Note that the organization is deleted regardless of other associations it may + * have. For example, associations with service desks. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * administrator. + */ + async deleteOrganization(parameters: Parameters.DeleteOrganization, callback?: never): Promise; + async deleteOrganization( + parameters: Parameters.DeleteOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional + * properties items have been added to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getPropertiesKeys( + parameters: Parameters.GetOrganizationPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional + * properties items have been added to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getPropertiesKeys( + parameters: Parameters.GetOrganizationPropertyKeys, + callback?: never, + ): Promise; + async getPropertiesKeys( + parameters: Parameters.GetOrganizationPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a property from an organization. Use this method to obtain the JSON content for an + * organization's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getProperty( + parameters: Parameters.GetOrganizationProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a property from an organization. Use this method to obtain the JSON content for an + * organization's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + * + * **Response limitations**: Customers can only access properties of organizations of which they are members. + */ + async getProperty( + parameters: Parameters.GetOrganizationProperty, + callback?: never, + ): Promise; + async getProperty( + parameters: Parameters.GetOrganizationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a property for an organization. Use this resource to store custom data against an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async setProperty(parameters: Parameters.SetOrganizationProperty, callback: Callback): Promise; + /** + * Sets the value of a property for an organization. Use this resource to store custom data against an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async setProperty(parameters: Parameters.SetOrganizationProperty, callback?: never): Promise; + async setProperty( + parameters: Parameters.SetOrganizationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a property from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async deleteProperty( + parameters: Parameters.DeleteOrganizationProperty, + callback: Callback, + ): Promise; + /** + * Removes a property from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service Desk Administrator or Agent. + * + * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the + * **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async deleteProperty(parameters: Parameters.DeleteOrganizationProperty, callback?: never): Promise; + async deleteProperty( + parameters: Parameters.DeleteOrganizationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all the users associated with an organization. Use this method where you want to provide a list + * of users for an organization or determine if a user is associated with an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. + */ + async getUsersInOrganization( + parameters: Parameters.GetUsersInOrganization, + callback: Callback, + ): Promise; + /** + * This method returns all the users associated with an organization. Use this method where you want to provide a list + * of users for an organization or determine if a user is associated with an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. + */ + async getUsersInOrganization( + parameters: Parameters.GetUsersInOrganization, + callback?: never, + ): Promise; + async getUsersInOrganization( + parameters: Parameters.GetUsersInOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds users to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with + * the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async addUsersToOrganization( + parameters: Parameters.AddUsersToOrganization, + callback: Callback, + ): Promise; + /** + * This method adds users to an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with + * the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async addUsersToOrganization(parameters: Parameters.AddUsersToOrganization, callback?: never): Promise; + async addUsersToOrganization( + parameters: Parameters.AddUsersToOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, + method: 'POST', + data: { + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes users from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users + * with the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async removeUsersFromOrganization( + parameters: Parameters.RemoveUsersFromOrganization, + callback: Callback, + ): Promise; + /** + * This method removes users from an organization. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users + * with the Jira administrator permission, using the **[Organization + * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** + * feature. + */ + async removeUsersFromOrganization( + parameters: Parameters.RemoveUsersFromOrganization, + callback?: never, + ): Promise; + async removeUsersFromOrganization( + parameters: Parameters.RemoveUsersFromOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, + method: 'DELETE', + data: { + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of all organizations associated with a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getServiceDeskOrganizations( + parameters: Parameters.GetOrganizations, + callback: Callback, + ): Promise; + /** + * This method returns a list of all organizations associated with a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getServiceDeskOrganizations( + parameters: Parameters.GetOrganizations, + callback?: never, + ): Promise; + async getServiceDeskOrganizations( + parameters: Parameters.GetOrganizations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds an organization to a service desk. If the organization ID is already associated with the service + * desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async addOrganization(parameters: Parameters.AddOrganization, callback: Callback): Promise; + /** + * This method adds an organization to a service desk. If the organization ID is already associated with the service + * desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async addOrganization(parameters: Parameters.AddOrganization, callback?: never): Promise; + async addOrganization(parameters: Parameters.AddOrganization, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, + method: 'POST', + data: { + organizationId: parameters.organizationId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes an organization from a service desk. If the organization ID does not match an organization + * associated with the service desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async removeOrganization(parameters: Parameters.RemoveOrganization, callback: Callback): Promise; + /** + * This method removes an organization from a service desk. If the organization ID does not match an organization + * associated with the service desk, no change is made and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async removeOrganization(parameters: Parameters.RemoveOrganization, callback?: never): Promise; + async removeOrganization( + parameters: Parameters.RemoveOrganization, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, + method: 'DELETE', + data: { + organizationId: parameters.organizationId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/organization.ts b/src/serviceDesk/organization.ts deleted file mode 100644 index c022332430..0000000000 --- a/src/serviceDesk/organization.ts +++ /dev/null @@ -1,516 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Organization { - constructor(private client: Client) {} - - /** - * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want - * to present a list of organizations or want to locate an organization by name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. - * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. - * - * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are - * listed. - */ - async getOrganizations( - parameters: Parameters.GetOrganizations | undefined, - callback: Callback, - ): Promise; - /** - * This method returns a list of organizations in the Jira Service Management instance. Use this method when you want - * to present a list of organizations or want to locate an organization by name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any. - * However, to fetch organizations based on `accountId` the user must have a Service Desk agent license. - * - * **Response limitations**: If the user is a customer, only those organizations of which the customer is a member are - * listed. - */ - async getOrganizations( - parameters?: Parameters.GetOrganizations, - callback?: never, - ): Promise; - async getOrganizations( - parameters?: Parameters.GetOrganizations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/organization', - method: 'GET', - params: { - start: parameters?.start, - limit: parameters?.limit, - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method creates an organization by passing the name of the organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the - * Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async createOrganization( - parameters: Parameters.CreateOrganization | undefined, - callback: Callback, - ): Promise; - /** - * This method creates an organization by passing the name of the organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to create organizations can be switched to users with the - * Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async createOrganization( - parameters?: Parameters.CreateOrganization, - callback?: never, - ): Promise; - async createOrganization( - parameters?: Parameters.CreateOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/organization', - method: 'POST', - data: { - name: parameters?.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns details of an organization. Use this method to get organization details whenever your - * application component is passed an organization ID but needs to display other organization details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only retrieve organization of which they are members. - */ - async getOrganization( - parameters: Parameters.GetOrganization, - callback: Callback, - ): Promise; - /** - * This method returns details of an organization. Use this method to get organization details whenever your - * application component is passed an organization ID but needs to display other organization details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only retrieve organization of which they are members. - */ - async getOrganization(parameters: Parameters.GetOrganization, callback?: never): Promise; - async getOrganization( - parameters: Parameters.GetOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method deletes an organization. Note that the organization is deleted regardless of other associations it may - * have. For example, associations with service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * administrator. - */ - async deleteOrganization(parameters: Parameters.DeleteOrganization, callback: Callback): Promise; - /** - * This method deletes an organization. Note that the organization is deleted regardless of other associations it may - * have. For example, associations with service desks. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * administrator. - */ - async deleteOrganization(parameters: Parameters.DeleteOrganization, callback?: never): Promise; - async deleteOrganization( - parameters: Parameters.DeleteOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional - * properties items have been added to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getPropertiesKeys( - parameters: Parameters.GetOrganizationPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for an organization. Use this resource when you need to find out what additional - * properties items have been added to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getPropertiesKeys( - parameters: Parameters.GetOrganizationPropertyKeys, - callback?: never, - ): Promise; - async getPropertiesKeys( - parameters: Parameters.GetOrganizationPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a property from an organization. Use this method to obtain the JSON content for an - * organization's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getProperty( - parameters: Parameters.GetOrganizationProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a property from an organization. Use this method to obtain the JSON content for an - * organization's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - * - * **Response limitations**: Customers can only access properties of organizations of which they are members. - */ - async getProperty( - parameters: Parameters.GetOrganizationProperty, - callback?: never, - ): Promise; - async getProperty( - parameters: Parameters.GetOrganizationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a property for an organization. Use this resource to store custom data against an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async setProperty(parameters: Parameters.SetOrganizationProperty, callback: Callback): Promise; - /** - * Sets the value of a property for an organization. Use this resource to store custom data against an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async setProperty(parameters: Parameters.SetOrganizationProperty, callback?: never): Promise; - async setProperty( - parameters: Parameters.SetOrganizationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a property from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async deleteProperty( - parameters: Parameters.DeleteOrganizationProperty, - callback: Callback, - ): Promise; - /** - * Removes a property from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service Desk Administrator or Agent. - * - * Note: Permission to manage organizations can be switched to users with the Jira administrator permission, using the - * **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async deleteProperty(parameters: Parameters.DeleteOrganizationProperty, callback?: never): Promise; - async deleteProperty( - parameters: Parameters.DeleteOrganizationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/property/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all the users associated with an organization. Use this method where you want to provide a list - * of users for an organization or determine if a user is associated with an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. - */ - async getUsersInOrganization( - parameters: Parameters.GetUsersInOrganization, - callback: Callback, - ): Promise; - /** - * This method returns all the users associated with an organization. Use this method where you want to provide a list - * of users for an organization or determine if a user is associated with an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. - */ - async getUsersInOrganization( - parameters: Parameters.GetUsersInOrganization, - callback?: never, - ): Promise; - async getUsersInOrganization( - parameters: Parameters.GetUsersInOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds users to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with - * the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async addUsersToOrganization( - parameters: Parameters.AddUsersToOrganization, - callback: Callback, - ): Promise; - /** - * This method adds users to an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to add users to an organization can be switched to users with - * the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async addUsersToOrganization(parameters: Parameters.AddUsersToOrganization, callback?: never): Promise; - async addUsersToOrganization( - parameters: Parameters.AddUsersToOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, - method: 'POST', - data: { - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes users from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users - * with the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async removeUsersFromOrganization( - parameters: Parameters.RemoveUsersFromOrganization, - callback: Callback, - ): Promise; - /** - * This method removes users from an organization. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator or agent. Note: Permission to delete users from an organization can be switched to users - * with the Jira administrator permission, using the **[Organization - * management](https://confluence.atlassian.com/servicedeskcloud/setting-up-service-desk-users-732528877.html#Settingupservicedeskusers-manageorgsManageorganizations)** - * feature. - */ - async removeUsersFromOrganization( - parameters: Parameters.RemoveUsersFromOrganization, - callback?: never, - ): Promise; - async removeUsersFromOrganization( - parameters: Parameters.RemoveUsersFromOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/organization/${parameters.organizationId}/user`, - method: 'DELETE', - data: { - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of all organizations associated with a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getServiceDeskOrganizations( - parameters: Parameters.GetOrganizations, - callback: Callback, - ): Promise; - /** - * This method returns a list of all organizations associated with a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getServiceDeskOrganizations( - parameters: Parameters.GetOrganizations, - callback?: never, - ): Promise; - async getServiceDeskOrganizations( - parameters: Parameters.GetOrganizations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds an organization to a service desk. If the organization ID is already associated with the service - * desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async addOrganization(parameters: Parameters.AddOrganization, callback: Callback): Promise; - /** - * This method adds an organization to a service desk. If the organization ID is already associated with the service - * desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async addOrganization(parameters: Parameters.AddOrganization, callback?: never): Promise; - async addOrganization(parameters: Parameters.AddOrganization, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, - method: 'POST', - data: { - organizationId: parameters.organizationId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes an organization from a service desk. If the organization ID does not match an organization - * associated with the service desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async removeOrganization(parameters: Parameters.RemoveOrganization, callback: Callback): Promise; - /** - * This method removes an organization from a service desk. If the organization ID does not match an organization - * associated with the service desk, no change is made and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async removeOrganization(parameters: Parameters.RemoveOrganization, callback?: never): Promise; - async removeOrganization( - parameters: Parameters.RemoveOrganization, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/organization`, - method: 'DELETE', - data: { - organizationId: parameters.organizationId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/parameters/addCustomers.mts b/src/serviceDesk/parameters/addCustomers.mts new file mode 100644 index 0000000000..1e5564ad2c --- /dev/null +++ b/src/serviceDesk/parameters/addCustomers.mts @@ -0,0 +1,9 @@ +import { ServiceDeskCustomer } from '../models/index.mjs'; + +export interface AddCustomers extends ServiceDeskCustomer { + /** + * The ID of the service desk the customer list should be returned from. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/addCustomers.ts b/src/serviceDesk/parameters/addCustomers.ts deleted file mode 100644 index a945ca18a5..0000000000 --- a/src/serviceDesk/parameters/addCustomers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ServiceDeskCustomer } from '../models'; - -export interface AddCustomers extends ServiceDeskCustomer { - /** - * The ID of the service desk the customer list should be returned from. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/addOrganization.mts b/src/serviceDesk/parameters/addOrganization.mts new file mode 100644 index 0000000000..3ed072d9bc --- /dev/null +++ b/src/serviceDesk/parameters/addOrganization.mts @@ -0,0 +1,9 @@ +import { OrganizationServiceDeskUpdate } from '../models/index.mjs'; + +export interface AddOrganization extends OrganizationServiceDeskUpdate { + /** + * The ID of the service desk to which the organization will be added. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/addOrganization.ts b/src/serviceDesk/parameters/addOrganization.ts deleted file mode 100644 index 8addcd111f..0000000000 --- a/src/serviceDesk/parameters/addOrganization.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { OrganizationServiceDeskUpdate } from '../models'; - -export interface AddOrganization extends OrganizationServiceDeskUpdate { - /** - * The ID of the service desk to which the organization will be added. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/addRequestParticipants.mts b/src/serviceDesk/parameters/addRequestParticipants.mts new file mode 100644 index 0000000000..1414fc8129 --- /dev/null +++ b/src/serviceDesk/parameters/addRequestParticipants.mts @@ -0,0 +1,6 @@ +import { RequestParticipantUpdate } from '../models/index.mjs'; + +export interface AddRequestParticipants extends RequestParticipantUpdate { + /** The ID or key of the customer request to have participants added. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/addRequestParticipants.ts b/src/serviceDesk/parameters/addRequestParticipants.ts deleted file mode 100644 index ad906e83c8..0000000000 --- a/src/serviceDesk/parameters/addRequestParticipants.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RequestParticipantUpdate } from '../models'; - -export interface AddRequestParticipants extends RequestParticipantUpdate { - /** The ID or key of the customer request to have participants added. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/addUsersToOrganization.mts b/src/serviceDesk/parameters/addUsersToOrganization.mts new file mode 100644 index 0000000000..24d23ddd7f --- /dev/null +++ b/src/serviceDesk/parameters/addUsersToOrganization.mts @@ -0,0 +1,6 @@ +import { UsersOrganizationUpdate } from '../models/index.mjs'; + +export interface AddUsersToOrganization extends UsersOrganizationUpdate { + /** The ID of the organization. */ + organizationId: number; +} diff --git a/src/serviceDesk/parameters/addUsersToOrganization.ts b/src/serviceDesk/parameters/addUsersToOrganization.ts deleted file mode 100644 index 4190b90f8a..0000000000 --- a/src/serviceDesk/parameters/addUsersToOrganization.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UsersOrganizationUpdate } from '../models'; - -export interface AddUsersToOrganization extends UsersOrganizationUpdate { - /** The ID of the organization. */ - organizationId: number; -} diff --git a/src/serviceDesk/parameters/answerApproval.mts b/src/serviceDesk/parameters/answerApproval.mts new file mode 100644 index 0000000000..77714d4c49 --- /dev/null +++ b/src/serviceDesk/parameters/answerApproval.mts @@ -0,0 +1,8 @@ +import { ApprovalDecisionRequest } from '../models/index.mjs'; + +export interface AnswerApproval extends ApprovalDecisionRequest { + /** The ID or key of the customer request to be updated. */ + issueIdOrKey: string; + /** The ID of the approval to be updated. */ + approvalId: number; +} diff --git a/src/serviceDesk/parameters/answerApproval.ts b/src/serviceDesk/parameters/answerApproval.ts deleted file mode 100644 index e541a6f95b..0000000000 --- a/src/serviceDesk/parameters/answerApproval.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ApprovalDecisionRequest } from '../models'; - -export interface AnswerApproval extends ApprovalDecisionRequest { - /** The ID or key of the customer request to be updated. */ - issueIdOrKey: string; - /** The ID of the approval to be updated. */ - approvalId: number; -} diff --git a/src/serviceDesk/parameters/attachTemporaryFile.ts b/src/serviceDesk/parameters/attachTemporaryFile.mts similarity index 100% rename from src/serviceDesk/parameters/attachTemporaryFile.ts rename to src/serviceDesk/parameters/attachTemporaryFile.mts diff --git a/src/serviceDesk/parameters/createAttachment.mts b/src/serviceDesk/parameters/createAttachment.mts new file mode 100644 index 0000000000..e514eeacc2 --- /dev/null +++ b/src/serviceDesk/parameters/createAttachment.mts @@ -0,0 +1,6 @@ +import { AttachmentCreate } from '../models/index.mjs'; + +export interface CreateAttachment extends AttachmentCreate { + /** The ID or key of the customer request to which the attachment will be added. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/createAttachment.ts b/src/serviceDesk/parameters/createAttachment.ts deleted file mode 100644 index 06349aae4e..0000000000 --- a/src/serviceDesk/parameters/createAttachment.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { AttachmentCreate } from '../models'; - -export interface CreateAttachment extends AttachmentCreate { - /** The ID or key of the customer request to which the attachment will be added. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/createCustomer.mts b/src/serviceDesk/parameters/createCustomer.mts new file mode 100644 index 0000000000..a1fa695edd --- /dev/null +++ b/src/serviceDesk/parameters/createCustomer.mts @@ -0,0 +1,3 @@ +import { CustomerCreate } from '../models/index.mjs'; + +export interface CreateCustomer extends CustomerCreate {} diff --git a/src/serviceDesk/parameters/createCustomer.ts b/src/serviceDesk/parameters/createCustomer.ts deleted file mode 100644 index 174a1c7249..0000000000 --- a/src/serviceDesk/parameters/createCustomer.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CustomerCreate } from '../models'; - -export interface CreateCustomer extends CustomerCreate {} diff --git a/src/serviceDesk/parameters/createCustomerRequest.mts b/src/serviceDesk/parameters/createCustomerRequest.mts new file mode 100644 index 0000000000..d40b180b00 --- /dev/null +++ b/src/serviceDesk/parameters/createCustomerRequest.mts @@ -0,0 +1,3 @@ +import { RequestCreate } from '../models/index.mjs'; + +export interface CreateCustomerRequest extends RequestCreate {} diff --git a/src/serviceDesk/parameters/createCustomerRequest.ts b/src/serviceDesk/parameters/createCustomerRequest.ts deleted file mode 100644 index 562dd3de33..0000000000 --- a/src/serviceDesk/parameters/createCustomerRequest.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { RequestCreate } from '../models'; - -export interface CreateCustomerRequest extends RequestCreate {} diff --git a/src/serviceDesk/parameters/createOrganization.mts b/src/serviceDesk/parameters/createOrganization.mts new file mode 100644 index 0000000000..927956ac5b --- /dev/null +++ b/src/serviceDesk/parameters/createOrganization.mts @@ -0,0 +1,3 @@ +import { OrganizationCreate } from '../models/index.mjs'; + +export interface CreateOrganization extends OrganizationCreate {} diff --git a/src/serviceDesk/parameters/createOrganization.ts b/src/serviceDesk/parameters/createOrganization.ts deleted file mode 100644 index b89c9cdcb4..0000000000 --- a/src/serviceDesk/parameters/createOrganization.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { OrganizationCreate } from '../models'; - -export interface CreateOrganization extends OrganizationCreate {} diff --git a/src/serviceDesk/parameters/createRequestComment.mts b/src/serviceDesk/parameters/createRequestComment.mts new file mode 100644 index 0000000000..0275b869df --- /dev/null +++ b/src/serviceDesk/parameters/createRequestComment.mts @@ -0,0 +1,6 @@ +import { CommentCreate } from '../models/index.mjs'; + +export interface CreateRequestComment extends CommentCreate { + /** The ID or key of the customer request to which the comment will be added. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/createRequestComment.ts b/src/serviceDesk/parameters/createRequestComment.ts deleted file mode 100644 index 31e9ec2421..0000000000 --- a/src/serviceDesk/parameters/createRequestComment.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CommentCreate } from '../models'; - -export interface CreateRequestComment extends CommentCreate { - /** The ID or key of the customer request to which the comment will be added. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/createRequestType.mts b/src/serviceDesk/parameters/createRequestType.mts new file mode 100644 index 0000000000..803478e14a --- /dev/null +++ b/src/serviceDesk/parameters/createRequestType.mts @@ -0,0 +1,9 @@ +import { RequestTypeCreate } from '../models/index.mjs'; + +export interface CreateRequestType extends RequestTypeCreate { + /** + * The ID of the service desk where the customer request type is to be created. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/createRequestType.ts b/src/serviceDesk/parameters/createRequestType.ts deleted file mode 100644 index 3fb9fa3794..0000000000 --- a/src/serviceDesk/parameters/createRequestType.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { RequestTypeCreate } from '../models'; - -export interface CreateRequestType extends RequestTypeCreate { - /** - * The ID of the service desk where the customer request type is to be created. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/deleteFeedback.ts b/src/serviceDesk/parameters/deleteFeedback.mts similarity index 100% rename from src/serviceDesk/parameters/deleteFeedback.ts rename to src/serviceDesk/parameters/deleteFeedback.mts diff --git a/src/serviceDesk/parameters/deleteOrganization.ts b/src/serviceDesk/parameters/deleteOrganization.mts similarity index 100% rename from src/serviceDesk/parameters/deleteOrganization.ts rename to src/serviceDesk/parameters/deleteOrganization.mts diff --git a/src/serviceDesk/parameters/deleteOrganizationProperty.ts b/src/serviceDesk/parameters/deleteOrganizationProperty.mts similarity index 100% rename from src/serviceDesk/parameters/deleteOrganizationProperty.ts rename to src/serviceDesk/parameters/deleteOrganizationProperty.mts diff --git a/src/serviceDesk/parameters/deleteProperty.ts b/src/serviceDesk/parameters/deleteProperty.mts similarity index 100% rename from src/serviceDesk/parameters/deleteProperty.ts rename to src/serviceDesk/parameters/deleteProperty.mts diff --git a/src/serviceDesk/parameters/deleteRequestType.ts b/src/serviceDesk/parameters/deleteRequestType.mts similarity index 100% rename from src/serviceDesk/parameters/deleteRequestType.ts rename to src/serviceDesk/parameters/deleteRequestType.mts diff --git a/src/serviceDesk/parameters/getAllRequestTypes.ts b/src/serviceDesk/parameters/getAllRequestTypes.mts similarity index 100% rename from src/serviceDesk/parameters/getAllRequestTypes.ts rename to src/serviceDesk/parameters/getAllRequestTypes.mts diff --git a/src/serviceDesk/parameters/getApprovalById.ts b/src/serviceDesk/parameters/getApprovalById.mts similarity index 100% rename from src/serviceDesk/parameters/getApprovalById.ts rename to src/serviceDesk/parameters/getApprovalById.mts diff --git a/src/serviceDesk/parameters/getApprovals.ts b/src/serviceDesk/parameters/getApprovals.mts similarity index 100% rename from src/serviceDesk/parameters/getApprovals.ts rename to src/serviceDesk/parameters/getApprovals.mts diff --git a/src/serviceDesk/parameters/getArticles.ts b/src/serviceDesk/parameters/getArticles.mts similarity index 100% rename from src/serviceDesk/parameters/getArticles.ts rename to src/serviceDesk/parameters/getArticles.mts diff --git a/src/serviceDesk/parameters/getAttachmentContent.ts b/src/serviceDesk/parameters/getAttachmentContent.mts similarity index 100% rename from src/serviceDesk/parameters/getAttachmentContent.ts rename to src/serviceDesk/parameters/getAttachmentContent.mts diff --git a/src/serviceDesk/parameters/getAttachmentThumbnail.ts b/src/serviceDesk/parameters/getAttachmentThumbnail.mts similarity index 100% rename from src/serviceDesk/parameters/getAttachmentThumbnail.ts rename to src/serviceDesk/parameters/getAttachmentThumbnail.mts diff --git a/src/serviceDesk/parameters/getAttachmentsForRequest.ts b/src/serviceDesk/parameters/getAttachmentsForRequest.mts similarity index 100% rename from src/serviceDesk/parameters/getAttachmentsForRequest.ts rename to src/serviceDesk/parameters/getAttachmentsForRequest.mts diff --git a/src/serviceDesk/parameters/getCommentAttachments.ts b/src/serviceDesk/parameters/getCommentAttachments.mts similarity index 100% rename from src/serviceDesk/parameters/getCommentAttachments.ts rename to src/serviceDesk/parameters/getCommentAttachments.mts diff --git a/src/serviceDesk/parameters/getCustomerRequestByIdOrKey.ts b/src/serviceDesk/parameters/getCustomerRequestByIdOrKey.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerRequestByIdOrKey.ts rename to src/serviceDesk/parameters/getCustomerRequestByIdOrKey.mts diff --git a/src/serviceDesk/parameters/getCustomerRequestStatus.ts b/src/serviceDesk/parameters/getCustomerRequestStatus.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerRequestStatus.ts rename to src/serviceDesk/parameters/getCustomerRequestStatus.mts diff --git a/src/serviceDesk/parameters/getCustomerRequests.ts b/src/serviceDesk/parameters/getCustomerRequests.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerRequests.ts rename to src/serviceDesk/parameters/getCustomerRequests.mts diff --git a/src/serviceDesk/parameters/getCustomerTransitions.ts b/src/serviceDesk/parameters/getCustomerTransitions.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomerTransitions.ts rename to src/serviceDesk/parameters/getCustomerTransitions.mts diff --git a/src/serviceDesk/parameters/getCustomers.ts b/src/serviceDesk/parameters/getCustomers.mts similarity index 100% rename from src/serviceDesk/parameters/getCustomers.ts rename to src/serviceDesk/parameters/getCustomers.mts diff --git a/src/serviceDesk/parameters/getFeedback.ts b/src/serviceDesk/parameters/getFeedback.mts similarity index 100% rename from src/serviceDesk/parameters/getFeedback.ts rename to src/serviceDesk/parameters/getFeedback.mts diff --git a/src/serviceDesk/parameters/getInsightWorkspaces.ts b/src/serviceDesk/parameters/getInsightWorkspaces.mts similarity index 100% rename from src/serviceDesk/parameters/getInsightWorkspaces.ts rename to src/serviceDesk/parameters/getInsightWorkspaces.mts diff --git a/src/serviceDesk/parameters/getIssuesInQueue.ts b/src/serviceDesk/parameters/getIssuesInQueue.mts similarity index 100% rename from src/serviceDesk/parameters/getIssuesInQueue.ts rename to src/serviceDesk/parameters/getIssuesInQueue.mts diff --git a/src/serviceDesk/parameters/getOrganization.ts b/src/serviceDesk/parameters/getOrganization.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganization.ts rename to src/serviceDesk/parameters/getOrganization.mts diff --git a/src/serviceDesk/parameters/getOrganizationProperty.ts b/src/serviceDesk/parameters/getOrganizationProperty.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganizationProperty.ts rename to src/serviceDesk/parameters/getOrganizationProperty.mts diff --git a/src/serviceDesk/parameters/getOrganizationPropertyKeys.ts b/src/serviceDesk/parameters/getOrganizationPropertyKeys.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganizationPropertyKeys.ts rename to src/serviceDesk/parameters/getOrganizationPropertyKeys.mts diff --git a/src/serviceDesk/parameters/getOrganizations.ts b/src/serviceDesk/parameters/getOrganizations.mts similarity index 100% rename from src/serviceDesk/parameters/getOrganizations.ts rename to src/serviceDesk/parameters/getOrganizations.mts diff --git a/src/serviceDesk/parameters/getPropertiesKeys.ts b/src/serviceDesk/parameters/getPropertiesKeys.mts similarity index 100% rename from src/serviceDesk/parameters/getPropertiesKeys.ts rename to src/serviceDesk/parameters/getPropertiesKeys.mts diff --git a/src/serviceDesk/parameters/getProperty.ts b/src/serviceDesk/parameters/getProperty.mts similarity index 100% rename from src/serviceDesk/parameters/getProperty.ts rename to src/serviceDesk/parameters/getProperty.mts diff --git a/src/serviceDesk/parameters/getQueue.ts b/src/serviceDesk/parameters/getQueue.mts similarity index 100% rename from src/serviceDesk/parameters/getQueue.ts rename to src/serviceDesk/parameters/getQueue.mts diff --git a/src/serviceDesk/parameters/getQueues.ts b/src/serviceDesk/parameters/getQueues.mts similarity index 100% rename from src/serviceDesk/parameters/getQueues.ts rename to src/serviceDesk/parameters/getQueues.mts diff --git a/src/serviceDesk/parameters/getRequestCommentById.ts b/src/serviceDesk/parameters/getRequestCommentById.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestCommentById.ts rename to src/serviceDesk/parameters/getRequestCommentById.mts diff --git a/src/serviceDesk/parameters/getRequestComments.ts b/src/serviceDesk/parameters/getRequestComments.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestComments.ts rename to src/serviceDesk/parameters/getRequestComments.mts diff --git a/src/serviceDesk/parameters/getRequestParticipants.ts b/src/serviceDesk/parameters/getRequestParticipants.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestParticipants.ts rename to src/serviceDesk/parameters/getRequestParticipants.mts diff --git a/src/serviceDesk/parameters/getRequestTypeById.ts b/src/serviceDesk/parameters/getRequestTypeById.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypeById.ts rename to src/serviceDesk/parameters/getRequestTypeById.mts diff --git a/src/serviceDesk/parameters/getRequestTypeFields.ts b/src/serviceDesk/parameters/getRequestTypeFields.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypeFields.ts rename to src/serviceDesk/parameters/getRequestTypeFields.mts diff --git a/src/serviceDesk/parameters/getRequestTypeGroups.ts b/src/serviceDesk/parameters/getRequestTypeGroups.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypeGroups.ts rename to src/serviceDesk/parameters/getRequestTypeGroups.mts diff --git a/src/serviceDesk/parameters/getRequestTypes.ts b/src/serviceDesk/parameters/getRequestTypes.mts similarity index 100% rename from src/serviceDesk/parameters/getRequestTypes.ts rename to src/serviceDesk/parameters/getRequestTypes.mts diff --git a/src/serviceDesk/parameters/getServiceDeskById.ts b/src/serviceDesk/parameters/getServiceDeskById.mts similarity index 100% rename from src/serviceDesk/parameters/getServiceDeskById.ts rename to src/serviceDesk/parameters/getServiceDeskById.mts diff --git a/src/serviceDesk/parameters/getServiceDesks.ts b/src/serviceDesk/parameters/getServiceDesks.mts similarity index 100% rename from src/serviceDesk/parameters/getServiceDesks.ts rename to src/serviceDesk/parameters/getServiceDesks.mts diff --git a/src/serviceDesk/parameters/getSlaInformation.ts b/src/serviceDesk/parameters/getSlaInformation.mts similarity index 100% rename from src/serviceDesk/parameters/getSlaInformation.ts rename to src/serviceDesk/parameters/getSlaInformation.mts diff --git a/src/serviceDesk/parameters/getSlaInformationById.ts b/src/serviceDesk/parameters/getSlaInformationById.mts similarity index 100% rename from src/serviceDesk/parameters/getSlaInformationById.ts rename to src/serviceDesk/parameters/getSlaInformationById.mts diff --git a/src/serviceDesk/parameters/getSubscriptionStatus.ts b/src/serviceDesk/parameters/getSubscriptionStatus.mts similarity index 100% rename from src/serviceDesk/parameters/getSubscriptionStatus.ts rename to src/serviceDesk/parameters/getSubscriptionStatus.mts diff --git a/src/serviceDesk/parameters/getUsersInOrganization.ts b/src/serviceDesk/parameters/getUsersInOrganization.mts similarity index 100% rename from src/serviceDesk/parameters/getUsersInOrganization.ts rename to src/serviceDesk/parameters/getUsersInOrganization.mts diff --git a/src/serviceDesk/parameters/index.mts b/src/serviceDesk/parameters/index.mts new file mode 100644 index 0000000000..9f68c5578c --- /dev/null +++ b/src/serviceDesk/parameters/index.mts @@ -0,0 +1,70 @@ +export * from './addCustomers.mjs'; +export * from './addOrganization.mjs'; +export * from './addRequestParticipants.mjs'; +export * from './addUsersToOrganization.mjs'; +export * from './answerApproval.mjs'; +export * from './attachTemporaryFile.mjs'; +export * from './createAttachment.mjs'; +export * from './createCustomer.mjs'; +export * from './createCustomerRequest.mjs'; +export * from './createOrganization.mjs'; +export * from './createRequestComment.mjs'; +export * from './createRequestType.mjs'; +export * from './deleteFeedback.mjs'; +export * from './deleteOrganization.mjs'; +export * from './deleteOrganizationProperty.mjs'; +export * from './deleteProperty.mjs'; +export * from './deleteProperty.mjs'; +export * from './deleteRequestType.mjs'; +export * from './getAllRequestTypes.mjs'; +export * from './getApprovalById.mjs'; +export * from './getApprovals.mjs'; +export * from './getArticles.mjs'; +export * from './getArticles.mjs'; +export * from './getAttachmentContent.mjs'; +export * from './getAttachmentsForRequest.mjs'; +export * from './getAttachmentThumbnail.mjs'; +export * from './getCommentAttachments.mjs'; +export * from './getCustomerRequestByIdOrKey.mjs'; +export * from './getCustomerRequests.mjs'; +export * from './getCustomerRequestStatus.mjs'; +export * from './getCustomers.mjs'; +export * from './getCustomerTransitions.mjs'; +export * from './getFeedback.mjs'; +export * from './getInsightWorkspaces.mjs'; +export * from './getIssuesInQueue.mjs'; +export * from './getOrganization.mjs'; +export * from './getOrganizationProperty.mjs'; +export * from './getOrganizationPropertyKeys.mjs'; +export * from './getOrganizations.mjs'; +export * from './getOrganizations.mjs'; +export * from './getPropertiesKeys.mjs'; +export * from './getPropertiesKeys.mjs'; +export * from './getProperty.mjs'; +export * from './getProperty.mjs'; +export * from './getQueue.mjs'; +export * from './getQueues.mjs'; +export * from './getRequestCommentById.mjs'; +export * from './getRequestComments.mjs'; +export * from './getRequestParticipants.mjs'; +export * from './getRequestTypeById.mjs'; +export * from './getRequestTypeFields.mjs'; +export * from './getRequestTypeGroups.mjs'; +export * from './getRequestTypes.mjs'; +export * from './getServiceDeskById.mjs'; +export * from './getServiceDesks.mjs'; +export * from './getSlaInformation.mjs'; +export * from './getSlaInformationById.mjs'; +export * from './getSubscriptionStatus.mjs'; +export * from './getUsersInOrganization.mjs'; +export * from './performCustomerTransition.mjs'; +export * from './postFeedback.mjs'; +export * from './removeCustomers.mjs'; +export * from './removeOrganization.mjs'; +export * from './removeRequestParticipants.mjs'; +export * from './removeUsersFromOrganization.mjs'; +export * from './setOrganizationProperty.mjs'; +export * from './setProperty.mjs'; +export * from './setProperty.mjs'; +export * from './subscribe.mjs'; +export * from './unsubscribe.mjs'; diff --git a/src/serviceDesk/parameters/index.ts b/src/serviceDesk/parameters/index.ts deleted file mode 100644 index f73f22a1dd..0000000000 --- a/src/serviceDesk/parameters/index.ts +++ /dev/null @@ -1,70 +0,0 @@ -export * from './addCustomers'; -export * from './addOrganization'; -export * from './addRequestParticipants'; -export * from './addUsersToOrganization'; -export * from './answerApproval'; -export * from './attachTemporaryFile'; -export * from './createAttachment'; -export * from './createCustomer'; -export * from './createCustomerRequest'; -export * from './createOrganization'; -export * from './createRequestComment'; -export * from './createRequestType'; -export * from './deleteFeedback'; -export * from './deleteOrganization'; -export * from './deleteOrganizationProperty'; -export * from './deleteProperty'; -export * from './deleteProperty'; -export * from './deleteRequestType'; -export * from './getAllRequestTypes'; -export * from './getApprovalById'; -export * from './getApprovals'; -export * from './getArticles'; -export * from './getArticles'; -export * from './getAttachmentContent'; -export * from './getAttachmentsForRequest'; -export * from './getAttachmentThumbnail'; -export * from './getCommentAttachments'; -export * from './getCustomerRequestByIdOrKey'; -export * from './getCustomerRequests'; -export * from './getCustomerRequestStatus'; -export * from './getCustomers'; -export * from './getCustomerTransitions'; -export * from './getFeedback'; -export * from './getInsightWorkspaces'; -export * from './getIssuesInQueue'; -export * from './getOrganization'; -export * from './getOrganizationProperty'; -export * from './getOrganizationPropertyKeys'; -export * from './getOrganizations'; -export * from './getOrganizations'; -export * from './getPropertiesKeys'; -export * from './getPropertiesKeys'; -export * from './getProperty'; -export * from './getProperty'; -export * from './getQueue'; -export * from './getQueues'; -export * from './getRequestCommentById'; -export * from './getRequestComments'; -export * from './getRequestParticipants'; -export * from './getRequestTypeById'; -export * from './getRequestTypeFields'; -export * from './getRequestTypeGroups'; -export * from './getRequestTypes'; -export * from './getServiceDeskById'; -export * from './getServiceDesks'; -export * from './getSlaInformation'; -export * from './getSlaInformationById'; -export * from './getSubscriptionStatus'; -export * from './getUsersInOrganization'; -export * from './performCustomerTransition'; -export * from './postFeedback'; -export * from './removeCustomers'; -export * from './removeOrganization'; -export * from './removeRequestParticipants'; -export * from './removeUsersFromOrganization'; -export * from './setOrganizationProperty'; -export * from './setProperty'; -export * from './setProperty'; -export * from './subscribe'; -export * from './unsubscribe'; diff --git a/src/serviceDesk/parameters/performCustomerTransition.mts b/src/serviceDesk/parameters/performCustomerTransition.mts new file mode 100644 index 0000000000..4f039a7deb --- /dev/null +++ b/src/serviceDesk/parameters/performCustomerTransition.mts @@ -0,0 +1,6 @@ +import { CustomerTransitionExecution } from '../models/index.mjs'; + +export interface PerformCustomerTransition extends CustomerTransitionExecution { + /** ID or key of the issue to transition */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/performCustomerTransition.ts b/src/serviceDesk/parameters/performCustomerTransition.ts deleted file mode 100644 index 6381226a2c..0000000000 --- a/src/serviceDesk/parameters/performCustomerTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomerTransitionExecution } from '../models'; - -export interface PerformCustomerTransition extends CustomerTransitionExecution { - /** ID or key of the issue to transition */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/postFeedback.mts b/src/serviceDesk/parameters/postFeedback.mts new file mode 100644 index 0000000000..ab60035f53 --- /dev/null +++ b/src/serviceDesk/parameters/postFeedback.mts @@ -0,0 +1,6 @@ +import { CsatFeedbackFull } from '../models/index.mjs'; + +export interface PostFeedback extends CsatFeedbackFull { + /** The id or the key of the request to post the feedback on */ + requestIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/postFeedback.ts b/src/serviceDesk/parameters/postFeedback.ts deleted file mode 100644 index e9da10d5ba..0000000000 --- a/src/serviceDesk/parameters/postFeedback.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CsatFeedbackFull } from '../models'; - -export interface PostFeedback extends CsatFeedbackFull { - /** The id or the key of the request to post the feedback on */ - requestIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/removeCustomers.mts b/src/serviceDesk/parameters/removeCustomers.mts new file mode 100644 index 0000000000..c0e964b866 --- /dev/null +++ b/src/serviceDesk/parameters/removeCustomers.mts @@ -0,0 +1,9 @@ +import { ServiceDeskCustomer } from '../models/index.mjs'; + +export interface RemoveCustomers extends ServiceDeskCustomer { + /** + * The ID of the service desk the customers should be removed from. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/removeCustomers.ts b/src/serviceDesk/parameters/removeCustomers.ts deleted file mode 100644 index 4fbf843f12..0000000000 --- a/src/serviceDesk/parameters/removeCustomers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ServiceDeskCustomer } from '../models'; - -export interface RemoveCustomers extends ServiceDeskCustomer { - /** - * The ID of the service desk the customers should be removed from. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/removeOrganization.mts b/src/serviceDesk/parameters/removeOrganization.mts new file mode 100644 index 0000000000..a2d9270b73 --- /dev/null +++ b/src/serviceDesk/parameters/removeOrganization.mts @@ -0,0 +1,9 @@ +import { OrganizationServiceDeskUpdate } from '../models/index.mjs'; + +export interface RemoveOrganization extends OrganizationServiceDeskUpdate { + /** + * The ID of the service desk from which the organization will be removed. This can alternatively be a [project + * identifier.](#project-identifiers) + */ + serviceDeskId: string; +} diff --git a/src/serviceDesk/parameters/removeOrganization.ts b/src/serviceDesk/parameters/removeOrganization.ts deleted file mode 100644 index 761ff8370e..0000000000 --- a/src/serviceDesk/parameters/removeOrganization.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { OrganizationServiceDeskUpdate } from '../models'; - -export interface RemoveOrganization extends OrganizationServiceDeskUpdate { - /** - * The ID of the service desk from which the organization will be removed. This can alternatively be a [project - * identifier.](#project-identifiers) - */ - serviceDeskId: string; -} diff --git a/src/serviceDesk/parameters/removeRequestParticipants.mts b/src/serviceDesk/parameters/removeRequestParticipants.mts new file mode 100644 index 0000000000..e5e0e03214 --- /dev/null +++ b/src/serviceDesk/parameters/removeRequestParticipants.mts @@ -0,0 +1,6 @@ +import { RequestParticipantUpdate } from '../models/index.mjs'; + +export interface RemoveRequestParticipants extends RequestParticipantUpdate { + /** The ID or key of the customer request to have participants removed. */ + issueIdOrKey: string; +} diff --git a/src/serviceDesk/parameters/removeRequestParticipants.ts b/src/serviceDesk/parameters/removeRequestParticipants.ts deleted file mode 100644 index a580c3c5a6..0000000000 --- a/src/serviceDesk/parameters/removeRequestParticipants.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RequestParticipantUpdate } from '../models'; - -export interface RemoveRequestParticipants extends RequestParticipantUpdate { - /** The ID or key of the customer request to have participants removed. */ - issueIdOrKey: string; -} diff --git a/src/serviceDesk/parameters/removeUsersFromOrganization.mts b/src/serviceDesk/parameters/removeUsersFromOrganization.mts new file mode 100644 index 0000000000..4730d72cff --- /dev/null +++ b/src/serviceDesk/parameters/removeUsersFromOrganization.mts @@ -0,0 +1,6 @@ +import { UsersOrganizationUpdate } from '../models/index.mjs'; + +export interface RemoveUsersFromOrganization extends UsersOrganizationUpdate { + /** The ID of the organization. */ + organizationId: number; +} diff --git a/src/serviceDesk/parameters/removeUsersFromOrganization.ts b/src/serviceDesk/parameters/removeUsersFromOrganization.ts deleted file mode 100644 index a32030a4b5..0000000000 --- a/src/serviceDesk/parameters/removeUsersFromOrganization.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UsersOrganizationUpdate } from '../models'; - -export interface RemoveUsersFromOrganization extends UsersOrganizationUpdate { - /** The ID of the organization. */ - organizationId: number; -} diff --git a/src/serviceDesk/parameters/setOrganizationProperty.ts b/src/serviceDesk/parameters/setOrganizationProperty.mts similarity index 100% rename from src/serviceDesk/parameters/setOrganizationProperty.ts rename to src/serviceDesk/parameters/setOrganizationProperty.mts diff --git a/src/serviceDesk/parameters/setProperty.ts b/src/serviceDesk/parameters/setProperty.mts similarity index 100% rename from src/serviceDesk/parameters/setProperty.ts rename to src/serviceDesk/parameters/setProperty.mts diff --git a/src/serviceDesk/parameters/subscribe.ts b/src/serviceDesk/parameters/subscribe.mts similarity index 100% rename from src/serviceDesk/parameters/subscribe.ts rename to src/serviceDesk/parameters/subscribe.mts diff --git a/src/serviceDesk/parameters/unsubscribe.ts b/src/serviceDesk/parameters/unsubscribe.mts similarity index 100% rename from src/serviceDesk/parameters/unsubscribe.ts rename to src/serviceDesk/parameters/unsubscribe.mts diff --git a/src/serviceDesk/request.mts b/src/serviceDesk/request.mts new file mode 100644 index 0000000000..e921c9a7d6 --- /dev/null +++ b/src/serviceDesk/request.mts @@ -0,0 +1,1105 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Request { + constructor(private client: Client) {} + + /** + * This method returns all customer requests for the user executing the query. + * + * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the + * latest status transition or comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, the list returned will include request they created (or were created on + * their behalf) or are participating in only. + */ + async getCustomerRequests( + parameters: Parameters.GetCustomerRequests | undefined, + callback: Callback, + ): Promise; + /** + * This method returns all customer requests for the user executing the query. + * + * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the + * latest status transition or comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, the list returned will include request they created (or were created on + * their behalf) or are participating in only. + */ + async getCustomerRequests( + parameters?: Parameters.GetCustomerRequests, + callback?: never, + ): Promise; + async getCustomerRequests( + parameters?: Parameters.GetCustomerRequests, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/request', + method: 'GET', + params: { + searchTerm: parameters?.searchTerm, + requestStatus: parameters?.requestStatus, + approvalStatus: parameters?.approvalStatus, + organizationId: parameters?.organizationId, + serviceDeskId: parameters?.serviceDeskId, + requestTypeId: parameters?.requestTypeId, + expand: parameters?.expand, + start: parameters?.start, + limit: parameters?.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method creates a customer request in a service desk. + * + * The JSON request must include the service desk and customer request type, as well as any fields that are required + * for the request type. A list of the fields required by a customer request type can be obtained using + * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). + * + * The fields required for a customer request type depend on the user's permissions: + * + * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. + * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned + * off for customers. + * + * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for + * details of each field's JSON semantics and the values they can take. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to create requests in the specified service desk. + */ + async createCustomerRequest( + parameters: Parameters.CreateCustomerRequest | undefined, + callback: Callback, + ): Promise; + /** + * This method creates a customer request in a service desk. + * + * The JSON request must include the service desk and customer request type, as well as any fields that are required + * for the request type. A list of the fields required by a customer request type can be obtained using + * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). + * + * The fields required for a customer request type depend on the user's permissions: + * + * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. + * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned + * off for customers. + * + * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for + * details of each field's JSON semantics and the values they can take. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to create requests in the specified service desk. + */ + async createCustomerRequest( + parameters?: Parameters.CreateCustomerRequest, + callback?: never, + ): Promise; + async createCustomerRequest( + parameters?: Parameters.CreateCustomerRequest, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/request', + method: 'POST', + data: { + serviceDeskId: parameters?.serviceDeskId, + requestTypeId: parameters?.requestTypeId, + requestFieldValues: parameters?.requestFieldValues, + requestParticipants: parameters?.requestParticipants, + raiseOnBehalfOf: parameters?.raiseOnBehalfOf, + channel: parameters?.channel, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are + * participating in will be returned. + */ + async getCustomerRequestByIdOrKey( + parameters: Parameters.GetCustomerRequestByIdOrKey, + callback: Callback, + ): Promise; + /** + * This method returns a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the specified service desk. + * + * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are + * participating in will be returned. + */ + async getCustomerRequestByIdOrKey( + parameters: Parameters.GetCustomerRequestByIdOrKey, + callback?: never, + ): Promise; + async getCustomerRequestByIdOrKey( + parameters: Parameters.GetCustomerRequestByIdOrKey, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all approvals on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovals( + parameters: Parameters.GetApprovals, + callback: Callback, + ): Promise; + /** + * This method returns all approvals on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovals(parameters: Parameters.GetApprovals, callback?: never): Promise; + async getApprovals( + parameters: Parameters.GetApprovals, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovalById( + parameters: Parameters.GetApprovalById, + callback: Callback, + ): Promise; + /** + * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getApprovalById(parameters: Parameters.GetApprovalById, callback?: never): Promise; + async getApprovalById( + parameters: Parameters.GetApprovalById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed + * to be owned by the user making the call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * is assigned to the approval request. + */ + async answerApproval( + parameters: Parameters.AnswerApproval, + callback: Callback, + ): Promise; + /** + * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed + * to be owned by the user making the call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * is assigned to the approval request. + */ + async answerApproval(parameters: Parameters.AnswerApproval, callback?: never): Promise; + async answerApproval( + parameters: Parameters.AnswerApproval, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, + method: 'POST', + data: { + decision: parameters.decision, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all the attachments for a customer requests. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers will only get a list of public attachments. + */ + async getAttachmentsForRequest( + parameters: Parameters.GetAttachmentsForRequest, + callback: Callback, + ): Promise; + /** + * This method returns all the attachments for a customer requests. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers will only get a list of public attachments. + */ + async getAttachmentsForRequest( + parameters: Parameters.GetAttachmentsForRequest, + callback?: never, + ): Promise; + async getAttachmentsForRequest( + parameters: Parameters.GetAttachmentsForRequest, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds one or more temporary files (attached to the request's service desk using + * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as + * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible + * to include a comment with the attachments. + * + * To get a list of attachments for a comment on the request use + * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add an attachment. + * + * **Request limitations**: Customers can set attachments to public visibility only. + */ + async createAttachment( + parameters: Parameters.CreateAttachment, + callback: Callback, + ): Promise; + /** + * This method adds one or more temporary files (attached to the request's service desk using + * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as + * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible + * to include a comment with the attachments. + * + * To get a list of attachments for a comment on the request use + * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add an attachment. + * + * **Request limitations**: Customers can set attachments to public visibility only. + */ + async createAttachment( + parameters: Parameters.CreateAttachment, + callback?: never, + ): Promise; + async createAttachment( + parameters: Parameters.CreateAttachment, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, + method: 'POST', + data: { + temporaryAttachmentIds: parameters.temporaryAttachmentIds, + additionalComment: parameters.additionalComment, + public: parameters.public, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the contents of an attachment. + * + * To return a thumbnail of the attachment, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _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 getAttachmentContent( + parameters: Parameters.GetAttachmentContent, + callback: Callback, + ): Promise; + /** + * Returns the contents of an attachment. + * + * To return a thumbnail of the attachment, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _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 getAttachmentContent(parameters: Parameters.GetAttachmentContent, callback?: never): Promise; + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _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 getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail, + callback: Callback, + ): Promise; + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use + * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). + * + * **[Permissions](#permissions) required:** For the issue containing the attachment: + * + * - _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 getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail, + callback?: never, + ): Promise; + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}/thumbnail`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all comments on a customer request. No permissions error is provided if, for example, the user + * doesn't have access to the service desk or request, the method simply returns an empty response. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers are returned public comments only. + */ + async getRequestComments( + parameters: Parameters.GetRequestComments, + callback: Callback, + ): Promise; + /** + * This method returns all comments on a customer request. No permissions error is provided if, for example, the user + * doesn't have access to the service desk or request, the method simply returns an empty response. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers are returned public comments only. + */ + async getRequestComments( + parameters: Parameters.GetRequestComments, + callback?: never, + ): Promise; + async getRequestComments( + parameters: Parameters.GetRequestComments, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, + method: 'GET', + params: { + public: parameters.public, + internal: parameters.internal, + expand: parameters.expand, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method creates a public or private (internal) comment on a customer request, with the comment visibility set + * by `public`. The user recorded as the author of the comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has Add Comments permission. + * + * **Request limitations**: Customers can set comments to public visibility only. + */ + async createRequestComment( + parameters: Parameters.CreateRequestComment, + callback: Callback, + ): Promise; + /** + * This method creates a public or private (internal) comment on a customer request, with the comment visibility set + * by `public`. The user recorded as the author of the comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has Add Comments permission. + * + * **Request limitations**: Customers can set comments to public visibility only. + */ + async createRequestComment( + parameters: Parameters.CreateRequestComment, + callback?: never, + ): Promise; + async createRequestComment( + parameters: Parameters.CreateRequestComment, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, + method: 'POST', + data: { + body: parameters.body, + public: parameters.public, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns details of a customer request's comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a + * participant whereas agents can see both internal and public comments. + */ + async getRequestCommentById( + parameters: Parameters.GetRequestCommentById, + callback: Callback, + ): Promise; + /** + * This method returns details of a customer request's comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a + * participant whereas agents can see both internal and public comments. + */ + async getRequestCommentById( + parameters: Parameters.GetRequestCommentById, + callback?: never, + ): Promise; + async getRequestCommentById( + parameters: Parameters.GetRequestCommentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the attachments referenced in a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests + * where they are the reporter or a participant whereas agents can see both internal and public comments. + */ + async getCommentAttachments( + parameters: Parameters.GetCommentAttachments, + callback: Callback, + ): Promise; + /** + * This method returns the attachments referenced in a comment. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + * + * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests + * where they are the reporter or a participant whereas agents can see both internal and public comments. + */ + async getCommentAttachments( + parameters: Parameters.GetCommentAttachments, + callback?: never, + ): Promise; + async getCommentAttachments( + parameters: Parameters.GetCommentAttachments, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}/attachment`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the notification subscription status of the user making the request. Use this method to + * determine if the user is subscribed to a customer request's notifications. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getSubscriptionStatus( + parameters: Parameters.GetSubscriptionStatus, + callback: Callback, + ): Promise; + /** + * This method returns the notification subscription status of the user making the request. Use this method to + * determine if the user is subscribed to a customer request's notifications. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getSubscriptionStatus( + parameters: Parameters.GetSubscriptionStatus, + callback?: never, + ): Promise; + async getSubscriptionStatus( + parameters: Parameters.GetSubscriptionStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method subscribes the user to receiving notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async subscribe(parameters: Parameters.Subscribe, callback: Callback): Promise; + /** + * This method subscribes the user to receiving notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async subscribe(parameters: Parameters.Subscribe, callback?: never): Promise; + async subscribe(parameters: Parameters.Subscribe, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method unsubscribes the user from notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async unsubscribe(parameters: Parameters.Unsubscribe, callback: Callback): Promise; + /** + * This method unsubscribes the user from notifications from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async unsubscribe(parameters: Parameters.Unsubscribe, callback?: never): Promise; + async unsubscribe(parameters: Parameters.Unsubscribe, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of all the participants on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getRequestParticipants( + parameters: Parameters.GetRequestParticipants, + callback: Callback, + ): Promise; + /** + * This method returns a list of all the participants on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getRequestParticipants( + parameters: Parameters.GetRequestParticipants, + callback?: never, + ): Promise; + async getRequestParticipants( + parameters: Parameters.GetRequestParticipants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds participants to a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + * + * Note, participants can be added when creating a customer request using the + * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining + * the participants in the `requestParticipants` field. + */ + async addRequestParticipants( + parameters: Parameters.AddRequestParticipants, + callback: Callback, + ): Promise; + /** + * This method adds participants to a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + * + * Note, participants can be added when creating a customer request using the + * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining + * the participants in the `requestParticipants` field. + */ + async addRequestParticipants( + parameters: Parameters.AddRequestParticipants, + callback?: never, + ): Promise; + async addRequestParticipants( + parameters: Parameters.AddRequestParticipants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, + method: 'POST', + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes participants from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + */ + async removeRequestParticipants( + parameters: Parameters.RemoveRequestParticipants, + callback: Callback, + ): Promise; + /** + * This method removes participants from a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to manage participants on the customer request. + */ + async removeRequestParticipants( + parameters: Parameters.RemoveRequestParticipants, + callback?: never, + ): Promise; + async removeRequestParticipants( + parameters: Parameters.RemoveRequestParticipants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, + method: 'DELETE', + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each + * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes + * information on when it started and stopped, and whether it breached the SLA goal. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformation( + parameters: Parameters.GetSlaInformation, + callback: Callback, + ): Promise; + /** + * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each + * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes + * information on when it started and stopped, and whether it breached the SLA goal. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformation( + parameters: Parameters.GetSlaInformation, + callback?: never, + ): Promise; + async getSlaInformation( + parameters: Parameters.GetSlaInformation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the details for an SLA on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformationById( + parameters: Parameters.GetSlaInformationById, + callback: Callback, + ): Promise; + /** + * This method returns the details for an SLA on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent + * for the Service Desk containing the queried customer request. + */ + async getSlaInformationById( + parameters: Parameters.GetSlaInformationById, + callback?: never, + ): Promise; + async getSlaInformationById( + parameters: Parameters.GetSlaInformationById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla/${parameters.slaMetricId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an + * issue in its workflow. An issue can have one active status only. The list returns the status history in + * chronological order, most recent (current) status first. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerRequestStatus( + parameters: Parameters.GetCustomerRequestStatus, + callback: Callback, + ): Promise; + /** + * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an + * issue in its workflow. An issue can have one active status only. The list returns the status history in + * chronological order, most recent (current) status first. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerRequestStatus( + parameters: Parameters.GetCustomerRequestStatus, + callback?: never, + ): Promise; + async getCustomerRequestStatus( + parameters: Parameters.GetCustomerRequestStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/status`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of transitions, the workflow processes that moves a customer request from one status to + * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they + * can take on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerTransitions( + parameters: Parameters.GetCustomerTransitions, + callback: Callback, + ): Promise; + /** + * This method returns a list of transitions, the workflow processes that moves a customer request from one status to + * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they + * can take on a customer request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the customer request. + */ + async getCustomerTransitions( + parameters: Parameters.GetCustomerTransitions, + callback?: never, + ): Promise; + async getCustomerTransitions( + parameters: Parameters.GetCustomerTransitions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method performs a customer transition for a given request and transition. An optional comment can be included + * to provide a reason for the transition. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user + * must have the Add Comments permission. + */ + async performCustomerTransition( + parameters: Parameters.PerformCustomerTransition, + callback: Callback, + ): Promise; + /** + * This method performs a customer transition for a given request and transition. An optional comment can be included + * to provide a reason for the transition. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user + * must have the Add Comments permission. + */ + async performCustomerTransition( + parameters: Parameters.PerformCustomerTransition, + callback?: never, + ): Promise; + async performCustomerTransition( + parameters: Parameters.PerformCustomerTransition, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, + method: 'POST', + data: { + id: parameters.id, + additionalComment: parameters.additionalComment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method retrieves a feedback of a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has view request permissions. + */ + async getFeedback( + parameters: Parameters.GetFeedback, + callback: Callback, + ): Promise; + /** + * This method retrieves a feedback of a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * has view request permissions. + */ + async getFeedback(parameters: Parameters.GetFeedback, callback?: never): Promise; + async getFeedback( + parameters: Parameters.GetFeedback, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds a feedback on a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async postFeedback( + parameters: Parameters.PostFeedback, + callback: Callback, + ): Promise; + /** + * This method adds a feedback on a request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async postFeedback(parameters: Parameters.PostFeedback, callback?: never): Promise; + async postFeedback( + parameters: Parameters.PostFeedback, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, + method: 'POST', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + data: { + type: parameters.type, + rating: parameters.rating, + comment: parameters.comment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method deletes the feedback of request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async deleteFeedback(parameters: Parameters.DeleteFeedback, callback: Callback): Promise; + /** + * This method deletes the feedback of request using it's `requestKey` or `requestId` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must be the reporter or an Atlassian Connect app. + */ + async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: never): Promise; + async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/request.ts b/src/serviceDesk/request.ts deleted file mode 100644 index 0370bd7dac..0000000000 --- a/src/serviceDesk/request.ts +++ /dev/null @@ -1,1105 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Request { - constructor(private client: Client) {} - - /** - * This method returns all customer requests for the user executing the query. - * - * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the - * latest status transition or comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, the list returned will include request they created (or were created on - * their behalf) or are participating in only. - */ - async getCustomerRequests( - parameters: Parameters.GetCustomerRequests | undefined, - callback: Callback, - ): Promise; - /** - * This method returns all customer requests for the user executing the query. - * - * The returned customer requests are ordered chronologically by the latest activity on each request. For example, the - * latest status transition or comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, the list returned will include request they created (or were created on - * their behalf) or are participating in only. - */ - async getCustomerRequests( - parameters?: Parameters.GetCustomerRequests, - callback?: never, - ): Promise; - async getCustomerRequests( - parameters?: Parameters.GetCustomerRequests, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/request', - method: 'GET', - params: { - searchTerm: parameters?.searchTerm, - requestStatus: parameters?.requestStatus, - approvalStatus: parameters?.approvalStatus, - organizationId: parameters?.organizationId, - serviceDeskId: parameters?.serviceDeskId, - requestTypeId: parameters?.requestTypeId, - expand: parameters?.expand, - start: parameters?.start, - limit: parameters?.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method creates a customer request in a service desk. - * - * The JSON request must include the service desk and customer request type, as well as any fields that are required - * for the request type. A list of the fields required by a customer request type can be obtained using - * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). - * - * The fields required for a customer request type depend on the user's permissions: - * - * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. - * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned - * off for customers. - * - * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for - * details of each field's JSON semantics and the values they can take. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to create requests in the specified service desk. - */ - async createCustomerRequest( - parameters: Parameters.CreateCustomerRequest | undefined, - callback: Callback, - ): Promise; - /** - * This method creates a customer request in a service desk. - * - * The JSON request must include the service desk and customer request type, as well as any fields that are required - * for the request type. A list of the fields required by a customer request type can be obtained using - * [servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field](#api-servicedesk-serviceDeskId-requesttype-requestTypeId-field-get). - * - * The fields required for a customer request type depend on the user's permissions: - * - * - `raiseOnBehalfOf` is not available to Users who have the customer permission only. - * - `requestParticipants` is not available to Users who have the customer permission only or if the feature is turned - * off for customers. - * - * `requestFieldValues` is a map of Jira field IDs and their values. See [Field input formats](#fieldformats), for - * details of each field's JSON semantics and the values they can take. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to create requests in the specified service desk. - */ - async createCustomerRequest( - parameters?: Parameters.CreateCustomerRequest, - callback?: never, - ): Promise; - async createCustomerRequest( - parameters?: Parameters.CreateCustomerRequest, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/request', - method: 'POST', - data: { - serviceDeskId: parameters?.serviceDeskId, - requestTypeId: parameters?.requestTypeId, - requestFieldValues: parameters?.requestFieldValues, - requestParticipants: parameters?.requestParticipants, - raiseOnBehalfOf: parameters?.raiseOnBehalfOf, - channel: parameters?.channel, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are - * participating in will be returned. - */ - async getCustomerRequestByIdOrKey( - parameters: Parameters.GetCustomerRequestByIdOrKey, - callback: Callback, - ): Promise; - /** - * This method returns a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the specified service desk. - * - * **Response limitations**: For customers, only a request they created, was created on their behalf, or they are - * participating in will be returned. - */ - async getCustomerRequestByIdOrKey( - parameters: Parameters.GetCustomerRequestByIdOrKey, - callback?: never, - ): Promise; - async getCustomerRequestByIdOrKey( - parameters: Parameters.GetCustomerRequestByIdOrKey, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all approvals on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovals( - parameters: Parameters.GetApprovals, - callback: Callback, - ): Promise; - /** - * This method returns all approvals on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovals(parameters: Parameters.GetApprovals, callback?: never): Promise; - async getApprovals( - parameters: Parameters.GetApprovals, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovalById( - parameters: Parameters.GetApprovalById, - callback: Callback, - ): Promise; - /** - * This method returns an approval. Use this method to determine the status of an approval and the list of approvers. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getApprovalById(parameters: Parameters.GetApprovalById, callback?: never): Promise; - async getApprovalById( - parameters: Parameters.GetApprovalById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed - * to be owned by the user making the call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * is assigned to the approval request. - */ - async answerApproval( - parameters: Parameters.AnswerApproval, - callback: Callback, - ): Promise; - /** - * This method enables a user to **Approve** or **Decline** an approval on a customer request. The approval is assumed - * to be owned by the user making the call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * is assigned to the approval request. - */ - async answerApproval(parameters: Parameters.AnswerApproval, callback?: never): Promise; - async answerApproval( - parameters: Parameters.AnswerApproval, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/approval/${parameters.approvalId}`, - method: 'POST', - data: { - decision: parameters.decision, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all the attachments for a customer requests. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers will only get a list of public attachments. - */ - async getAttachmentsForRequest( - parameters: Parameters.GetAttachmentsForRequest, - callback: Callback, - ): Promise; - /** - * This method returns all the attachments for a customer requests. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers will only get a list of public attachments. - */ - async getAttachmentsForRequest( - parameters: Parameters.GetAttachmentsForRequest, - callback?: never, - ): Promise; - async getAttachmentsForRequest( - parameters: Parameters.GetAttachmentsForRequest, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds one or more temporary files (attached to the request's service desk using - * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as - * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible - * to include a comment with the attachments. - * - * To get a list of attachments for a comment on the request use - * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add an attachment. - * - * **Request limitations**: Customers can set attachments to public visibility only. - */ - async createAttachment( - parameters: Parameters.CreateAttachment, - callback: Callback, - ): Promise; - /** - * This method adds one or more temporary files (attached to the request's service desk using - * [servicedesk/{serviceDeskId}/attachTemporaryFile](#api-servicedesk-serviceDeskId-attachTemporaryFile-post)) as - * attachments to a customer request and set the attachment visibility using the `public` flag. Also, it is possible - * to include a comment with the attachments. - * - * To get a list of attachments for a comment on the request use - * [servicedeskapi/request/{issueIdOrKey}/comment/{commentId}/attachment](#api-request-issueIdOrKey-comment-commentId-attachment-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add an attachment. - * - * **Request limitations**: Customers can set attachments to public visibility only. - */ - async createAttachment( - parameters: Parameters.CreateAttachment, - callback?: never, - ): Promise; - async createAttachment( - parameters: Parameters.CreateAttachment, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment`, - method: 'POST', - data: { - temporaryAttachmentIds: parameters.temporaryAttachmentIds, - additionalComment: parameters.additionalComment, - public: parameters.public, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the contents of an attachment. - * - * To return a thumbnail of the attachment, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _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 getAttachmentContent( - parameters: Parameters.GetAttachmentContent, - callback: Callback, - ): Promise; - /** - * Returns the contents of an attachment. - * - * To return a thumbnail of the attachment, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}/thumbnail](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-thumbnail-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _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 getAttachmentContent(parameters: Parameters.GetAttachmentContent, callback?: never): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _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 getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use - * [servicedeskapi/request/{issueIdOrKey}/attachment/{attachmentId}](#api-rest-servicedeskapi-request-issueidorkey-attachment-attachmentid-get). - * - * **[Permissions](#permissions) required:** For the issue containing the attachment: - * - * - _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 getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail, - callback?: never, - ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/attachment/${parameters.attachmentId}/thumbnail`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all comments on a customer request. No permissions error is provided if, for example, the user - * doesn't have access to the service desk or request, the method simply returns an empty response. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers are returned public comments only. - */ - async getRequestComments( - parameters: Parameters.GetRequestComments, - callback: Callback, - ): Promise; - /** - * This method returns all comments on a customer request. No permissions error is provided if, for example, the user - * doesn't have access to the service desk or request, the method simply returns an empty response. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers are returned public comments only. - */ - async getRequestComments( - parameters: Parameters.GetRequestComments, - callback?: never, - ): Promise; - async getRequestComments( - parameters: Parameters.GetRequestComments, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, - method: 'GET', - params: { - public: parameters.public, - internal: parameters.internal, - expand: parameters.expand, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method creates a public or private (internal) comment on a customer request, with the comment visibility set - * by `public`. The user recorded as the author of the comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has Add Comments permission. - * - * **Request limitations**: Customers can set comments to public visibility only. - */ - async createRequestComment( - parameters: Parameters.CreateRequestComment, - callback: Callback, - ): Promise; - /** - * This method creates a public or private (internal) comment on a customer request, with the comment visibility set - * by `public`. The user recorded as the author of the comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has Add Comments permission. - * - * **Request limitations**: Customers can set comments to public visibility only. - */ - async createRequestComment( - parameters: Parameters.CreateRequestComment, - callback?: never, - ): Promise; - async createRequestComment( - parameters: Parameters.CreateRequestComment, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment`, - method: 'POST', - data: { - body: parameters.body, - public: parameters.public, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns details of a customer request's comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a - * participant whereas agents can see both internal and public comments. - */ - async getRequestCommentById( - parameters: Parameters.GetRequestCommentById, - callback: Callback, - ): Promise; - /** - * This method returns details of a customer request's comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments on requests where they are the reporter or a - * participant whereas agents can see both internal and public comments. - */ - async getRequestCommentById( - parameters: Parameters.GetRequestCommentById, - callback?: never, - ): Promise; - async getRequestCommentById( - parameters: Parameters.GetRequestCommentById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the attachments referenced in a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests - * where they are the reporter or a participant whereas agents can see both internal and public comments. - */ - async getCommentAttachments( - parameters: Parameters.GetCommentAttachments, - callback: Callback, - ): Promise; - /** - * This method returns the attachments referenced in a comment. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - * - * **Response limitations**: Customers can only view public comments, and retrieve their attachments, on requests - * where they are the reporter or a participant whereas agents can see both internal and public comments. - */ - async getCommentAttachments( - parameters: Parameters.GetCommentAttachments, - callback?: never, - ): Promise; - async getCommentAttachments( - parameters: Parameters.GetCommentAttachments, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/comment/${parameters.commentId}/attachment`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the notification subscription status of the user making the request. Use this method to - * determine if the user is subscribed to a customer request's notifications. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getSubscriptionStatus( - parameters: Parameters.GetSubscriptionStatus, - callback: Callback, - ): Promise; - /** - * This method returns the notification subscription status of the user making the request. Use this method to - * determine if the user is subscribed to a customer request's notifications. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getSubscriptionStatus( - parameters: Parameters.GetSubscriptionStatus, - callback?: never, - ): Promise; - async getSubscriptionStatus( - parameters: Parameters.GetSubscriptionStatus, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method subscribes the user to receiving notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async subscribe(parameters: Parameters.Subscribe, callback: Callback): Promise; - /** - * This method subscribes the user to receiving notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async subscribe(parameters: Parameters.Subscribe, callback?: never): Promise; - async subscribe(parameters: Parameters.Subscribe, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method unsubscribes the user from notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async unsubscribe(parameters: Parameters.Unsubscribe, callback: Callback): Promise; - /** - * This method unsubscribes the user from notifications from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async unsubscribe(parameters: Parameters.Unsubscribe, callback?: never): Promise; - async unsubscribe(parameters: Parameters.Unsubscribe, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/notification`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of all the participants on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getRequestParticipants( - parameters: Parameters.GetRequestParticipants, - callback: Callback, - ): Promise; - /** - * This method returns a list of all the participants on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getRequestParticipants( - parameters: Parameters.GetRequestParticipants, - callback?: never, - ): Promise; - async getRequestParticipants( - parameters: Parameters.GetRequestParticipants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds participants to a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - * - * Note, participants can be added when creating a customer request using the - * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining - * the participants in the `requestParticipants` field. - */ - async addRequestParticipants( - parameters: Parameters.AddRequestParticipants, - callback: Callback, - ): Promise; - /** - * This method adds participants to a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - * - * Note, participants can be added when creating a customer request using the - * [request](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/) resource, by defining - * the participants in the `requestParticipants` field. - */ - async addRequestParticipants( - parameters: Parameters.AddRequestParticipants, - callback?: never, - ): Promise; - async addRequestParticipants( - parameters: Parameters.AddRequestParticipants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, - method: 'POST', - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes participants from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - */ - async removeRequestParticipants( - parameters: Parameters.RemoveRequestParticipants, - callback: Callback, - ): Promise; - /** - * This method removes participants from a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to manage participants on the customer request. - */ - async removeRequestParticipants( - parameters: Parameters.RemoveRequestParticipants, - callback?: never, - ): Promise; - async removeRequestParticipants( - parameters: Parameters.RemoveRequestParticipants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/participant`, - method: 'DELETE', - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each - * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes - * information on when it started and stopped, and whether it breached the SLA goal. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformation( - parameters: Parameters.GetSlaInformation, - callback: Callback, - ): Promise; - /** - * This method returns all the SLA records on a customer request. A customer request can have zero or more SLAs. Each - * SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle". Each cycle includes - * information on when it started and stopped, and whether it breached the SLA goal. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformation( - parameters: Parameters.GetSlaInformation, - callback?: never, - ): Promise; - async getSlaInformation( - parameters: Parameters.GetSlaInformation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the details for an SLA on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformationById( - parameters: Parameters.GetSlaInformationById, - callback: Callback, - ): Promise; - /** - * This method returns the details for an SLA on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Agent - * for the Service Desk containing the queried customer request. - */ - async getSlaInformationById( - parameters: Parameters.GetSlaInformationById, - callback?: never, - ): Promise; - async getSlaInformationById( - parameters: Parameters.GetSlaInformationById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/sla/${parameters.slaMetricId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an - * issue in its workflow. An issue can have one active status only. The list returns the status history in - * chronological order, most recent (current) status first. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerRequestStatus( - parameters: Parameters.GetCustomerRequestStatus, - callback: Callback, - ): Promise; - /** - * This method returns a list of all the statuses a customer Request has achieved. A status represents the state of an - * issue in its workflow. An issue can have one active status only. The list returns the status history in - * chronological order, most recent (current) status first. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerRequestStatus( - parameters: Parameters.GetCustomerRequestStatus, - callback?: never, - ): Promise; - async getCustomerRequestStatus( - parameters: Parameters.GetCustomerRequestStatus, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/status`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of transitions, the workflow processes that moves a customer request from one status to - * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they - * can take on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerTransitions( - parameters: Parameters.GetCustomerTransitions, - callback: Callback, - ): Promise; - /** - * This method returns a list of transitions, the workflow processes that moves a customer request from one status to - * another, that the user can perform on a request. Use this method to provide a user with a list if the actions they - * can take on a customer request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the customer request. - */ - async getCustomerTransitions( - parameters: Parameters.GetCustomerTransitions, - callback?: never, - ): Promise; - async getCustomerTransitions( - parameters: Parameters.GetCustomerTransitions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method performs a customer transition for a given request and transition. An optional comment can be included - * to provide a reason for the transition. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user - * must have the Add Comments permission. - */ - async performCustomerTransition( - parameters: Parameters.PerformCustomerTransition, - callback: Callback, - ): Promise; - /** - * This method performs a customer transition for a given request and transition. An optional comment can be included - * to provide a reason for the transition. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must be able to view the request and have the Transition Issues permission. If a comment is passed the user - * must have the Add Comments permission. - */ - async performCustomerTransition( - parameters: Parameters.PerformCustomerTransition, - callback?: never, - ): Promise; - async performCustomerTransition( - parameters: Parameters.PerformCustomerTransition, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.issueIdOrKey}/transition`, - method: 'POST', - data: { - id: parameters.id, - additionalComment: parameters.additionalComment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method retrieves a feedback of a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has view request permissions. - */ - async getFeedback( - parameters: Parameters.GetFeedback, - callback: Callback, - ): Promise; - /** - * This method retrieves a feedback of a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * has view request permissions. - */ - async getFeedback(parameters: Parameters.GetFeedback, callback?: never): Promise; - async getFeedback( - parameters: Parameters.GetFeedback, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds a feedback on a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async postFeedback( - parameters: Parameters.PostFeedback, - callback: Callback, - ): Promise; - /** - * This method adds a feedback on a request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async postFeedback(parameters: Parameters.PostFeedback, callback?: never): Promise; - async postFeedback( - parameters: Parameters.PostFeedback, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, - method: 'POST', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - data: { - type: parameters.type, - rating: parameters.rating, - comment: parameters.comment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method deletes the feedback of request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async deleteFeedback(parameters: Parameters.DeleteFeedback, callback: Callback): Promise; - /** - * This method deletes the feedback of request using it's `requestKey` or `requestId` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must be the reporter or an Atlassian Connect app. - */ - async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: never): Promise; - async deleteFeedback(parameters: Parameters.DeleteFeedback, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/request/${parameters.requestIdOrKey}/feedback`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/requestType.mts b/src/serviceDesk/requestType.mts new file mode 100644 index 0000000000..5089636987 --- /dev/null +++ b/src/serviceDesk/requestType.mts @@ -0,0 +1,65 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class RequestType { + constructor(private client: Client) {} + + /** + * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by + * a query string. + * + * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to + * find the customer request types supported by a specific service desk. + * + * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched + * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", + * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getAllRequestTypes( + parameters: Parameters.GetAllRequestTypes | undefined, + callback: Callback, + ): Promise; + /** + * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by + * a query string. + * + * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to + * find the customer request types supported by a specific service desk. + * + * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched + * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", + * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getAllRequestTypes( + parameters?: Parameters.GetAllRequestTypes, + callback?: never, + ): Promise; + async getAllRequestTypes( + parameters?: Parameters.GetAllRequestTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/requesttype', + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + searchQuery: parameters?.searchQuery, + serviceDeskId: parameters?.serviceDeskId, + start: parameters?.start, + limit: parameters?.limit, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/requestType.ts b/src/serviceDesk/requestType.ts deleted file mode 100644 index 1eb1cad51b..0000000000 --- a/src/serviceDesk/requestType.ts +++ /dev/null @@ -1,65 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class RequestType { - constructor(private client: Client) {} - - /** - * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by - * a query string. - * - * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to - * find the customer request types supported by a specific service desk. - * - * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched - * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", - * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getAllRequestTypes( - parameters: Parameters.GetAllRequestTypes | undefined, - callback: Callback, - ): Promise; - /** - * This method returns all customer request types used in the Jira Service Management instance, optionally filtered by - * a query string. - * - * Use [servicedeskapi/servicedesk/{serviceDeskId}/requesttype](#api-servicedesk-serviceDeskId-requesttype-get) to - * find the customer request types supported by a specific service desk. - * - * The returned list of customer request types can be filtered using the `query` parameter. The parameter is matched - * against the customer request types' `name` or `description`. For example, searching for "Install", "Inst", "Equi", - * or "Equipment" will match a customer request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getAllRequestTypes( - parameters?: Parameters.GetAllRequestTypes, - callback?: never, - ): Promise; - async getAllRequestTypes( - parameters?: Parameters.GetAllRequestTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/requesttype', - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - searchQuery: parameters?.searchQuery, - serviceDeskId: parameters?.serviceDeskId, - start: parameters?.start, - limit: parameters?.limit, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/serviceDesk/serviceDesk.mts b/src/serviceDesk/serviceDesk.mts new file mode 100644 index 0000000000..c761a73d21 --- /dev/null +++ b/src/serviceDesk/serviceDesk.mts @@ -0,0 +1,802 @@ +import { FormData } from 'formdata-node'; +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ServiceDesk { + constructor(private client: Client) {} + + /** + * This method returns all the service desks in the Jira Service Management instance that the user has permission to + * access. Use this method where you need a list of service desks or need to locate a service desk by name or + * keyword. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getServiceDesks( + parameters: Parameters.GetServiceDesks | undefined, + callback: Callback, + ): Promise; + /** + * This method returns all the service desks in the Jira Service Management instance that the user has permission to + * access. Use this method where you need a list of service desks or need to locate a service desk by name or + * keyword. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any + */ + async getServiceDesks( + parameters?: Parameters.GetServiceDesks, + callback?: never, + ): Promise; + async getServiceDesks( + parameters?: Parameters.GetServiceDesks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/servicedeskapi/servicedesk', + method: 'GET', + params: { + start: parameters?.start, + limit: parameters?.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a service desk. Use this method to get service desk details whenever your application component + * is passed a service desk ID but needs to display other service desk details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or + * Users. + */ + async getServiceDeskById( + parameters: Parameters.GetServiceDeskById, + callback: Callback, + ): Promise; + /** + * This method returns a service desk. Use this method to get service desk details whenever your application component + * is passed a service desk ID but needs to display other service desk details. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or + * Users. + */ + async getServiceDeskById( + parameters: Parameters.GetServiceDeskById, + callback?: never, + ): Promise; + async getServiceDeskById( + parameters: Parameters.GetServiceDeskById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a + * customer request using + * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). + * + * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service + * desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add attachments in this Service Desk. + */ + async attachTemporaryFile( + parameters: Parameters.AttachTemporaryFile, + callback: Callback, + ): Promise; + /** + * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a + * customer request using + * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). + * + * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service + * desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to add attachments in this Service Desk. + */ + async attachTemporaryFile(parameters: Parameters.AttachTemporaryFile, callback?: never): Promise; + async attachTemporaryFile( + parameters: Parameters.AttachTemporaryFile, + callback?: Callback, + ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); + + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/attachTemporaryFile`, + method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': 'multipart/form-data', + }, + data: formData, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a list of the customers on a service desk. + * + * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against + * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match + * a user with display name "John Smith". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view this Service Desk's customers. + */ + async getCustomers(parameters: Parameters.GetCustomers, callback: Callback): Promise; + /** + * This method returns a list of the customers on a service desk. + * + * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against + * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match + * a user with display name "John Smith". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view this Service Desk's customers. + */ + async getCustomers(parameters: Parameters.GetCustomers, callback?: never): Promise; + async getCustomers( + parameters: Parameters.GetCustomers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + query: parameters.query, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, + * no changes will be made for those customers and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator + */ + async addCustomers(parameters: Parameters.AddCustomers, callback: Callback): Promise; + /** + * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, + * no changes will be made for those customers and the resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator + */ + async addCustomers(parameters: Parameters.AddCustomers, callback?: never): Promise; + async addCustomers(parameters: Parameters.AddCustomers, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, + method: 'POST', + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method removes one or more customers from a service desk. The service desk must have closed access. If any of + * the passed customers are not associated with the service desk, no changes will be made for those customers and the + * resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Services desk administrator + */ + async removeCustomers(parameters: Parameters.RemoveCustomers, callback: Callback): Promise; + /** + * This method removes one or more customers from a service desk. The service desk must have closed access. If any of + * the passed customers are not associated with the service desk, no changes will be made for those customers and the + * resource returns a 204 success code. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Services desk administrator + */ + async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: never): Promise; + async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + data: { + usernames: parameters.usernames, + accountIds: parameters.accountIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns articles which match the given query and belong to the knowledge base linked to the service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; + /** + * Returns articles which match the given query and belong to the knowledge base linked to the service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; + async getArticles( + parameters: Parameters.GetArticles, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/knowledgebase/article`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + params: { + query: parameters.query, + highlight: parameters.highlight, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the queues in a service desk. To include a customer request count for each queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueues(parameters: Parameters.GetQueues, callback: Callback): Promise; + /** + * This method returns the queues in a service desk. To include a customer request count for each queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueues(parameters: Parameters.GetQueues, callback?: never): Promise; + async getQueues(parameters: Parameters.GetQueues, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue`, + method: 'GET', + params: { + includeCount: parameters.includeCount, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueue(parameters: Parameters.GetQueue, callback: Callback): Promise; + /** + * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the + * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * service desk's Agent. + */ + async getQueue(parameters: Parameters.GetQueue, callback?: never): Promise; + async getQueue(parameters: Parameters.GetQueue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}`, + method: 'GET', + params: { + includeCount: parameters.includeCount, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the customer requests in a queue. Only fields that the queue is configured to show are + * returned. For example, if a queue is configured to show description and due date, then only those two fields are + * returned for each customer request in the queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getIssuesInQueue( + parameters: Parameters.GetIssuesInQueue, + callback: Callback, + ): Promise; + /** + * This method returns the customer requests in a queue. Only fields that the queue is configured to show are + * returned. For example, if a queue is configured to show description and due date, then only those two fields are + * returned for each customer request in the queue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's agent. + */ + async getIssuesInQueue(parameters: Parameters.GetIssuesInQueue, callback?: never): Promise; + async getIssuesInQueue( + parameters: Parameters.GetIssuesInQueue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}/issue`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns all customer request types from a service desk. There are two parameters for filtering the + * returned list: + * + * - `groupId` which filters the results to items in the customer request type group. + * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", + * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypes( + parameters: Parameters.GetRequestTypes, + callback: Callback, + ): Promise; + /** + * This method returns all customer request types from a service desk. There are two parameters for filtering the + * returned list: + * + * - `groupId` which filters the results to items in the customer request type group. + * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", + * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypes( + parameters: Parameters.GetRequestTypes, + callback?: never, + ): Promise; + async getRequestTypes( + parameters: Parameters.GetRequestTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, + method: 'GET', + params: { + groupId: parameters.groupId, + expand: parameters.expand, + searchQuery: parameters.searchQuery, + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all + * customer request type fields can be specified in the request and these fields are given the following default + * values: + * + * - Request type icon is given the headset icon. + * - Request type groups is left empty, which means this customer request type will not be visible on the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status + * map from the issue type upon which it is based. + * - Request type field mapping is set to show the required fields as specified by the issue type used to create the + * customer request type. + * + * These fields can be updated by a service desk administrator using the **Request types** option in **Project + * settings**.\ + * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create + * issue type endpoint instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's administrator + */ + async createRequestType( + parameters: Parameters.CreateRequestType, + callback: Callback, + ): Promise; + /** + * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all + * customer request type fields can be specified in the request and these fields are given the following default + * values: + * + * - Request type icon is given the headset icon. + * - Request type groups is left empty, which means this customer request type will not be visible on the [customer + * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). + * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status + * map from the issue type upon which it is based. + * - Request type field mapping is set to show the required fields as specified by the issue type used to create the + * customer request type. + * + * These fields can be updated by a service desk administrator using the **Request types** option in **Project + * settings**.\ + * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create + * issue type endpoint instead. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk's administrator + */ + async createRequestType( + parameters: Parameters.CreateRequestType, + callback?: never, + ): Promise; + async createRequestType( + parameters: Parameters.CreateRequestType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, + method: 'POST', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + data: { + issueTypeId: parameters.issueTypeId, + name: parameters.name, + description: parameters.description, + helpText: parameters.helpText, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a customer request type from a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypeById( + parameters: Parameters.GetRequestTypeById, + callback: Callback, + ): Promise; + /** + * This method returns a customer request type from a service desk. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to access the service desk. + */ + async getRequestTypeById( + parameters: Parameters.GetRequestTypeById, + callback?: never, + ): Promise; + async getRequestTypeById( + parameters: Parameters.GetRequestTypeById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ + * This only supports classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator. + */ + async deleteRequestType(parameters: Parameters.DeleteRequestType, callback: Callback): Promise; + /** + * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ + * This only supports classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Service desk administrator. + */ + async deleteRequestType(parameters: Parameters.DeleteRequestType, callback?: never): Promise; + async deleteRequestType( + parameters: Parameters.DeleteRequestType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns the fields for a service desk's customer request type. + * + * Also, the following information about the user's permissions for the request type is returned: + * + * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other + * customers. Otherwise, returns `false`. + * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns + * `false`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. + */ + async getRequestTypeFields( + parameters: Parameters.GetRequestTypeFields, + callback: Callback, + ): Promise; + /** + * This method returns the fields for a service desk's customer request type. + * + * Also, the following information about the user's permissions for the request type is returned: + * + * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other + * customers. Otherwise, returns `false`. + * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns + * `false`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. + */ + async getRequestTypeFields( + parameters: Parameters.GetRequestTypeFields, + callback?: never, + ): Promise; + async getRequestTypeFields( + parameters: Parameters.GetRequestTypeFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/field`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all + * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property + * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must have permission to view the request type. + */ + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all + * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property + * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The + * user must have permission to view the request type. + */ + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback?: never, + ): Promise; + async getPropertiesKeys( + parameters: Parameters.GetPropertiesKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of the property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by + * calling the Jira Cloud Platform [Get issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must have permission to view the request type. + */ + async getProperty( + parameters: Parameters.GetProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of the property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by + * calling the Jira Cloud Platform [Get issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User + * must have permission to view the request type. + */ + async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; + async getProperty( + parameters: Parameters.GetProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, + method: 'GET', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a request type property. Use this resource to store custom data against a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by + * calling the Jira Cloud Platform [Set issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; + /** + * Sets the value of a request type property. Use this resource to store custom data against a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by + * calling the Jira Cloud Platform [Set issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; + async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, + method: 'PUT', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by + * calling the Jira Cloud Platform [Delete issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; + /** + * Removes a property from a request type. + * + * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by + * calling the Jira Cloud Platform [Delete issue type + * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) + * endpoint. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira + * project administrator with a Jira Service Management agent license. + */ + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; + async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, + method: 'DELETE', + headers: { + 'X-ExperimentalApi': 'opt-in', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * This method returns a service desk's customer request type groups. Jira Service Management administrators can + * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are + * returned in this order. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the service desk. + */ + async getRequestTypeGroups( + parameters: Parameters.GetRequestTypeGroups, + callback: Callback, + ): Promise; + /** + * This method returns a service desk's customer request type groups. Jira Service Management administrators can + * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are + * returned in this order. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: + * Permission to view the service desk. + */ + async getRequestTypeGroups( + parameters: Parameters.GetRequestTypeGroups, + callback?: never, + ): Promise; + async getRequestTypeGroups( + parameters: Parameters.GetRequestTypeGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttypegroup`, + method: 'GET', + params: { + start: parameters.start, + limit: parameters.limit, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/serviceDesk/serviceDesk.ts b/src/serviceDesk/serviceDesk.ts deleted file mode 100644 index 9437d6b2b3..0000000000 --- a/src/serviceDesk/serviceDesk.ts +++ /dev/null @@ -1,803 +0,0 @@ -import * as FormData from 'form-data'; -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ServiceDesk { - constructor(private client: Client) {} - - /** - * This method returns all the service desks in the Jira Service Management instance that the user has permission to - * access. Use this method where you need a list of service desks or need to locate a service desk by name or - * keyword. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getServiceDesks( - parameters: Parameters.GetServiceDesks | undefined, - callback: Callback, - ): Promise; - /** - * This method returns all the service desks in the Jira Service Management instance that the user has permission to - * access. Use this method where you need a list of service desks or need to locate a service desk by name or - * keyword. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Any - */ - async getServiceDesks( - parameters?: Parameters.GetServiceDesks, - callback?: never, - ): Promise; - async getServiceDesks( - parameters?: Parameters.GetServiceDesks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/servicedeskapi/servicedesk', - method: 'GET', - params: { - start: parameters?.start, - limit: parameters?.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a service desk. Use this method to get service desk details whenever your application component - * is passed a service desk ID but needs to display other service desk details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or - * Users. - */ - async getServiceDeskById( - parameters: Parameters.GetServiceDeskById, - callback: Callback, - ): Promise; - /** - * This method returns a service desk. Use this method to get service desk details whenever your application component - * is passed a service desk ID but needs to display other service desk details. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the Service Desk. For example, being the Service Desk's Administrator or one of its Agents or - * Users. - */ - async getServiceDeskById( - parameters: Parameters.GetServiceDeskById, - callback?: never, - ): Promise; - async getServiceDeskById( - parameters: Parameters.GetServiceDeskById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a - * customer request using - * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). - * - * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service - * desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add attachments in this Service Desk. - */ - async attachTemporaryFile( - parameters: Parameters.AttachTemporaryFile, - callback: Callback, - ): Promise; - /** - * This method adds one or more temporary attachments to a service desk, which can then be permanently attached to a - * customer request using - * [servicedeskapi/request/{issueIdOrKey}/attachment](#api-request-issueIdOrKey-attachment-post). - * - * **Note**: It is possible for a service desk administrator to turn off the ability to add attachments to a service - * desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to add attachments in this Service Desk. - */ - async attachTemporaryFile(parameters: Parameters.AttachTemporaryFile, callback?: never): Promise; - async attachTemporaryFile( - parameters: Parameters.AttachTemporaryFile, - callback?: Callback, - ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); - - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/attachTemporaryFile`, - method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': 'multipart/form-data', - ...formData.getHeaders?.(), - }, - data: formData, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a list of the customers on a service desk. - * - * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against - * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match - * a user with display name "John Smith". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view this Service Desk's customers. - */ - async getCustomers(parameters: Parameters.GetCustomers, callback: Callback): Promise; - /** - * This method returns a list of the customers on a service desk. - * - * The returned list of customers can be filtered using the `query` parameter. The parameter is matched against - * customers' `displayName`, `name`, or `email`. For example, searching for "John", "Jo", "Smi", or "Smith" will match - * a user with display name "John Smith". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view this Service Desk's customers. - */ - async getCustomers(parameters: Parameters.GetCustomers, callback?: never): Promise; - async getCustomers( - parameters: Parameters.GetCustomers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - query: parameters.query, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, - * no changes will be made for those customers and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator - */ - async addCustomers(parameters: Parameters.AddCustomers, callback: Callback): Promise; - /** - * Adds one or more customers to a service desk. If any of the passed customers are associated with the service desk, - * no changes will be made for those customers and the resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator - */ - async addCustomers(parameters: Parameters.AddCustomers, callback?: never): Promise; - async addCustomers(parameters: Parameters.AddCustomers, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, - method: 'POST', - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method removes one or more customers from a service desk. The service desk must have closed access. If any of - * the passed customers are not associated with the service desk, no changes will be made for those customers and the - * resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Services desk administrator - */ - async removeCustomers(parameters: Parameters.RemoveCustomers, callback: Callback): Promise; - /** - * This method removes one or more customers from a service desk. The service desk must have closed access. If any of - * the passed customers are not associated with the service desk, no changes will be made for those customers and the - * resource returns a 204 success code. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Services desk administrator - */ - async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: never): Promise; - async removeCustomers(parameters: Parameters.RemoveCustomers, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/customer`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - data: { - usernames: parameters.usernames, - accountIds: parameters.accountIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns articles which match the given query and belong to the knowledge base linked to the service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getArticles(parameters: Parameters.GetArticles, callback: Callback): Promise; - /** - * Returns articles which match the given query and belong to the knowledge base linked to the service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getArticles(parameters: Parameters.GetArticles, callback?: never): Promise; - async getArticles( - parameters: Parameters.GetArticles, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/knowledgebase/article`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - params: { - query: parameters.query, - highlight: parameters.highlight, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the queues in a service desk. To include a customer request count for each queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueues(parameters: Parameters.GetQueues, callback: Callback): Promise; - /** - * This method returns the queues in a service desk. To include a customer request count for each queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueues(parameters: Parameters.GetQueues, callback?: never): Promise; - async getQueues(parameters: Parameters.GetQueues, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue`, - method: 'GET', - params: { - includeCount: parameters.includeCount, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueue(parameters: Parameters.GetQueue, callback: Callback): Promise; - /** - * This method returns a specific queues in a service desk. To include a customer request count for the queue (in the - * `issueCount` field) in the response, set the query parameter `includeCount` to true (its default is false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * service desk's Agent. - */ - async getQueue(parameters: Parameters.GetQueue, callback?: never): Promise; - async getQueue(parameters: Parameters.GetQueue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}`, - method: 'GET', - params: { - includeCount: parameters.includeCount, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the customer requests in a queue. Only fields that the queue is configured to show are - * returned. For example, if a queue is configured to show description and due date, then only those two fields are - * returned for each customer request in the queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getIssuesInQueue( - parameters: Parameters.GetIssuesInQueue, - callback: Callback, - ): Promise; - /** - * This method returns the customer requests in a queue. Only fields that the queue is configured to show are - * returned. For example, if a queue is configured to show description and due date, then only those two fields are - * returned for each customer request in the queue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's agent. - */ - async getIssuesInQueue(parameters: Parameters.GetIssuesInQueue, callback?: never): Promise; - async getIssuesInQueue( - parameters: Parameters.GetIssuesInQueue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/queue/${parameters.queueId}/issue`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns all customer request types from a service desk. There are two parameters for filtering the - * returned list: - * - * - `groupId` which filters the results to items in the customer request type group. - * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", - * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypes( - parameters: Parameters.GetRequestTypes, - callback: Callback, - ): Promise; - /** - * This method returns all customer request types from a service desk. There are two parameters for filtering the - * returned list: - * - * - `groupId` which filters the results to items in the customer request type group. - * - `searchQuery` which is matched against request types' `name` or `description`. For example, the strings "Install", - * "Inst", "Equi", or "Equipment" will match a request type with the _name_ "Equipment Installation Request". - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypes( - parameters: Parameters.GetRequestTypes, - callback?: never, - ): Promise; - async getRequestTypes( - parameters: Parameters.GetRequestTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, - method: 'GET', - params: { - groupId: parameters.groupId, - expand: parameters.expand, - searchQuery: parameters.searchQuery, - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all - * customer request type fields can be specified in the request and these fields are given the following default - * values: - * - * - Request type icon is given the headset icon. - * - Request type groups is left empty, which means this customer request type will not be visible on the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status - * map from the issue type upon which it is based. - * - Request type field mapping is set to show the required fields as specified by the issue type used to create the - * customer request type. - * - * These fields can be updated by a service desk administrator using the **Request types** option in **Project - * settings**.\ - * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create - * issue type endpoint instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's administrator - */ - async createRequestType( - parameters: Parameters.CreateRequestType, - callback: Callback, - ): Promise; - /** - * This method enables a customer request type to be added to a service desk based on an issue type. Note that not all - * customer request type fields can be specified in the request and these fields are given the following default - * values: - * - * - Request type icon is given the headset icon. - * - Request type groups is left empty, which means this customer request type will not be visible on the [customer - * portal](https://confluence.atlassian.com/servicedeskcloud/configuring-the-customer-portal-732528918.html). - * - Request type status mapping is left empty, so the request type has no custom status mapping but inherits the status - * map from the issue type upon which it is based. - * - Request type field mapping is set to show the required fields as specified by the issue type used to create the - * customer request type. - * - * These fields can be updated by a service desk administrator using the **Request types** option in **Project - * settings**.\ - * Request Types are created in next-gen projects by creating Issue Types. Please use the Jira Cloud Platform Create - * issue type endpoint instead. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk's administrator - */ - async createRequestType( - parameters: Parameters.CreateRequestType, - callback?: never, - ): Promise; - async createRequestType( - parameters: Parameters.CreateRequestType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype`, - method: 'POST', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - data: { - issueTypeId: parameters.issueTypeId, - name: parameters.name, - description: parameters.description, - helpText: parameters.helpText, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a customer request type from a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypeById( - parameters: Parameters.GetRequestTypeById, - callback: Callback, - ): Promise; - /** - * This method returns a customer request type from a service desk. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to access the service desk. - */ - async getRequestTypeById( - parameters: Parameters.GetRequestTypeById, - callback?: never, - ): Promise; - async getRequestTypeById( - parameters: Parameters.GetRequestTypeById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ - * This only supports classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator. - */ - async deleteRequestType(parameters: Parameters.DeleteRequestType, callback: Callback): Promise; - /** - * This method deletes a customer request type from a service desk, and removes it from all customer requests.\ - * This only supports classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Service desk administrator. - */ - async deleteRequestType(parameters: Parameters.DeleteRequestType, callback?: never): Promise; - async deleteRequestType( - parameters: Parameters.DeleteRequestType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns the fields for a service desk's customer request type. - * - * Also, the following information about the user's permissions for the request type is returned: - * - * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other - * customers. Otherwise, returns `false`. - * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns - * `false`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. - */ - async getRequestTypeFields( - parameters: Parameters.GetRequestTypeFields, - callback: Callback, - ): Promise; - /** - * This method returns the fields for a service desk's customer request type. - * - * Also, the following information about the user's permissions for the request type is returned: - * - * - `canRaiseOnBehalfOf` returns `true` if the user has permission to raise customer requests on behalf of other - * customers. Otherwise, returns `false`. - * - `canAddRequestParticipants` returns `true` if the user can add customer request participants. Otherwise, returns - * `false`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator. - */ - async getRequestTypeFields( - parameters: Parameters.GetRequestTypeFields, - callback?: never, - ): Promise; - async getRequestTypeFields( - parameters: Parameters.GetRequestTypeFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/field`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all - * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property - * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must have permission to view the request type. - */ - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore the keys of all - * properties for a request type are also available by calling the Jira Cloud Platform [Get issue type property - * keys](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: The - * user must have permission to view the request type. - */ - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback?: never, - ): Promise; - async getPropertiesKeys( - parameters: Parameters.GetPropertiesKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of the property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by - * calling the Jira Cloud Platform [Get issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must have permission to view the request type. - */ - async getProperty( - parameters: Parameters.GetProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of the property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore also available by - * calling the Jira Cloud Platform [Get issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-get) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: User - * must have permission to view the request type. - */ - async getProperty(parameters: Parameters.GetProperty, callback?: never): Promise; - async getProperty( - parameters: Parameters.GetProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, - method: 'GET', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a request type property. Use this resource to store custom data against a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by - * calling the Jira Cloud Platform [Set issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async setProperty(parameters: Parameters.SetProperty, callback: Callback): Promise; - /** - * Sets the value of a request type property. Use this resource to store custom data against a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be set by - * calling the Jira Cloud Platform [Set issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-put) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async setProperty(parameters: Parameters.SetProperty, callback?: never): Promise; - async setProperty(parameters: Parameters.SetProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, - method: 'PUT', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by - * calling the Jira Cloud Platform [Delete issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback: Callback): Promise; - /** - * Removes a property from a request type. - * - * Properties for a Request Type in next-gen are stored as Issue Type properties and therefore can also be deleted by - * calling the Jira Cloud Platform [Delete issue type - * property](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-issuetype-issueTypeId-properties-propertyKey-delete) - * endpoint. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: Jira - * project administrator with a Jira Service Management agent license. - */ - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: never): Promise; - async deleteProperty(parameters: Parameters.DeleteProperty, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttype/${parameters.requestTypeId}/property/${parameters.propertyKey}`, - method: 'DELETE', - headers: { - 'X-ExperimentalApi': 'opt-in', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * This method returns a service desk's customer request type groups. Jira Service Management administrators can - * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are - * returned in this order. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the service desk. - */ - async getRequestTypeGroups( - parameters: Parameters.GetRequestTypeGroups, - callback: Callback, - ): Promise; - /** - * This method returns a service desk's customer request type groups. Jira Service Management administrators can - * arrange the customer request type groups in an arbitrary order for display on the customer portal; the groups are - * returned in this order. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/#permissions) required**: - * Permission to view the service desk. - */ - async getRequestTypeGroups( - parameters: Parameters.GetRequestTypeGroups, - callback?: never, - ): Promise; - async getRequestTypeGroups( - parameters: Parameters.GetRequestTypeGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/servicedeskapi/servicedesk/${parameters.serviceDeskId}/requesttypegroup`, - method: 'GET', - params: { - start: parameters.start, - limit: parameters.limit, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/services/authenticationService/authentications/createBasicAuthenticationToken.mts b/src/services/authenticationService/authentications/createBasicAuthenticationToken.mts new file mode 100644 index 0000000000..32e815993d --- /dev/null +++ b/src/services/authenticationService/authentications/createBasicAuthenticationToken.mts @@ -0,0 +1,19 @@ +import { Base64Encoder } from '../base64Encoder.mjs'; +import { Config } from '@/config.mjs'; + +export function createBasicAuthenticationToken(authenticationData: Config.Authentication.Basic) { + let login; + let secret; + + if ('username' in authenticationData) { + login = authenticationData.username; + secret = authenticationData.password; + } else { + login = authenticationData.email; + secret = authenticationData.apiToken; + } + + const token = Base64Encoder.encode(`${login}:${secret}`); + + return `Basic ${token}`; +} diff --git a/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts b/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts deleted file mode 100644 index cdfc71804d..0000000000 --- a/src/services/authenticationService/authentications/createBasicAuthenticationToken.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Base64Encoder } from '../base64Encoder'; -import { Config } from '../../../config'; - -export function createBasicAuthenticationToken(authenticationData: Config.Authentication.Basic) { - let login; - let secret; - - if ('username' in authenticationData) { - login = authenticationData.username; - secret = authenticationData.password; - } else { - login = authenticationData.email; - secret = authenticationData.apiToken; - } - - const token = Base64Encoder.encode(`${login}:${secret}`); - - return `Basic ${token}`; -} diff --git a/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts b/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts new file mode 100644 index 0000000000..b8aaa46d8e --- /dev/null +++ b/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.mts @@ -0,0 +1,5 @@ +import { Config } from '@/config.mjs'; + +export function createOAuth2AuthenticationToken(authenticationData: Config.Authentication.OAuth2) { + return `Bearer ${authenticationData.accessToken}`; +} diff --git a/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts b/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts deleted file mode 100644 index 4ebec8526f..0000000000 --- a/src/services/authenticationService/authentications/createOAuth2AuthenticationToken.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Config } from '../../../config'; - -export function createOAuth2AuthenticationToken(authenticationData: Config.Authentication.OAuth2) { - return `Bearer ${authenticationData.accessToken}`; -} diff --git a/src/services/authenticationService/authentications/createPATAuthentication.mts b/src/services/authenticationService/authentications/createPATAuthentication.mts new file mode 100644 index 0000000000..e6bdfd00fe --- /dev/null +++ b/src/services/authenticationService/authentications/createPATAuthentication.mts @@ -0,0 +1,5 @@ +import { Config } from '@/config.mjs'; + +export function createPATAuthentication(pat: Config.Authentication.PersonalAccessToken) { + return `Bearer ${pat}`; +} diff --git a/src/services/authenticationService/authentications/createPATAuthentication.ts b/src/services/authenticationService/authentications/createPATAuthentication.ts deleted file mode 100644 index cde9effb54..0000000000 --- a/src/services/authenticationService/authentications/createPATAuthentication.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Config } from '../../../config'; - -export function createPATAuthentication(pat: Config.Authentication.PersonalAccessToken) { - return `Bearer ${pat}`; -} diff --git a/src/services/authenticationService/authentications/index.mts b/src/services/authenticationService/authentications/index.mts new file mode 100644 index 0000000000..509a005762 --- /dev/null +++ b/src/services/authenticationService/authentications/index.mts @@ -0,0 +1,3 @@ +export * from './createBasicAuthenticationToken.mjs'; +export * from './createOAuth2AuthenticationToken.mjs'; +export * from './createPATAuthentication.mjs'; diff --git a/src/services/authenticationService/authentications/index.ts b/src/services/authenticationService/authentications/index.ts deleted file mode 100644 index 0ae8863d09..0000000000 --- a/src/services/authenticationService/authentications/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './createBasicAuthenticationToken'; -export * from './createOAuth2AuthenticationToken'; -export * from './createPATAuthentication'; diff --git a/src/services/authenticationService/base64Encoder.mts b/src/services/authenticationService/base64Encoder.mts new file mode 100644 index 0000000000..c12f0a5910 --- /dev/null +++ b/src/services/authenticationService/base64Encoder.mts @@ -0,0 +1,70 @@ +// todo replace to builtin solution +/* eslint-disable */ +/** @copyright The code was taken from the portal http://www.webtoolkit.info/javascript-base64.html */ + +export namespace Base64Encoder { + const base64Sequence = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + const utf8Encode = (value: string) => { + value = value.replace(/\r\n/g, '\n'); + + let utftext = ''; + + for (let n = 0; n < value.length; n++) { + const c = value.charCodeAt(n); + + if (c < 128) { + utftext += String.fromCharCode(c); + } else if (c > 127 && c < 2048) { + utftext += String.fromCharCode((c >> 6) | 192); + + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + + utftext += String.fromCharCode((c & 63) | 128); + } + } + + return utftext; + }; + + export const encode = (input: string) => { + let output = ''; + let chr1; + let chr2; + let chr3; + let enc1; + let enc2; + let enc3; + let enc4; + let i = 0; + + input = utf8Encode(input); + + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output += `${base64Sequence.charAt(enc1)}${base64Sequence.charAt(enc2)}${base64Sequence.charAt( + enc3, + )}${base64Sequence.charAt(enc4)}`; + } + + return output; + }; +} diff --git a/src/services/authenticationService/base64Encoder.ts b/src/services/authenticationService/base64Encoder.ts deleted file mode 100644 index f20d74e9b8..0000000000 --- a/src/services/authenticationService/base64Encoder.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* eslint-disable */ -/** @copyright The code was taken from the portal http://www.webtoolkit.info/javascript-base64.html */ - -export namespace Base64Encoder { - const base64Sequence = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - const utf8Encode = (value: string) => { - value = value.replace(/\r\n/g, '\n'); - - let utftext = ''; - - for (let n = 0; n < value.length; n++) { - const c = value.charCodeAt(n); - - if (c < 128) { - utftext += String.fromCharCode(c); - } else if (c > 127 && c < 2048) { - utftext += String.fromCharCode((c >> 6) | 192); - - utftext += String.fromCharCode((c & 63) | 128); - } else { - utftext += String.fromCharCode((c >> 12) | 224); - - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - - utftext += String.fromCharCode((c & 63) | 128); - } - } - - return utftext; - }; - - export const encode = (input: string) => { - let output = ''; - let chr1; - let chr2; - let chr3; - let enc1; - let enc2; - let enc3; - let enc4; - let i = 0; - - input = utf8Encode(input); - - while (i < input.length) { - chr1 = input.charCodeAt(i++); - chr2 = input.charCodeAt(i++); - chr3 = input.charCodeAt(i++); - - enc1 = chr1 >> 2; - enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); - enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); - enc4 = chr3 & 63; - - if (isNaN(chr2)) { - enc3 = enc4 = 64; - } else if (isNaN(chr3)) { - enc4 = 64; - } - - output += `${base64Sequence.charAt(enc1)}${base64Sequence.charAt(enc2)}${base64Sequence.charAt( - enc3, - )}${base64Sequence.charAt(enc4)}`; - } - - return output; - }; -} diff --git a/src/services/authenticationService/getAuthenticationToken.mts b/src/services/authenticationService/getAuthenticationToken.mts new file mode 100644 index 0000000000..92392560a0 --- /dev/null +++ b/src/services/authenticationService/getAuthenticationToken.mts @@ -0,0 +1,28 @@ +import { Config } from '@/config.mjs'; +import { + createBasicAuthenticationToken, + createOAuth2AuthenticationToken, + createPATAuthentication, +} from './authentications/index.mjs'; + +export async function getAuthenticationToken( + authentication: Config.Authentication | undefined, +): Promise { + if (!authentication) { + return undefined; + } + + if (authentication.basic) { + return createBasicAuthenticationToken(authentication.basic); + } + + if (authentication.oauth2) { + return createOAuth2AuthenticationToken(authentication.oauth2); + } + + if (authentication.personalAccessToken) { + return createPATAuthentication(authentication.personalAccessToken); + } + + return undefined; +} diff --git a/src/services/authenticationService/getAuthenticationToken.ts b/src/services/authenticationService/getAuthenticationToken.ts deleted file mode 100644 index 85e0ef8ddb..0000000000 --- a/src/services/authenticationService/getAuthenticationToken.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Config } from '../../config'; -import { - createBasicAuthenticationToken, - createOAuth2AuthenticationToken, - createPATAuthentication, -} from './authentications'; - -export async function getAuthenticationToken( - authentication: Config.Authentication | undefined, -): Promise { - if (!authentication) { - return undefined; - } - - if (authentication.basic) { - return createBasicAuthenticationToken(authentication.basic); - } - - if (authentication.oauth2) { - return createOAuth2AuthenticationToken(authentication.oauth2); - } - - if (authentication.personalAccessToken) { - return createPATAuthentication(authentication.personalAccessToken); - } - - return undefined; -} diff --git a/src/services/authenticationService/index.mts b/src/services/authenticationService/index.mts new file mode 100644 index 0000000000..2e827214bf --- /dev/null +++ b/src/services/authenticationService/index.mts @@ -0,0 +1 @@ +export * from './getAuthenticationToken.mjs'; diff --git a/src/services/authenticationService/index.ts b/src/services/authenticationService/index.ts deleted file mode 100644 index 3d87b165cb..0000000000 --- a/src/services/authenticationService/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './getAuthenticationToken'; diff --git a/src/utilityTypes.ts b/src/utilityTypes.mts similarity index 100% rename from src/utilityTypes.ts rename to src/utilityTypes.mts diff --git a/src/version2/announcementBanner.mts b/src/version2/announcementBanner.mts new file mode 100644 index 0000000000..e48d49996c --- /dev/null +++ b/src/version2/announcementBanner.mts @@ -0,0 +1,61 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AnnouncementBanner { + constructor(private client: Client) {} + + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback: Callback): Promise; + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback?: never): Promise; + async getBanner(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/announcementBanner', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters: Parameters.SetBanner, callback: Callback): Promise; + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters: Parameters.SetBanner, callback?: never): Promise; + async setBanner(parameters: Parameters.SetBanner, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/announcementBanner', + method: 'PUT', + data: { + isDismissible: parameters.isDismissible, + isEnabled: parameters.isEnabled, + message: parameters.message, + visibility: parameters.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/announcementBanner.ts b/src/version2/announcementBanner.ts deleted file mode 100644 index ee04cbf709..0000000000 --- a/src/version2/announcementBanner.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AnnouncementBanner { - constructor(private client: Client) {} - - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback: Callback): Promise; - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback?: never): Promise; - async getBanner(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/announcementBanner', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner, callback: Callback): Promise; - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner, callback?: never): Promise; - async setBanner(parameters: Parameters.SetBanner, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/announcementBanner', - method: 'PUT', - data: { - isDismissible: parameters.isDismissible, - isEnabled: parameters.isEnabled, - message: parameters.message, - visibility: parameters.visibility, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/appMigration.mts b/src/version2/appMigration.mts new file mode 100644 index 0000000000..7b8abb2383 --- /dev/null +++ b/src/version2/appMigration.mts @@ -0,0 +1,114 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppMigration { + constructor(private client: Client) {} + + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; + async updateIssueFields( + parameters: Parameters.UpdateIssueFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/field', + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + updateValueList: parameters.updateValueList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback: Callback, + ): Promise; + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: never, + ): Promise; + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + 'Content-Type': 'application/json', + }, + data: parameters.entities, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback: Callback, + ): Promise; + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: never, + ): Promise; + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/workflow/rule/search', + method: 'POST', + headers: { + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + expand: parameters.expand, + ruleIds: parameters.ruleIds, + workflowEntityId: parameters.workflowEntityId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/appMigration.ts b/src/version2/appMigration.ts deleted file mode 100644 index d199d8bd9c..0000000000 --- a/src/version2/appMigration.ts +++ /dev/null @@ -1,114 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AppMigration { - constructor(private client: Client) {} - - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; - async updateIssueFields( - parameters: Parameters.UpdateIssueFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/field', - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - updateValueList: parameters.updateValueList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback: Callback, - ): Promise; - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: never, - ): Promise; - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - 'Content-Type': 'application/json', - }, - data: parameters.entities, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback: Callback, - ): Promise; - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: never, - ): Promise; - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/workflow/rule/search', - method: 'POST', - headers: { - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - expand: parameters.expand, - ruleIds: parameters.ruleIds, - workflowEntityId: parameters.workflowEntityId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/appProperties.mts b/src/version2/appProperties.mts new file mode 100644 index 0000000000..fa7f9886fa --- /dev/null +++ b/src/version2/appProperties.mts @@ -0,0 +1,224 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppProperties { + constructor(private client: Client) {} + + /** + * 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/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback: Callback, + ): Promise; + /** + * 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/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: never, + ): Promise; + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: Callback, + ): Promise { + const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; + + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback: Callback, + ): Promise; + /** + * 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/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: never, + ): Promise; + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * 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. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * 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. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: never, + ): Promise; + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + */ + 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. + */ + async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; + async deleteAddonProperty( + parameters: Parameters.DeleteAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback: Callback, + ): Promise; + /** + * 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). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: never, + ): Promise; + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: Callback, + ): Promise { + // todo + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; + async deleteAppProperty( + parameters: Parameters.DeleteAppProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/appProperties.ts b/src/version2/appProperties.ts deleted file mode 100644 index 75471109a2..0000000000 --- a/src/version2/appProperties.ts +++ /dev/null @@ -1,224 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AppProperties { - constructor(private client: Client) {} - - /** - * 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/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback: Callback, - ): Promise; - /** - * 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/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: never, - ): Promise; - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: Callback, - ): Promise { - const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; - - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback: Callback, - ): Promise; - /** - * 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/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: never, - ): Promise; - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * 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. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * 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. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: never, - ): Promise; - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - */ - 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. - */ - async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; - async deleteAddonProperty( - parameters: Parameters.DeleteAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback: Callback, - ): Promise; - /** - * 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). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: never, - ): Promise; - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: Callback, - ): Promise { - // todo - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; - async deleteAppProperty( - parameters: Parameters.DeleteAppProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/applicationRoles.mts b/src/version2/applicationRoles.mts new file mode 100644 index 0000000000..468826b8cd --- /dev/null +++ b/src/version2/applicationRoles.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ApplicationRoles { + constructor(private client: Client) {} + + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback: Callback): Promise; + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback?: never): Promise; + async getAllApplicationRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/applicationrole', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback: Callback, + ): Promise; + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: never, + ): Promise; + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters.key; + + const config: RequestConfig = { + url: `/rest/api/2/applicationrole/${key}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/applicationRoles.ts b/src/version2/applicationRoles.ts deleted file mode 100644 index 7ca79fcf85..0000000000 --- a/src/version2/applicationRoles.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ApplicationRoles { - constructor(private client: Client) {} - - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback: Callback): Promise; - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback?: never): Promise; - async getAllApplicationRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/applicationrole', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback: Callback, - ): Promise; - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: never, - ): Promise; - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters.key; - - const config: RequestConfig = { - url: `/rest/api/2/applicationrole/${key}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/auditRecords.mts b/src/version2/auditRecords.mts new file mode 100644 index 0000000000..1c0361aa24 --- /dev/null +++ b/src/version2/auditRecords.mts @@ -0,0 +1,79 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AuditRecords { + constructor(private client: Client) {} + + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords( + parameters: Parameters.GetAuditRecords | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; + async getAuditRecords( + parameters?: Parameters.GetAuditRecords, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/auditing/record', + method: 'GET', + params: { + offset: parameters?.offset, + limit: parameters?.limit, + filter: parameters?.filter, + from: parameters?.from, + to: parameters?.to, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/auditRecords.ts b/src/version2/auditRecords.ts deleted file mode 100644 index 63a15b6768..0000000000 --- a/src/version2/auditRecords.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AuditRecords { - constructor(private client: Client) {} - - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords( - parameters: Parameters.GetAuditRecords | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; - async getAuditRecords( - parameters?: Parameters.GetAuditRecords, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/auditing/record', - method: 'GET', - params: { - offset: parameters?.offset, - limit: parameters?.limit, - filter: parameters?.filter, - from: parameters?.from, - to: parameters?.to, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/avatars.mts b/src/version2/avatars.mts new file mode 100644 index 0000000000..43410b7e50 --- /dev/null +++ b/src/version2/avatars.mts @@ -0,0 +1,332 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +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. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback: Callback, + ): Promise; + /** + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: never, + ): Promise; + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/2/avatar/${type}/system`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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 system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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 system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; + async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * 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-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. + * + * **[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. + * + * 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-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. + * + * **[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?: never): Promise; + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an avatar from a project or issue type. + * + * **[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. + * + * **[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?: never): Promise; + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback: Callback, + ): Promise; + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: never, + ): Promise; + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/view/type/${type}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: typeof parameters !== 'string' && parameters.size, + format: typeof parameters !== 'string' && parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback: Callback, + ): Promise; + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: never, + ): Promise; + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback: Callback, + ): Promise; + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: never, + ): Promise; + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } +} diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts deleted file mode 100644 index 799b5fbd64..0000000000 --- a/src/version2/avatars.ts +++ /dev/null @@ -1,332 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: never, - ): Promise; - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/2/avatar/${type}/system`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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 system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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 system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; - async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * 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-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. - * - * **[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. - * - * 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-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. - * - * **[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?: never): Promise; - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an avatar from a project or issue type. - * - * **[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. - * - * **[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?: never): Promise; - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback: Callback, - ): Promise; - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: never, - ): Promise; - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${type}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback: Callback, - ): Promise; - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: never, - ): Promise; - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback: Callback, - ): Promise; - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: never, - ): Promise; - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } -} diff --git a/src/version2/client/index.ts b/src/version2/client/index.ts deleted file mode 100644 index f681ad94cb..0000000000 --- a/src/version2/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './version2Client'; diff --git a/src/version2/client/version2Client.mts b/src/version2/client/version2Client.mts new file mode 100644 index 0000000000..d6eed4b34a --- /dev/null +++ b/src/version2/client/version2Client.mts @@ -0,0 +1,174 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { AnnouncementBanner } from '@/version2/announcementBanner.mjs'; +import { ApplicationRoles } from '@/version2/applicationRoles.mjs'; +import { AppMigration } from '@/version2/appMigration.mjs'; +import { AppProperties } from '@/version2/appProperties.mjs'; +import { AuditRecords } from '@/version2/auditRecords.mjs'; +import { Avatars } from '@/version2/avatars.mjs'; +import { Dashboards } from '@/version2/dashboards.mjs'; +import { DynamicModules } from '@/version2/dynamicModules.mjs'; +import { Filters } from '@/version2/filters.mjs'; +import { FilterSharing } from '@/version2/filterSharing.mjs'; +import { GroupAndUserPicker } from '@/version2/groupAndUserPicker.mjs'; +import { Groups } from '@/version2/groups.mjs'; +import { IssueAttachments } from '@/version2/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version2/issueCommentProperties.mjs'; +import { IssueComments } from '@/version2/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version2/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version2/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version2/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version2/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version2/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version2/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version2/issueFields.mjs'; +import { IssueLinks } from '@/version2/issueLinks.mjs'; +import { IssueLinkTypes } from '@/version2/issueLinkTypes.mjs'; +import { IssueNavigatorSettings } from '@/version2/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version2/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version2/issuePriorities.mjs'; +import { IssueProperties } from '@/version2/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version2/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version2/issueResolutions.mjs'; +import { Issues } from '@/version2/issues.mjs'; +import { IssueSearch } from '@/version2/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version2/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version2/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version2/issueTypeProperties.mjs'; +import { IssueTypes } from '@/version2/issueTypes.mjs'; +import { IssueTypeSchemes } from '@/version2/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version2/issueTypeScreenSchemes.mjs'; +import { IssueVotes } from '@/version2/issueVotes.mjs'; +import { IssueWatchers } from '@/version2/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version2/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version2/issueWorklogs.mjs'; +import { JiraExpressions } from '@/version2/jiraExpressions.mjs'; +import { JiraSettings } from '@/version2/jiraSettings.mjs'; +import { JQL } from '@/version2/jql.mjs'; +import { JqlFunctionsApps } from '@/version2/jqlFunctionsApps.mjs'; +import { Labels } from '@/version2/labels.mjs'; +import { LicenseMetrics } from '@/version2/licenseMetrics.mjs'; +import { Myself } from '@/version2/myself.mjs'; +import { Permissions } from '@/version2/permissions.mjs'; +import { PermissionSchemes } from '@/version2/permissionSchemes.mjs'; +import { ProjectAvatars } from '@/version2/projectAvatars.mjs'; +import { ProjectCategories } from '@/version2/projectCategories.mjs'; +import { ProjectComponents } from '@/version2/projectComponents.mjs'; +import { ProjectEmail } from '@/version2/projectEmail.mjs'; +import { ProjectFeatures } from '@/version2/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version2/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version2/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version2/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version2/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version2/projectRoles.mjs'; +import { Projects } from '@/version2/projects.mjs'; +import { ProjectTypes } from '@/version2/projectTypes.mjs'; +import { ProjectVersions } from '@/version2/projectVersions.mjs'; +import { Screens } from '@/version2/screens.mjs'; +import { ScreenSchemes } from '@/version2/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version2/screenTabFields.mjs'; +import { ScreenTabs } from '@/version2/screenTabs.mjs'; +import { ServerInfo } from '@/version2/serverInfo.mjs'; +import { Status } from '@/version2/status.mjs'; +import { Tasks } from '@/version2/tasks.mjs'; +import { TimeTracking } from '@/version2/timeTracking.mjs'; +import { UiModificationsApps } from '@/version2/uiModificationsApps.mjs'; +import { UserProperties } from '@/version2/userProperties.mjs'; +import { Users } from '@/version2/users.mjs'; +import { UserSearch } from '@/version2/userSearch.mjs'; +import { Webhooks } from '@/version2/webhooks.mjs'; +import { Workflows } from '@/version2/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version2/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version2/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version2/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version2/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version2/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version2/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version2/workflowTransitionRules.mjs'; + +export class Version2Client extends BaseClient { + announcementBanner = new AnnouncementBanner(this); + applicationRoles = new ApplicationRoles(this); + appMigration = new AppMigration(this); + appProperties = new AppProperties(this); + auditRecords = new AuditRecords(this); + avatars = new Avatars(this); + dashboards = new Dashboards(this); + dynamicModules = new DynamicModules(this); + filters = new Filters(this); + filterSharing = new FilterSharing(this); + groupAndUserPicker = new GroupAndUserPicker(this); + groups = new Groups(this); + issueAttachments = new IssueAttachments(this); + issueCommentProperties = new IssueCommentProperties(this); + issueComments = new IssueComments(this); + issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); + issueCustomFieldContexts = new IssueCustomFieldContexts(this); + issueCustomFieldOptions = new IssueCustomFieldOptions(this); + issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); + issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); + issueFieldConfigurations = new IssueFieldConfigurations(this); + issueFields = new IssueFields(this); + issueLinks = new IssueLinks(this); + issueLinkTypes = new IssueLinkTypes(this); + issueNavigatorSettings = new IssueNavigatorSettings(this); + issueNotificationSchemes = new IssueNotificationSchemes(this); + issuePriorities = new IssuePriorities(this); + issueProperties = new IssueProperties(this); + issueRemoteLinks = new IssueRemoteLinks(this); + issueResolutions = new IssueResolutions(this); + issues = new Issues(this); + issueSearch = new IssueSearch(this); + issueSecurityLevel = new IssueSecurityLevel(this); + issueSecuritySchemes = new IssueSecuritySchemes(this); + issueTypeProperties = new IssueTypeProperties(this); + issueTypes = new IssueTypes(this); + issueTypeSchemes = new IssueTypeSchemes(this); + issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); + issueVotes = new IssueVotes(this); + issueWatchers = new IssueWatchers(this); + issueWorklogProperties = new IssueWorklogProperties(this); + issueWorklogs = new IssueWorklogs(this); + jiraExpressions = new JiraExpressions(this); + jiraSettings = new JiraSettings(this); + jql = new JQL(this); + jqlFunctionsApps = new JqlFunctionsApps(this); + labels = new Labels(this); + licenseMetrics = new LicenseMetrics(this); + myself = new Myself(this); + permissions = new Permissions(this); + permissionSchemes = new PermissionSchemes(this); + projectAvatars = new ProjectAvatars(this); + projectCategories = new ProjectCategories(this); + projectComponents = new ProjectComponents(this); + projectEmail = new ProjectEmail(this); + projectFeatures = new ProjectFeatures(this); + projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); + projectPermissionSchemes = new ProjectPermissionSchemes(this); + projectProperties = new ProjectProperties(this); + projectRoleActors = new ProjectRoleActors(this); + projectRoles = new ProjectRoles(this); + projects = new Projects(this); + projectTypes = new ProjectTypes(this); + projectVersions = new ProjectVersions(this); + screens = new Screens(this); + screenSchemes = new ScreenSchemes(this); + screenTabFields = new ScreenTabFields(this); + screenTabs = new ScreenTabs(this); + serverInfo = new ServerInfo(this); + status = new Status(this); + tasks = new Tasks(this); + timeTracking = new TimeTracking(this); + uiModificationsApps = new UiModificationsApps(this); + userProperties = new UserProperties(this); + users = new Users(this); + userSearch = new UserSearch(this); + webhooks = new Webhooks(this); + workflows = new Workflows(this); + workflowSchemeDrafts = new WorkflowSchemeDrafts(this); + workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); + workflowSchemes = new WorkflowSchemes(this); + workflowStatusCategories = new WorkflowStatusCategories(this); + workflowStatuses = new WorkflowStatuses(this); + workflowTransitionProperties = new WorkflowTransitionProperties(this); + workflowTransitionRules = new WorkflowTransitionRules(this); +} diff --git a/src/version2/client/version2Client.ts b/src/version2/client/version2Client.ts deleted file mode 100644 index f2fe264178..0000000000 --- a/src/version2/client/version2Client.ts +++ /dev/null @@ -1,176 +0,0 @@ -import { BaseClient } from '../../clients'; -import { - AnnouncementBanner, - ApplicationRoles, - AppMigration, - AppProperties, - AuditRecords, - Avatars, - Dashboards, - DynamicModules, - Filters, - FilterSharing, - GroupAndUserPicker, - Groups, - IssueAttachments, - IssueCommentProperties, - IssueComments, - IssueCustomFieldConfigurationApps, - IssueCustomFieldContexts, - IssueCustomFieldOptions, - IssueCustomFieldOptionsApps, - IssueCustomFieldValuesApps, - IssueFieldConfigurations, - IssueFields, - IssueLinks, - IssueLinkTypes, - IssueNavigatorSettings, - IssueNotificationSchemes, - IssuePriorities, - IssueProperties, - IssueRemoteLinks, - IssueResolutions, - Issues, - IssueSearch, - IssueSecurityLevel, - IssueSecuritySchemes, - IssueTypeProperties, - IssueTypes, - IssueTypeSchemes, - IssueTypeScreenSchemes, - IssueVotes, - IssueWatchers, - IssueWorklogProperties, - IssueWorklogs, - JiraExpressions, - JiraSettings, - JQL, - JqlFunctionsApps, - Labels, - LicenseMetrics, - Myself, - Permissions, - PermissionSchemes, - ProjectAvatars, - ProjectCategories, - ProjectComponents, - ProjectEmail, - ProjectFeatures, - ProjectKeyAndNameValidation, - ProjectPermissionSchemes, - ProjectProperties, - ProjectRoleActors, - ProjectRoles, - Projects, - ProjectTypes, - ProjectVersions, - Screens, - ScreenSchemes, - ScreenTabFields, - ScreenTabs, - ServerInfo, - Status, - Tasks, - TimeTracking, - UIModificationsApps, - UserProperties, - Users, - UserSearch, - Webhooks, - Workflows, - WorkflowSchemeDrafts, - WorkflowSchemeProjectAssociations, - WorkflowSchemes, - WorkflowStatusCategories, - WorkflowStatuses, - WorkflowTransitionProperties, - WorkflowTransitionRules, -} from '..'; - -export class Version2Client extends BaseClient { - announcementBanner = new AnnouncementBanner(this); - applicationRoles = new ApplicationRoles(this); - appMigration = new AppMigration(this); - appProperties = new AppProperties(this); - auditRecords = new AuditRecords(this); - avatars = new Avatars(this); - dashboards = new Dashboards(this); - dynamicModules = new DynamicModules(this); - filters = new Filters(this); - filterSharing = new FilterSharing(this); - groupAndUserPicker = new GroupAndUserPicker(this); - groups = new Groups(this); - issueAttachments = new IssueAttachments(this); - issueCommentProperties = new IssueCommentProperties(this); - issueComments = new IssueComments(this); - issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); - issueCustomFieldContexts = new IssueCustomFieldContexts(this); - issueCustomFieldOptions = new IssueCustomFieldOptions(this); - issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); - issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); - issueFieldConfigurations = new IssueFieldConfigurations(this); - issueFields = new IssueFields(this); - issueLinks = new IssueLinks(this); - issueLinkTypes = new IssueLinkTypes(this); - issueNavigatorSettings = new IssueNavigatorSettings(this); - issueNotificationSchemes = new IssueNotificationSchemes(this); - issuePriorities = new IssuePriorities(this); - issueProperties = new IssueProperties(this); - issueRemoteLinks = new IssueRemoteLinks(this); - issueResolutions = new IssueResolutions(this); - issues = new Issues(this); - issueSearch = new IssueSearch(this); - issueSecurityLevel = new IssueSecurityLevel(this); - issueSecuritySchemes = new IssueSecuritySchemes(this); - issueTypeProperties = new IssueTypeProperties(this); - issueTypes = new IssueTypes(this); - issueTypeSchemes = new IssueTypeSchemes(this); - issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); - issueVotes = new IssueVotes(this); - issueWatchers = new IssueWatchers(this); - issueWorklogProperties = new IssueWorklogProperties(this); - issueWorklogs = new IssueWorklogs(this); - jiraExpressions = new JiraExpressions(this); - jiraSettings = new JiraSettings(this); - jql = new JQL(this); - jqlFunctionsApps = new JqlFunctionsApps(this); - labels = new Labels(this); - licenseMetrics = new LicenseMetrics(this); - myself = new Myself(this); - permissions = new Permissions(this); - permissionSchemes = new PermissionSchemes(this); - projectAvatars = new ProjectAvatars(this); - projectCategories = new ProjectCategories(this); - projectComponents = new ProjectComponents(this); - projectEmail = new ProjectEmail(this); - projectFeatures = new ProjectFeatures(this); - projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); - projectPermissionSchemes = new ProjectPermissionSchemes(this); - projectProperties = new ProjectProperties(this); - projectRoleActors = new ProjectRoleActors(this); - projectRoles = new ProjectRoles(this); - projects = new Projects(this); - projectTypes = new ProjectTypes(this); - projectVersions = new ProjectVersions(this); - screens = new Screens(this); - screenSchemes = new ScreenSchemes(this); - screenTabFields = new ScreenTabFields(this); - screenTabs = new ScreenTabs(this); - serverInfo = new ServerInfo(this); - status = new Status(this); - tasks = new Tasks(this); - timeTracking = new TimeTracking(this); - uiModificationsApps = new UIModificationsApps(this); - userProperties = new UserProperties(this); - users = new Users(this); - userSearch = new UserSearch(this); - webhooks = new Webhooks(this); - workflows = new Workflows(this); - workflowSchemeDrafts = new WorkflowSchemeDrafts(this); - workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); - workflowSchemes = new WorkflowSchemes(this); - workflowStatusCategories = new WorkflowStatusCategories(this); - workflowStatuses = new WorkflowStatuses(this); - workflowTransitionProperties = new WorkflowTransitionProperties(this); - workflowTransitionRules = new WorkflowTransitionRules(this); -} diff --git a/src/version2/dashboards.mts b/src/version2/dashboards.mts new file mode 100644 index 0000000000..118e6a3d86 --- /dev/null +++ b/src/version2/dashboards.mts @@ -0,0 +1,727 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Dashboards { + constructor(private client: Client) {} + + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters: Parameters.GetAllDashboards | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: never, + ): Promise; + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard', + method: 'GET', + params: { + filter: parameters?.filter, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async createDashboard( + parameters: Parameters.CreateDashboard, + callback: Callback, + ): Promise; + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; + async createDashboard( + parameters: Parameters.CreateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard', + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback: Callback, + ): Promise; + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: never, + ): Promise; + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard/bulk/edit', + method: 'PUT', + data: { + action: parameters.action, + changeOwnerDetails: parameters.changeOwnerDetails, + entityIds: parameters.entityIds, + extendAdminPermissions: parameters.extendAdminPermissions, + permissionDetails: parameters.permissionDetails, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets( + callback: Callback, + ): Promise; + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets(callback?: never): Promise; + async getAllAvailableDashboardGadgets( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard/gadgets', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters: Parameters.GetDashboardsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: never, + ): Promise; + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/dashboard/search', + method: 'GET', + params: { + dashboardName: parameters?.dashboardName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + status: parameters?.status, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets, + callback?: never, + ): Promise; + async getAllGadgets( + parameters: Parameters.GetAllGadgets, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, + method: 'GET', + params: { + moduleKey: paramSerializer('moduleKey', parameters.moduleKey), + uri: parameters.uri, + gadgetId: paramSerializer('gadgetId', parameters.gadgetId), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; + async addGadget( + parameters: Parameters.AddGadget, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, + method: 'POST', + data: { + color: parameters.color, + ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, + moduleKey: parameters.moduleKey, + position: parameters.position, + title: parameters.title, + uri: parameters.uri, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; + async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'PUT', + data: { + color: parameters.color, + position: parameters.position, + title: parameters.title, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; + async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: never, + ): Promise; + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: never, + ): Promise; + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: never, + ): Promise; + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: never, + ): Promise; + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback: Callback, + ): Promise; + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback: Callback, + ): Promise; + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; + async copyDashboard( + parameters: Parameters.CopyDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/dashboard/${parameters.id}/copy`, + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts deleted file mode 100644 index 965ae75baf..0000000000 --- a/src/version2/dashboards.ts +++ /dev/null @@ -1,727 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class Dashboards { - constructor(private client: Client) {} - - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters: Parameters.GetAllDashboards | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: never, - ): Promise; - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard', - method: 'GET', - params: { - filter: parameters?.filter, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async createDashboard( - parameters: Parameters.CreateDashboard, - callback: Callback, - ): Promise; - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; - async createDashboard( - parameters: Parameters.CreateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard', - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback: Callback, - ): Promise; - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: never, - ): Promise; - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard/bulk/edit', - method: 'PUT', - data: { - action: parameters.action, - changeOwnerDetails: parameters.changeOwnerDetails, - entityIds: parameters.entityIds, - extendAdminPermissions: parameters.extendAdminPermissions, - permissionDetails: parameters.permissionDetails, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets( - callback: Callback, - ): Promise; - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets(callback?: never): Promise; - async getAllAvailableDashboardGadgets( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard/gadgets', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters: Parameters.GetDashboardsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-2-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: never, - ): Promise; - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/dashboard/search', - method: 'GET', - params: { - dashboardName: parameters?.dashboardName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - status: parameters?.status, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets, - callback?: never, - ): Promise; - async getAllGadgets( - parameters: Parameters.GetAllGadgets, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, - method: 'GET', - params: { - moduleKey: paramSerializer('moduleKey', parameters.moduleKey), - uri: parameters.uri, - gadgetId: paramSerializer('gadgetId', parameters.gadgetId), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; - async addGadget( - parameters: Parameters.AddGadget, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, - method: 'POST', - data: { - color: parameters.color, - ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, - moduleKey: parameters.moduleKey, - position: parameters.position, - title: parameters.title, - uri: parameters.uri, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; - async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'PUT', - data: { - color: parameters.color, - position: parameters.position, - title: parameters.title, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; - async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: never, - ): Promise; - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: never, - ): Promise; - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: never, - ): Promise; - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: never, - ): Promise; - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback: Callback, - ): Promise; - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback: Callback, - ): Promise; - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; - async copyDashboard( - parameters: Parameters.CopyDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.id}/copy`, - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/dynamicModules.mts b/src/version2/dynamicModules.mts new file mode 100644 index 0000000000..905ceb5773 --- /dev/null +++ b/src/version2/dynamicModules.mts @@ -0,0 +1,90 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DynamicModules { + constructor(private client: Client) {} + + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback: Callback): Promise; + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback?: never): Promise; + async getModules(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules( + parameters: Parameters.RegisterModules | undefined, + callback: Callback, + ): Promise; + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; + async registerModules( + parameters?: Parameters.RegisterModules, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'POST', + data: { + modules: parameters?.modules, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; + async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'DELETE', + params: { + moduleKey: parameters?.moduleKey, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/dynamicModules.ts b/src/version2/dynamicModules.ts deleted file mode 100644 index 516e6e05bd..0000000000 --- a/src/version2/dynamicModules.ts +++ /dev/null @@ -1,90 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class DynamicModules { - constructor(private client: Client) {} - - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback: Callback): Promise; - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback?: never): Promise; - async getModules(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules( - parameters: Parameters.RegisterModules | undefined, - callback: Callback, - ): Promise; - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; - async registerModules( - parameters?: Parameters.RegisterModules, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'POST', - data: { - modules: parameters?.modules, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; - async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'DELETE', - params: { - moduleKey: parameters?.moduleKey, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/filterSharing.mts b/src/version2/filterSharing.mts new file mode 100644 index 0000000000..a8b3c58f0e --- /dev/null +++ b/src/version2/filterSharing.mts @@ -0,0 +1,255 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class FilterSharing { + constructor(private client: Client) {} + + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback: Callback): Promise; + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback?: never): Promise; + async getDefaultShareScope(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/defaultShareScope', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback: Callback, + ): Promise; + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: never, + ): Promise; + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: Callback, + ): Promise { + const scope = typeof parameters === 'string' ? parameters : parameters.scope; + + const config: RequestConfig = { + url: '/rest/api/2/filter/defaultShareScope', + method: 'PUT', + data: { + scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback: Callback, + ): Promise; + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: never, + ): Promise; + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/permission`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-2-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback: Callback, + ): Promise; + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-2-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: never, + ): Promise; + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/permission`, + method: 'POST', + data: { + type: parameters.type, + projectId: parameters.projectId, + groupname: parameters.groupname, + projectRoleId: parameters.projectRoleId, + accountId: parameters.accountId, + rights: parameters.rights, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback: Callback, + ): Promise; + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: never, + ): Promise; + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback: Callback, + ): Promise; + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/filterSharing.ts b/src/version2/filterSharing.ts deleted file mode 100644 index 04f8ad9cc5..0000000000 --- a/src/version2/filterSharing.ts +++ /dev/null @@ -1,255 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class FilterSharing { - constructor(private client: Client) {} - - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback: Callback): Promise; - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback?: never): Promise; - async getDefaultShareScope(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/defaultShareScope', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback: Callback, - ): Promise; - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: never, - ): Promise; - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: Callback, - ): Promise { - const scope = typeof parameters === 'string' ? parameters : parameters.scope; - - const config: RequestConfig = { - url: '/rest/api/2/filter/defaultShareScope', - method: 'PUT', - data: { - scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback: Callback, - ): Promise; - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: never, - ): Promise; - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/permission`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-2-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback: Callback, - ): Promise; - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-2-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: never, - ): Promise; - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/permission`, - method: 'POST', - data: { - type: parameters.type, - projectId: parameters.projectId, - groupname: parameters.groupname, - projectRoleId: parameters.projectRoleId, - accountId: parameters.accountId, - rights: parameters.rights, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback: Callback, - ): Promise; - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: never, - ): Promise; - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback: Callback, - ): Promise; - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/filters.mts b/src/version2/filters.mts new file mode 100644 index 0000000000..f68bea8799 --- /dev/null +++ b/src/version2/filters.mts @@ -0,0 +1,624 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Filters { + constructor(private client: Client) {} + + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; + async createFilter( + parameters: Parameters.CreateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter', + method: 'POST', + params: { + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + favourite: parameters.favourite, + favouritedCount: parameters.favouritedCount, + id: parameters.id, + jql: parameters.jql, + name: parameters.name, + owner: parameters.owner, + searchUrl: parameters.searchUrl, + self: parameters.self, + sharePermissions: parameters.sharePermissions, + sharedUsers: parameters.sharedUsers, + subscriptions: parameters.subscriptions, + viewUrl: parameters.viewUrl, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters: Parameters.GetFavouriteFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: never, + ): Promise; + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/favourite', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters( + parameters: Parameters.GetMyFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; + async getMyFilters( + parameters?: Parameters.GetMyFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/my', + method: 'GET', + params: { + expand: parameters?.expand, + includeFavourites: parameters?.includeFavourites, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters: Parameters.GetFiltersPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: never, + ): Promise; + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/filter/search', + method: 'GET', + params: { + filterName: parameters?.filterName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + id: parameters?.id, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; + async getFilter( + parameters: Parameters.GetFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; + async updateFilter( + parameters: Parameters.UpdateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}`, + method: 'PUT', + params: { + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, + }, + data: { + name: parameters.name, + description: parameters.description, + jql: parameters.jql, + favourite: parameters.favourite, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; + async deleteFilter( + parameters: Parameters.DeleteFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns( + parameters: Parameters.GetColumns | string, + callback: Callback, + ): Promise; + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; + async getColumns( + parameters: Parameters.GetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/columns`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * 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/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * 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/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; + async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/columns`, + method: 'PUT', + data: parameters.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async resetColumns(parameters: Parameters.ResetColumns, callback: Callback): Promise; + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - 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 { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/columns`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: never, + ): Promise; + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/favourite`, + method: 'PUT', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: never, + ): Promise; + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/filter/${id}/favourite`, + method: 'DELETE', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; + async changeFilterOwner( + parameters: Parameters.ChangeFilterOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/filter/${parameters.id}/owner`, + method: 'PUT', + data: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/filters.ts b/src/version2/filters.ts deleted file mode 100644 index 65e0895154..0000000000 --- a/src/version2/filters.ts +++ /dev/null @@ -1,624 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Filters { - constructor(private client: Client) {} - - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-2-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; - async createFilter( - parameters: Parameters.CreateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter', - method: 'POST', - params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - favourite: parameters.favourite, - favouritedCount: parameters.favouritedCount, - id: parameters.id, - jql: parameters.jql, - name: parameters.name, - owner: parameters.owner, - searchUrl: parameters.searchUrl, - self: parameters.self, - sharePermissions: parameters.sharePermissions, - sharedUsers: parameters.sharedUsers, - subscriptions: parameters.subscriptions, - viewUrl: parameters.viewUrl, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters: Parameters.GetFavouriteFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: never, - ): Promise; - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/favourite', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters( - parameters: Parameters.GetMyFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; - async getMyFilters( - parameters?: Parameters.GetMyFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/my', - method: 'GET', - params: { - expand: parameters?.expand, - includeFavourites: parameters?.includeFavourites, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters: Parameters.GetFiltersPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: never, - ): Promise; - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/filter/search', - method: 'GET', - params: { - filterName: parameters?.filterName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - id: parameters?.id, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; - async getFilter( - parameters: Parameters.GetFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; - async updateFilter( - parameters: Parameters.UpdateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}`, - method: 'PUT', - params: { - expand: parameters.expand, - overrideSharePermissions: parameters.overrideSharePermissions, - }, - data: { - name: parameters.name, - description: parameters.description, - jql: parameters.jql, - favourite: parameters.favourite, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; - async deleteFilter( - parameters: Parameters.DeleteFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns( - parameters: Parameters.GetColumns | string, - callback: Callback, - ): Promise; - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; - async getColumns( - parameters: Parameters.GetColumns | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/columns`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * 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/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-2-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * 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/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; - async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, - method: 'PUT', - data: parameters.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns, callback: Callback): Promise; - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - 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 { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: never, - ): Promise; - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/favourite`, - method: 'PUT', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: never, - ): Promise; - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/filter/${id}/favourite`, - method: 'DELETE', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; - async changeFilterOwner( - parameters: Parameters.ChangeFilterOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/owner`, - method: 'PUT', - data: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/groupAndUserPicker.mts b/src/version2/groupAndUserPicker.mts new file mode 100644 index 0000000000..9ac8289397 --- /dev/null +++ b/src/version2/groupAndUserPicker.mts @@ -0,0 +1,110 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class GroupAndUserPicker { + constructor(private client: Client) {} + + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback: Callback, + ): Promise; + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: never, + ): Promise; + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/groupuserpicker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + fieldId: parameters.fieldId, + projectId: parameters.projectId, + issueTypeId: parameters.issueTypeId, + avatarSize: parameters.avatarSize, + caseInsensitive: parameters.caseInsensitive, + excludeConnectAddons: parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/groupAndUserPicker.ts b/src/version2/groupAndUserPicker.ts deleted file mode 100644 index 0f3f7a0968..0000000000 --- a/src/version2/groupAndUserPicker.ts +++ /dev/null @@ -1,110 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class GroupAndUserPicker { - constructor(private client: Client) {} - - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback: Callback, - ): Promise; - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: never, - ): Promise; - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/groupuserpicker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - fieldId: parameters.fieldId, - projectId: parameters.projectId, - issueTypeId: parameters.issueTypeId, - avatarSize: parameters.avatarSize, - caseInsensitive: parameters.caseInsensitive, - excludeConnectAddons: parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/groups.mts b/src/version2/groups.mts new file mode 100644 index 0000000000..acfa13bbe1 --- /dev/null +++ b/src/version2/groups.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Groups { + constructor(private client: Client) {} + + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; + async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; + async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group', + method: 'DELETE', + params: { + groupname: parameters?.groupname, + groupId: parameters?.groupId, + swapGroup: parameters?.swapGroup, + swapGroupId: parameters?.swapGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * groups. + * + * **[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 bulkGetGroups( + parameters: Parameters.BulkGetGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * groups. + * + * **[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 bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; + async bulkGetGroups( + parameters?: Parameters.BulkGetGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/bulk', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + groupId: parameters?.groupId, + groupName: parameters?.groupName, + accessType: parameters?.accessType, + applicationKey: parameters?.applicationKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * users in a group. + * + * 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). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * users in a group. + * + * 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). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: never, + ): Promise; + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/member', + method: 'GET', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + includeInactiveUsers: parameters.includeInactiveUsers, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; + async addUserToGroup( + parameters: Parameters.AddUserToGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/user', + method: 'POST', + params: { + groupname: parameters.groupName, + groupId: parameters.groupId, + }, + data: { + name: parameters.name, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback: Callback, + ): Promise; + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/group/user', + method: 'DELETE', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + username: parameters.username, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * 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). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups( + parameters: Parameters.FindGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * 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). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; + async findGroups( + parameters?: Parameters.FindGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/groups/picker', + method: 'GET', + params: { + query: parameters?.query, + exclude: parameters?.exclude, + excludeId: parameters?.excludeId, + maxResults: parameters?.maxResults, + caseInsensitive: parameters?.caseInsensitive, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/groups.ts b/src/version2/groups.ts deleted file mode 100644 index 2aeba04980..0000000000 --- a/src/version2/groups.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Groups { - constructor(private client: Client) {} - - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; - async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; - async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group', - method: 'DELETE', - params: { - groupname: parameters?.groupname, - groupId: parameters?.groupId, - swapGroup: parameters?.swapGroup, - swapGroupId: parameters?.swapGroupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * groups. - * - * **[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 bulkGetGroups( - parameters: Parameters.BulkGetGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * groups. - * - * **[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 bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; - async bulkGetGroups( - parameters?: Parameters.BulkGetGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/bulk', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - groupId: parameters?.groupId, - groupName: parameters?.groupName, - accessType: parameters?.accessType, - applicationKey: parameters?.applicationKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * users in a group. - * - * 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). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * users in a group. - * - * 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). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: never, - ): Promise; - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/member', - method: 'GET', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - includeInactiveUsers: parameters.includeInactiveUsers, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; - async addUserToGroup( - parameters: Parameters.AddUserToGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/user', - method: 'POST', - params: { - groupname: parameters.groupName, - groupId: parameters.groupId, - }, - data: { - name: parameters.name, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback: Callback, - ): Promise; - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/group/user', - method: 'DELETE', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - username: parameters.username, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * 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). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups( - parameters: Parameters.FindGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * 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). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; - async findGroups( - parameters?: Parameters.FindGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/groups/picker', - method: 'GET', - params: { - query: parameters?.query, - exclude: parameters?.exclude, - excludeId: parameters?.excludeId, - maxResults: parameters?.maxResults, - caseInsensitive: parameters?.caseInsensitive, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/index.mts b/src/version2/index.mts new file mode 100644 index 0000000000..d85c443fb9 --- /dev/null +++ b/src/version2/index.mts @@ -0,0 +1,89 @@ +export * from './announcementBanner.mjs'; +export * from './applicationRoles.mjs'; +export * from './appMigration.mjs'; +export * from './appProperties.mjs'; +export * from './auditRecords.mjs'; +export * from './avatars.mjs'; +export * from './dashboards.mjs'; +export * from './dynamicModules.mjs'; +export * from './filters.mjs'; +export * from './filterSharing.mjs'; +export * from './groupAndUserPicker.mjs'; +export * from './groups.mjs'; +export * from './issueAttachments.mjs'; +export * from './issueCommentProperties.mjs'; +export * from './issueComments.mjs'; +export * from './issueCustomFieldConfigurationApps.mjs'; +export * from './issueCustomFieldContexts.mjs'; +export * from './issueCustomFieldOptions.mjs'; +export * from './issueCustomFieldOptionsApps.mjs'; +export * from './issueCustomFieldValuesApps.mjs'; +export * from './issueFieldConfigurations.mjs'; +export * from './issueFields.mjs'; +export * from './issueLinks.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueNavigatorSettings.mjs'; +export * from './issueNotificationSchemes.mjs'; +export * from './issuePriorities.mjs'; +export * from './issueProperties.mjs'; +export * from './issueRemoteLinks.mjs'; +export * from './issueResolutions.mjs'; +export * from './issues.mjs'; +export * from './issueSearch.mjs'; +export * from './issueSecurityLevel.mjs'; +export * from './issueSecuritySchemes.mjs'; +export * from './issueTypeProperties.mjs'; +export * from './issueTypes.mjs'; +export * from './issueTypeSchemes.mjs'; +export * from './issueTypeScreenSchemes.mjs'; +export * from './issueVotes.mjs'; +export * from './issueWatchers.mjs'; +export * from './issueWorklogProperties.mjs'; +export * from './issueWorklogs.mjs'; +export * from './jiraExpressions.mjs'; +export * from './jiraSettings.mjs'; +export * from './jql.mjs'; +export * from './jqlFunctionsApps.mjs'; +export * from './labels.mjs'; +export * from './licenseMetrics.mjs'; +export * from './myself.mjs'; +export * from './permissions.mjs'; +export * from './permissionSchemes.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategories.mjs'; +export * from './projectComponents.mjs'; +export * from './projectEmail.mjs'; +export * from './projectFeatures.mjs'; +export * from './projectKeyAndNameValidation.mjs'; +export * from './projectPermissionSchemes.mjs'; +export * from './projectProperties.mjs'; +export * from './projectRoleActors.mjs'; +export * from './projectRoles.mjs'; +export * from './projects.mjs'; +export * from './projectTypes.mjs'; +export * from './projectVersions.mjs'; +export * from './screens.mjs'; +export * from './screenSchemes.mjs'; +export * from './screenTabFields.mjs'; +export * from './screenTabs.mjs'; +export * from './serverInfo.mjs'; +export * from './status.mjs'; +export * from './tasks.mjs'; +export * from './timeTracking.mjs'; +export * from './uiModificationsApps.mjs'; +export * from './userProperties.mjs'; +export * from './users.mjs'; +export * from './userSearch.mjs'; +export * from './webhooks.mjs'; +export * from './workflows.mjs'; +export * from './workflowSchemeDrafts.mjs'; +export * from './workflowSchemeProjectAssociations.mjs'; +export * from './workflowSchemes.mjs'; +export * from './workflowStatusCategories.mjs'; +export * from './workflowStatuses.mjs'; +export * from './workflowTransitionProperties.mjs'; +export * from './workflowTransitionRules.mjs'; + +export * as Version2Models from './models/index.mjs'; +export * as Version2Parameters from './parameters/index.mjs'; +export * from './client/version2Client.mjs'; diff --git a/src/version2/index.ts b/src/version2/index.ts deleted file mode 100644 index f44c40620e..0000000000 --- a/src/version2/index.ts +++ /dev/null @@ -1,89 +0,0 @@ -export * from './announcementBanner'; -export * from './applicationRoles'; -export * from './appMigration'; -export * from './appProperties'; -export * from './auditRecords'; -export * from './avatars'; -export * from './dashboards'; -export * from './dynamicModules'; -export * from './filters'; -export * from './filterSharing'; -export * from './groupAndUserPicker'; -export * from './groups'; -export * from './issueAttachments'; -export * from './issueCommentProperties'; -export * from './issueComments'; -export * from './issueCustomFieldConfigurationApps'; -export * from './issueCustomFieldContexts'; -export * from './issueCustomFieldOptions'; -export * from './issueCustomFieldOptionsApps'; -export * from './issueCustomFieldValuesApps'; -export * from './issueFieldConfigurations'; -export * from './issueFields'; -export * from './issueLinks'; -export * from './issueLinkTypes'; -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 './issueVotes'; -export * from './issueWatchers'; -export * from './issueWorklogProperties'; -export * from './issueWorklogs'; -export * from './jiraExpressions'; -export * from './jiraSettings'; -export * from './jQL'; -export * from './jqlFunctionsApps'; -export * from './labels'; -export * from './licenseMetrics'; -export * from './myself'; -export * from './permissions'; -export * from './permissionSchemes'; -export * from './projectAvatars'; -export * from './projectCategories'; -export * from './projectComponents'; -export * from './projectEmail'; -export * from './projectFeatures'; -export * from './projectKeyAndNameValidation'; -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 './screenSchemes'; -export * from './screenTabFields'; -export * from './screenTabs'; -export * from './serverInfo'; -export * from './status'; -export * from './tasks'; -export * from './timeTracking'; -export * from './uIModificationsApps'; -export * from './userProperties'; -export * from './users'; -export * from './userSearch'; -export * from './webhooks'; -export * from './workflows'; -export * from './workflowSchemeDrafts'; -export * from './workflowSchemeProjectAssociations'; -export * from './workflowSchemes'; -export * from './workflowStatusCategories'; -export * from './workflowStatuses'; -export * from './workflowTransitionProperties'; -export * from './workflowTransitionRules'; - -export * as Version2Models from './models'; -export * as Version2Parameters from './parameters'; -export * from './client'; diff --git a/src/version2/issueAttachments.mts b/src/version2/issueAttachments.mts new file mode 100644 index 0000000000..90f4deb6e1 --- /dev/null +++ b/src/version2/issueAttachments.mts @@ -0,0 +1,445 @@ +import FormData from 'form-data'; +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueAttachments { + constructor(private client: Client) {} + + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback: Callback, + ): Promise; + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: never, + ): Promise; + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/content/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback: Callback): Promise; + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback?: never): Promise; + async getAttachmentMeta(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/attachment/meta', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback: Callback, + ): Promise; + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: never, + ): Promise; + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/thumbnail/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, + width: typeof parameters !== 'string' && parameters.width, + height: typeof parameters !== 'string' && parameters.height, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * 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 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 getAttachment( + parameters: Parameters.GetAttachment | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * 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 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 getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: never, + ): Promise; + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback: Callback, + ): Promise; + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: never, + ): Promise; + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}/expand/human`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: never, + ): Promise; + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/attachment/${id}/expand/raw`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment( + parameters: Parameters.AddAttachment, + callback: Callback, + ): Promise; + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; + async addAttachment( + parameters: Parameters.AddAttachment, + callback?: Callback, + ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); + + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/attachments`, + method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': 'multipart/form-data', + ...formData.getHeaders?.(), + }, + data: formData, + maxBodyLength: Infinity, + maxContentLength: Infinity, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueAttachments.ts b/src/version2/issueAttachments.ts deleted file mode 100644 index c1961e3af4..0000000000 --- a/src/version2/issueAttachments.ts +++ /dev/null @@ -1,446 +0,0 @@ -// @ts-expect-error Wrong form data typings -import FormData from 'form-data'; -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueAttachments { - constructor(private client: Client) {} - - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback: Callback, - ): Promise; - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-2-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: never, - ): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/content/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback: Callback): Promise; - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback?: never): Promise; - async getAttachmentMeta(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/attachment/meta', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-2-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: never, - ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/thumbnail/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, - width: typeof parameters !== 'string' && parameters.width, - height: typeof parameters !== 'string' && parameters.height, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * 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 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 getAttachment( - parameters: Parameters.GetAttachment | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * 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 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 getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: never, - ): Promise; - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback: Callback, - ): Promise; - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-2-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: never, - ): Promise; - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}/expand/human`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-2-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: never, - ): Promise; - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/attachment/${id}/expand/raw`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment( - parameters: Parameters.AddAttachment, - callback: Callback, - ): Promise; - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; - async addAttachment( - parameters: Parameters.AddAttachment, - callback?: Callback, - ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); - - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/attachments`, - method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': 'multipart/form-data', - ...formData.getHeaders?.(), - }, - data: formData, - maxBodyLength: Infinity, - maxContentLength: Infinity, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCommentProperties.mts b/src/version2/issueCommentProperties.mts new file mode 100644 index 0000000000..33f3b1bba9 --- /dev/null +++ b/src/version2/issueCommentProperties.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCommentProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all the properties of a comment. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns the keys of all the properties of a comment. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: never, + ): Promise; + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: Callback, + ): Promise { + const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; + + const config: RequestConfig = { + url: `/rest/api/2/comment/${commentId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a comment property. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a comment property. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: never, + ): Promise; + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.property, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback: Callback, + ): Promise; + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCommentProperties.ts b/src/version2/issueCommentProperties.ts deleted file mode 100644 index c122e8bcc9..0000000000 --- a/src/version2/issueCommentProperties.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCommentProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all the properties of a comment. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the keys of all the properties of a comment. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: never, - ): Promise; - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: Callback, - ): Promise { - const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; - - const config: RequestConfig = { - url: `/rest/api/2/comment/${commentId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a comment property. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a comment property. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: never, - ): Promise; - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.property, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback: Callback, - ): Promise; - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueComments.mts b/src/version2/issueComments.mts new file mode 100644 index 0000000000..95535e5776 --- /dev/null +++ b/src/version2/issueComments.mts @@ -0,0 +1,309 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueComments { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/comment/list', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback: Callback, + ): Promise; + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback?: never, + ): Promise; + async getComments( + parameters: Parameters.GetComments | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/comment`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + orderBy: typeof parameters !== 'string' && parameters.orderBy, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback?: never): Promise; + async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + self: parameters.self, + id: parameters.id, + author: parameters.author, + body: parameters.comment, + renderedBody: parameters.renderedBody, + updateAuthor: parameters.updateAuthor, + created: parameters.created, + updated: parameters.updated, + visibility: parameters.visibility, + jsdPublic: parameters.jsdPublic, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a comment. + * + * 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 + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; + /** + * Returns a comment. + * + * 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 + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback?: never): Promise; + async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a comment. + * + * 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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; + /** + * Updates a comment. + * + * 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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; + async updateComment( + parameters: Parameters.UpdateComment, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideEditableFlag: parameters.overrideEditableFlag, + expand: parameters.expand, + }, + data: { + body: parameters.comment, + visibility: parameters.visibility, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment. + * + * **[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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; + /** + * Deletes a comment. + * + * **[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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; + async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts deleted file mode 100644 index 8f45ac0ae6..0000000000 --- a/src/version2/issueComments.ts +++ /dev/null @@ -1,309 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueComments { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/comment/list', - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - ids: parameters.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback: Callback, - ): Promise; - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback?: never, - ): Promise; - async getComments( - parameters: Parameters.GetComments | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/comment`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback?: never): Promise; - async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - self: parameters.self, - id: parameters.id, - author: parameters.author, - body: parameters.comment, - renderedBody: parameters.renderedBody, - updateAuthor: parameters.updateAuthor, - created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - jsdPublic: parameters.jsdPublic, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a comment. - * - * 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 - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; - /** - * Returns a comment. - * - * 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 - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback?: never): Promise; - async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a comment. - * - * 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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; - /** - * Updates a comment. - * - * 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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; - async updateComment( - parameters: Parameters.UpdateComment, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideEditableFlag: parameters.overrideEditableFlag, - expand: parameters.expand, - }, - data: { - body: parameters.comment, - visibility: parameters.visibility, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment. - * - * **[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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; - /** - * Deletes a comment. - * - * **[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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; - async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldConfigurationApps.mts b/src/version2/issueCustomFieldConfigurationApps.mts new file mode 100644 index 0000000000..d43364e093 --- /dev/null +++ b/src/version2/issueCustomFieldConfigurationApps.mts @@ -0,0 +1,111 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldConfigurationApps { + constructor(private client: Client) {} + + /** + * 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/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations 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 created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration, + callback: Callback, + ): 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/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations 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 created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration, + callback?: never, + ): Promise; + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, + method: 'GET', + params: { + id: parameters.id, + fieldContextId: parameters.fieldContextId, + issueId: parameters.issueId, + projectKeyOrId: parameters.projectKeyOrId, + issueTypeId: parameters.issueTypeId, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the configuration for contexts of a custom field 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. + */ + 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/). + * + * **[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. + */ + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: never, + ): Promise; + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, + method: 'PUT', + data: { + configurations: parameters.configurations, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldConfigurationApps.ts b/src/version2/issueCustomFieldConfigurationApps.ts deleted file mode 100644 index 9fd1d66810..0000000000 --- a/src/version2/issueCustomFieldConfigurationApps.ts +++ /dev/null @@ -1,111 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldConfigurationApps { - constructor(private client: Client) {} - - /** - * 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/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations 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 created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback: Callback, - ): 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/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations 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 created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback?: never, - ): Promise; - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, - method: 'GET', - params: { - id: parameters.id, - fieldContextId: parameters.fieldContextId, - issueId: parameters.issueId, - projectKeyOrId: parameters.projectKeyOrId, - issueTypeId: parameters.issueTypeId, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the configuration for contexts of a custom field 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. - */ - 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/). - * - * **[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. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: never, - ): Promise; - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/context/configuration`, - method: 'PUT', - data: { - configurations: parameters.configurations, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldContexts.mts b/src/version2/issueCustomFieldContexts.mts new file mode 100644 index 0000000000..c31bd826d0 --- /dev/null +++ b/src/version2/issueCustomFieldContexts.mts @@ -0,0 +1,724 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldContexts { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: never, + ): Promise; + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context`, + method: 'GET', + params: { + isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, + isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: never, + ): Promise; + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + description: parameters.description, + projectIds: parameters.projectIds, + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: never, + ): Promise; + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context/defaultValue`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/defaultValue`, + method: 'PUT', + data: { + defaultValues: parameters.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: never, + ): Promise; + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context/issuetypemapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: never, + ): Promise; + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/mapping`, + method: 'POST', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: never, + ): Promise; + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/context/projectmapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a [ custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Updates a [ custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: never, + ): Promise; + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: never, + ): Promise; + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback: Callback, + ): Promise; + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback: Callback, + ): Promise; + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: never, + ): Promise; + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: never, + ): Promise; + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project`, + method: 'PUT', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback: Callback, + ): Promise; + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: never, + ): Promise; + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, + method: 'POST', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldContexts.ts b/src/version2/issueCustomFieldContexts.ts deleted file mode 100644 index 21a0d25b21..0000000000 --- a/src/version2/issueCustomFieldContexts.ts +++ /dev/null @@ -1,724 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldContexts { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: never, - ): Promise; - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context`, - method: 'GET', - params: { - isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, - isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: never, - ): Promise; - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, - projectIds: parameters.projectIds, - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: never, - ): Promise; - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context/defaultValue`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/defaultValue`, - method: 'PUT', - data: { - defaultValues: parameters.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: never, - ): Promise; - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context/issuetypemapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: never, - ): Promise; - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/mapping`, - method: 'POST', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: never, - ): Promise; - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/context/projectmapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a [ custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Updates a [ custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: never, - ): Promise; - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: never, - ): Promise; - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback: Callback, - ): Promise; - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback: Callback, - ): Promise; - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: never, - ): Promise; - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: never, - ): Promise; - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project`, - method: 'PUT', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback: Callback, - ): Promise; - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: never, - ): Promise; - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, - method: 'POST', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldOptions.mts b/src/version2/issueCustomFieldOptions.mts new file mode 100644 index 0000000000..f864b895ee --- /dev/null +++ b/src/version2/issueCustomFieldOptions.mts @@ -0,0 +1,301 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptions { + constructor(private client: Client) {} + + /** + * Returns a custom field option. For example, an option in a select list. + * + * 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 apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback: Callback, + ): Promise; + /** + * Returns a custom field option. For example, an option in a select list. + * + * 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 apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: never, + ): Promise; + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/customFieldOption/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: never, + ): Promise; + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'GET', + params: { + optionId: parameters.optionId, + onlyOptions: parameters.onlyOptions, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: never, + ): Promise; + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'POST', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * 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 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 updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * 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 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 updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: never, + ): Promise; + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'PUT', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback: Callback, + ): Promise; + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: never, + ): Promise; + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, + method: 'PUT', + data: { + customFieldOptionIds: parameters.customFieldOptionIds, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldOptions.ts b/src/version2/issueCustomFieldOptions.ts deleted file mode 100644 index 4f7cb8ff63..0000000000 --- a/src/version2/issueCustomFieldOptions.ts +++ /dev/null @@ -1,301 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldOptions { - constructor(private client: Client) {} - - /** - * Returns a custom field option. For example, an option in a select list. - * - * 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 apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback: Callback, - ): Promise; - /** - * Returns a custom field option. For example, an option in a select list. - * - * 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 apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: never, - ): Promise; - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/customFieldOption/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: never, - ): Promise; - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'GET', - params: { - optionId: parameters.optionId, - onlyOptions: parameters.onlyOptions, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: never, - ): Promise; - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'POST', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * 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 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 updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * 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 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 updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: never, - ): Promise; - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'PUT', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback: Callback, - ): Promise; - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: never, - ): Promise; - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, - method: 'PUT', - data: { - customFieldOptionIds: parameters.customFieldOptionIds, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldOptionsApps.mts b/src/version2/issueCustomFieldOptionsApps.mts new file mode 100644 index 0000000000..e82356c1db --- /dev/null +++ b/src/version2/issueCustomFieldOptionsApps.mts @@ -0,0 +1,407 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptionsApps { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: never, + ): Promise; + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldKey}/option`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: never, + ): Promise; + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option`, + method: 'POST', + data: { + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: never, + ): Promise; + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: never, + ): Promise; + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: never, + ): Promise; + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: never, + ): Promise; + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'PUT', + data: { + id: parameters.id, + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * 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 + * 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 + * 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. + * + * **[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. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * 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 + * 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 + * 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. + * + * **[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. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: never, + ): Promise; + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldOptionsApps.ts b/src/version2/issueCustomFieldOptionsApps.ts deleted file mode 100644 index 60b342455e..0000000000 --- a/src/version2/issueCustomFieldOptionsApps.ts +++ /dev/null @@ -1,407 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldOptionsApps { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: never, - ): Promise; - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: never, - ): Promise; - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option`, - method: 'POST', - data: { - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: never, - ): Promise; - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/edit`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: never, - ): Promise; - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldKey}/option/suggestions/search`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: never, - ): Promise; - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: never, - ): Promise; - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'PUT', - data: { - id: parameters.id, - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * 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 - * 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 - * 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. - * - * **[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. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * 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 - * 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 - * 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. - * - * **[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. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: never, - ): Promise; - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - jql: parameters.jql, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueCustomFieldValuesApps.mts b/src/version2/issueCustomFieldValuesApps.mts new file mode 100644 index 0000000000..f60d2ad498 --- /dev/null +++ b/src/version2/issueCustomFieldValuesApps.mts @@ -0,0 +1,85 @@ +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldValuesApps { + constructor(private client: Client) {} + + /** + * 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. + * + * **[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. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback: Callback, + ): 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. + * + * **[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. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: never, + ): Promise; + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/app/field/value', + method: 'POST', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * **[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. + */ + 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. + * + * **[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. + */ + async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; + async updateCustomFieldValue( + parameters: Parameters.UpdateCustomFieldValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/value`, + method: 'PUT', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueCustomFieldValuesApps.ts b/src/version2/issueCustomFieldValuesApps.ts deleted file mode 100644 index 5413f7d241..0000000000 --- a/src/version2/issueCustomFieldValuesApps.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldValuesApps { - constructor(private client: Client) {} - - /** - * 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. - * - * **[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. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback: Callback, - ): 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. - * - * **[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. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: never, - ): Promise; - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/app/field/value', - method: 'POST', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * **[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. - */ - 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. - * - * **[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. - */ - async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; - async updateCustomFieldValue( - parameters: Parameters.UpdateCustomFieldValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/app/field/${parameters.fieldIdOrKey}/value`, - method: 'PUT', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueFieldConfigurations.mts b/src/version2/issueFieldConfigurations.mts new file mode 100644 index 0000000000..deac642654 --- /dev/null +++ b/src/version2/issueFieldConfigurations.mts @@ -0,0 +1,650 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFieldConfigurations { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects 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). + */ + async getAllFieldConfigurations( + parameters: Parameters.GetAllFieldConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects 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). + */ + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: never, + ): Promise; + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfiguration', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + isDefault: parameters?.isDefault, + query: parameters?.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters: Parameters.CreateFieldConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: never, + ): Promise; + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfiguration', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: never, + ): Promise; + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration | string, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration | string, + callback?: never, + ): Promise; + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects 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). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects 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). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems | string, + callback?: never, + ): Promise; + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${id}/fields`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback: Callback, + ): Promise; + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: never, + ): Promise; + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfiguration/${parameters.id}/fields`, + method: 'PUT', + data: { + fieldConfigurationItems: parameters.fieldConfigurationItems, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects 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). + */ + async getAllFieldConfigurationSchemes( + parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects 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). + */ + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: never, + ): Promise; + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters: Parameters.CreateFieldConfigurationScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: never, + ): Promise; + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects 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). + */ + async getFieldConfigurationSchemeMappings( + parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects 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). + */ + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects 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). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects 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). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject, + callback: Callback, + ): Promise; + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: never, + ): Promise; + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/fieldconfigurationscheme/project', + method: 'PUT', + data: { + fieldConfigurationSchemeId: parameters.fieldConfigurationSchemeId, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: never, + ): Promise; + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme | string, + callback?: never, + ): Promise; + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback: Callback, + ): Promise; + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: never, + ): Promise; + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping`, + method: 'PUT', + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: never, + ): Promise; + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping/delete`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueFieldConfigurations.ts b/src/version2/issueFieldConfigurations.ts deleted file mode 100644 index 5ebf33d4e3..0000000000 --- a/src/version2/issueFieldConfigurations.ts +++ /dev/null @@ -1,650 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueFieldConfigurations { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects 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). - */ - async getAllFieldConfigurations( - parameters: Parameters.GetAllFieldConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects 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). - */ - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: never, - ): Promise; - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfiguration', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - isDefault: parameters?.isDefault, - query: parameters?.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: never, - ): Promise; - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfiguration', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: never, - ): Promise; - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback?: never, - ): Promise; - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects 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). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects 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). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback?: never, - ): Promise; - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${id}/fields`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: never, - ): Promise; - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfiguration/${parameters.id}/fields`, - method: 'PUT', - data: { - fieldConfigurationItems: parameters.fieldConfigurationItems, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects 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). - */ - async getAllFieldConfigurationSchemes( - parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects 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). - */ - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: never, - ): Promise; - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: never, - ): Promise; - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects 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). - */ - async getFieldConfigurationSchemeMappings( - parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects 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). - */ - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects 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). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects 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). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback: Callback, - ): Promise; - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: never, - ): Promise; - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/fieldconfigurationscheme/project', - method: 'PUT', - data: { - fieldConfigurationSchemeId: parameters.fieldConfigurationSchemeId, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: never, - ): Promise; - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback?: never, - ): Promise; - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback: Callback, - ): Promise; - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: never, - ): Promise; - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping`, - method: 'PUT', - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: never, - ): Promise; - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/fieldconfigurationscheme/${parameters.id}/mapping/delete`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueFields.mts b/src/version2/issueFields.mts new file mode 100644 index 0000000000..64d559e9e3 --- /dev/null +++ b/src/version2/issueFields.mts @@ -0,0 +1,319 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFields { + constructor(private client: Client) {} + + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFields(callback: Callback): Promise; + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFields(callback?: never): Promise; + async getFields(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters: Parameters.CreateCustomField | undefined, + callback: Callback, + ): Promise; + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters?: Parameters.CreateCustomField, + callback?: never, + ): Promise; + async createCustomField( + parameters?: Parameters.CreateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + type: parameters?.type, + searcherKey: parameters?.searcherKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - 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`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters: Parameters.GetFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - 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`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: never, + ): Promise; + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + type: parameters?.type, + id: parameters?.id, + query: parameters?.query, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters: Parameters.GetTrashedFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: never, + ): Promise; + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/field/search/trashed', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + query: parameters?.query, + expand: parameters?.expand, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; + async updateCustomField( + parameters: Parameters.UpdateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + searcherKey: parameters.searcherKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; + async deleteCustomField( + parameters: Parameters.DeleteCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback: Callback, + ): Promise; + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.id}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; + async trashCustomField( + parameters: Parameters.TrashCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.id}/trash`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts deleted file mode 100644 index 4873583e65..0000000000 --- a/src/version2/issueFields.ts +++ /dev/null @@ -1,319 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueFields { - constructor(private client: Client) {} - - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFields(callback: Callback): Promise; - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFields(callback?: never): Promise; - async getFields(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField | undefined, - callback: Callback, - ): Promise; - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters?: Parameters.CreateCustomField, - callback?: never, - ): Promise; - async createCustomField( - parameters?: Parameters.CreateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - type: parameters?.type, - searcherKey: parameters?.searcherKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - 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`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters: Parameters.GetFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - 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`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: never, - ): Promise; - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - id: parameters?.id, - query: parameters?.query, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters: Parameters.GetTrashedFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: never, - ): Promise; - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/field/search/trashed', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - query: parameters?.query, - expand: parameters?.expand, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; - async updateCustomField( - parameters: Parameters.UpdateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.fieldId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - searcherKey: parameters.searcherKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; - async deleteCustomField( - parameters: Parameters.DeleteCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback: Callback, - ): Promise; - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.id}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; - async trashCustomField( - parameters: Parameters.TrashCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/field/${parameters.id}/trash`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueLinkTypes.mts b/src/version2/issueLinkTypes.mts new file mode 100644 index 0000000000..70c5a44843 --- /dev/null +++ b/src/version2/issueLinkTypes.mts @@ -0,0 +1,208 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinkTypes { + constructor(private client: Client) {} + + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkTypes(callback: Callback): Promise; + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkTypes(callback?: never): Promise; + async getIssueLinkTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issueLinkType', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: never, + ): Promise; + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issueLinkType', + method: 'POST', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType | string, + callback: Callback, + ): Promise; + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType | string, + callback?: never, + ): Promise; + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType | string, + callback?: Callback, + ): Promise { + const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: never, + ): Promise; + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'PUT', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType | string, + callback?: never, + ): Promise; + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType | string, + callback?: Callback, + ): Promise { + const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueLinkTypes.ts b/src/version2/issueLinkTypes.ts deleted file mode 100644 index f9fc02a695..0000000000 --- a/src/version2/issueLinkTypes.ts +++ /dev/null @@ -1,208 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueLinkTypes { - constructor(private client: Client) {} - - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkTypes(callback: Callback): Promise; - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkTypes(callback?: never): Promise; - async getIssueLinkTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issueLinkType', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: never, - ): Promise; - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issueLinkType', - method: 'POST', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback: Callback, - ): Promise; - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback?: never, - ): Promise; - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType | string, - callback?: Callback, - ): Promise { - const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: never, - ): Promise; - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'PUT', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback?: never, - ): Promise; - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType | string, - callback?: Callback, - ): Promise { - const issueLinkTypeId = typeof parameters === 'string' ? parameters : parameters.issueLinkTypeId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLinkType/${issueLinkTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueLinks.mts b/src/version2/issueLinks.mts new file mode 100644 index 0000000000..4962691231 --- /dev/null +++ b/src/version2/issueLinks.mts @@ -0,0 +1,162 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinks { + constructor(private client: Client) {} + + /** + * 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 + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * 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: 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 + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * 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 { + const config: RequestConfig = { + url: '/rest/api/2/issueLink', + method: 'POST', + data: { + type: parameters.type, + inwardIssue: parameters.inwardIssue, + outwardIssue: parameters.outwardIssue, + comment: parameters.comment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink( + parameters: Parameters.GetIssueLink | string, + callback: Callback, + ): Promise; + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink(parameters: Parameters.GetIssueLink | string, callback?: never): Promise; + async getIssueLink( + parameters: Parameters.GetIssueLink | string, + callback?: Callback, + ): Promise { + const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLink/${linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink( + parameters: Parameters.DeleteIssueLink | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink(parameters: Parameters.DeleteIssueLink | string, callback?: never): Promise; + async deleteIssueLink( + parameters: Parameters.DeleteIssueLink | string, + callback?: Callback, + ): Promise { + const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; + + const config: RequestConfig = { + url: `/rest/api/2/issueLink/${linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueLinks.ts b/src/version2/issueLinks.ts deleted file mode 100644 index 651ba80273..0000000000 --- a/src/version2/issueLinks.ts +++ /dev/null @@ -1,162 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueLinks { - constructor(private client: Client) {} - - /** - * 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 - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * 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: 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 - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/2/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * 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 { - const config: RequestConfig = { - url: '/rest/api/2/issueLink', - method: 'POST', - data: { - type: parameters.type, - inwardIssue: parameters.inwardIssue, - outwardIssue: parameters.outwardIssue, - comment: parameters.comment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink( - parameters: Parameters.GetIssueLink | string, - callback: Callback, - ): Promise; - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink(parameters: Parameters.GetIssueLink | string, callback?: never): Promise; - async getIssueLink( - parameters: Parameters.GetIssueLink | string, - callback?: Callback, - ): Promise { - const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLink/${linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink( - parameters: Parameters.DeleteIssueLink | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink | string, callback?: never): Promise; - async deleteIssueLink( - parameters: Parameters.DeleteIssueLink | string, - callback?: Callback, - ): Promise { - const linkId = typeof parameters === 'string' ? parameters : parameters.linkId; - - const config: RequestConfig = { - url: `/rest/api/2/issueLink/${linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueNavigatorSettings.mts b/src/version2/issueNavigatorSettings.mts new file mode 100644 index 0000000000..1099b53305 --- /dev/null +++ b/src/version2/issueNavigatorSettings.mts @@ -0,0 +1,76 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueNavigatorSettings { + constructor(private client: Client) {} + + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback?: never): Promise; + async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/settings/columns', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-2-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/2/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-2-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback?: never): Promise; + async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/settings/columns', + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueNavigatorSettings.ts b/src/version2/issueNavigatorSettings.ts deleted file mode 100644 index 97c86cdef6..0000000000 --- a/src/version2/issueNavigatorSettings.ts +++ /dev/null @@ -1,76 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueNavigatorSettings { - constructor(private client: Client) {} - - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback?: never): Promise; - async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/settings/columns', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-2-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-2-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback?: never): Promise; - async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/settings/columns', - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueNotificationSchemes.mts b/src/version2/issueNotificationSchemes.mts new file mode 100644 index 0000000000..abca8a1fbc --- /dev/null +++ b/src/version2/issueNotificationSchemes.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueNotificationSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters: Parameters.GetNotificationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: never, + ): Promise; + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/notificationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: parameters?.projectId, + onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: never, + ): Promise; + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/notificationscheme', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: never, + ): Promise; + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/notificationscheme/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + notificationSchemeId: parameters?.notificationSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: never, + ): Promise; + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a notification 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 updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Updates a notification 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 updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: never, + ): Promise; + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a notification 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 deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback: Callback, + ): Promise; + /** + * Deletes a notification 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 deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: never, + ): Promise; + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback: Callback, + ): Promise; + /** + * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: never, + ): Promise; + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueNotificationSchemes.ts b/src/version2/issueNotificationSchemes.ts deleted file mode 100644 index 9c75917276..0000000000 --- a/src/version2/issueNotificationSchemes.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueNotificationSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters: Parameters.GetNotificationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: never, - ): Promise; - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/notificationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - onlyDefault: parameters?.onlyDefault, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: never, - ): Promise; - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/notificationscheme', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - notificationSchemeEvents: parameters.notificationSchemeEvents, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: never, - ): Promise; - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/notificationscheme/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - notificationSchemeId: parameters?.notificationSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: never, - ): Promise; - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a notification 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 updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Updates a notification 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 updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: never, - ): Promise; - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a notification 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 deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a notification 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 deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: never, - ): Promise; - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback: Callback, - ): Promise; - /** - * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: never, - ): Promise; - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issuePriorities.mts b/src/version2/issuePriorities.mts new file mode 100644 index 0000000000..9330274514 --- /dev/null +++ b/src/version2/issuePriorities.mts @@ -0,0 +1,241 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class IssuePriorities { + constructor(private client: Client) {} + + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback: Callback): Promise; + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback?: never): Promise; + async getPriorities(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue 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 createPriority( + parameters: Parameters.CreatePriority, + callback: Callback, + ): Promise; + /** + * Creates an issue 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 createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; + async createPriority( + parameters: Parameters.CreatePriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority', + method: 'POST', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue 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 setDefaultPriority( + parameters: Parameters.SetDefaultPriority | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue 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 setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; + async setDefaultPriority( + parameters?: Parameters.SetDefaultPriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority/default', + method: 'PUT', + data: { + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; + async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority/move', + method: 'PUT', + data: { + ids: parameters.ids, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters: Parameters.SearchPriorities | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: never, + ): Promise; + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priority/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: paramSerializer('projectId', parameters?.projectId), + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority( + parameters: Parameters.GetPriority | string, + callback: Callback, + ): Promise; + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority(parameters: Parameters.GetPriority | string, callback?: never): Promise; + async getPriority( + parameters: Parameters.GetPriority | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/priority/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; + /** + * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; + async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priority/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issuePriorities.ts b/src/version2/issuePriorities.ts deleted file mode 100644 index 04f82b2efa..0000000000 --- a/src/version2/issuePriorities.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class IssuePriorities { - constructor(private client: Client) {} - - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback: Callback): Promise; - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback?: never): Promise; - async getPriorities(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue 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 createPriority( - parameters: Parameters.CreatePriority, - callback: Callback, - ): Promise; - /** - * Creates an issue 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 createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; - async createPriority( - parameters: Parameters.CreatePriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority', - method: 'POST', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue 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 setDefaultPriority( - parameters: Parameters.SetDefaultPriority | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue 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 setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; - async setDefaultPriority( - parameters?: Parameters.SetDefaultPriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority/default', - method: 'PUT', - data: { - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; - async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority/move', - method: 'PUT', - data: { - ids: parameters.ids, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters: Parameters.SearchPriorities | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: never, - ): Promise; - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/priority/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: paramSerializer('projectId', parameters?.projectId), - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority( - parameters: Parameters.GetPriority | string, - callback: Callback, - ): Promise; - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority | string, callback?: never): Promise; - async getPriority( - parameters: Parameters.GetPriority | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/priority/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; - /** - * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; - async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/priority/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueProperties.mts b/src/version2/issueProperties.mts new file mode 100644 index 0000000000..583eac81f2 --- /dev/null +++ b/src/version2/issueProperties.mts @@ -0,0 +1,511 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueProperties { + constructor(private client: Client) {} + + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( + parameters: Parameters.BulkSetIssuesProperties | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: never, + ): Promise; + async bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/properties', + method: 'POST', + data: { + entitiesIds: parameters?.entitiesIds, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * 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. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( + parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * 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. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: never, + ): Promise; + async bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/properties/multi', + method: 'POST', + data: { + issues: parameters?.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * 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 + * `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:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback: Callback, + ): Promise; + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * 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 + * `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:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, + method: 'PUT', + data: { + value: parameters.value, + expression: parameters.expression, + filter: parameters.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: never, + ): Promise; + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, + method: 'DELETE', + data: { + entityIds: parameters.entityIds, + currentValue: parameters.currentValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Property details are only returned 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 getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Property details are only returned 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 getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys | string, + callback?: never, + ): Promise; + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of an issue's property. + * + * 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 + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of an issue's property. + * + * 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 + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: never, + ): Promise; + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; + async setIssueProperty( + parameters: Parameters.SetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; + async deleteIssueProperty( + parameters: Parameters.DeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueProperties.ts b/src/version2/issueProperties.ts deleted file mode 100644 index 322a7ec9ef..0000000000 --- a/src/version2/issueProperties.ts +++ /dev/null @@ -1,511 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueProperties { - constructor(private client: Client) {} - - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( - parameters: Parameters.BulkSetIssuesProperties | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: never, - ): Promise; - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/properties', - method: 'POST', - data: { - entitiesIds: parameters?.entitiesIds, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * 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. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( - parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * 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. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: never, - ): Promise; - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/properties/multi', - method: 'POST', - data: { - issues: parameters?.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * 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 - * `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:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback: Callback, - ): Promise; - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * 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 - * `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:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, - method: 'PUT', - data: { - value: parameters.value, - expression: parameters.expression, - filter: parameters.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: never, - ): Promise; - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/properties/${parameters.propertyKey}`, - method: 'DELETE', - data: { - entityIds: parameters.entityIds, - currentValue: parameters.currentValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Property details are only returned 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 getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Property details are only returned 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 getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback?: never, - ): Promise; - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of an issue's property. - * - * 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 - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an issue's property. - * - * 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 - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: never, - ): Promise; - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; - async setIssueProperty( - parameters: Parameters.SetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; - async deleteIssueProperty( - parameters: Parameters.DeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueRemoteLinks.mts b/src/version2/issueRemoteLinks.mts new file mode 100644 index 0000000000..3f7071480a --- /dev/null +++ b/src/version2/issueRemoteLinks.mts @@ -0,0 +1,336 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueRemoteLinks { + constructor(private client: Client) {} + + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks | string, + callback: Callback, + ): Promise; + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks | string, + callback?: never, + ): Promise; + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, + method: 'GET', + params: { + globalId: typeof parameters !== 'string' && parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: never, + ): Promise; + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'POST', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, + callback: Callback, + ): Promise; + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, + method: 'DELETE', + params: { + globalId: typeof parameters !== 'string' && parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: never, + ): Promise; + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; + async updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'PUT', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueRemoteLinks.ts b/src/version2/issueRemoteLinks.ts deleted file mode 100644 index 12943c64cd..0000000000 --- a/src/version2/issueRemoteLinks.ts +++ /dev/null @@ -1,336 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueRemoteLinks { - constructor(private client: Client) {} - - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback: Callback, - ): Promise; - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback?: never, - ): Promise; - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, - method: 'GET', - params: { - globalId: typeof parameters !== 'string' && parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: never, - ): Promise; - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'POST', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback: Callback, - ): Promise; - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/remotelink`, - method: 'DELETE', - params: { - globalId: typeof parameters !== 'string' && parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: never, - ): Promise; - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'PUT', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueResolutions.mts b/src/version2/issueResolutions.mts new file mode 100644 index 0000000000..23858540ce --- /dev/null +++ b/src/version2/issueResolutions.mts @@ -0,0 +1,224 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueResolutions { + constructor(private client: Client) {} + + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback: Callback, + ): Promise; + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback?: never, + ): Promise; + async createResolution( + parameters: Parameters.CreateResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback: Callback, + ): Promise; + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution/default', + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution/move', + method: 'PUT', + data: { + ids: parameters.ids, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters: Parameters.SearchResolutions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: never, + ): Promise; + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; + async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/resolution/${parameters.id}`, + method: 'PUT', + data: { + ...parameters, + name: parameters.name, + description: parameters.description, + id: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue resolution. + * + * 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 deleteResolution( + parameters: Parameters.DeleteResolution, + callback: Callback, + ): Promise; + /** + * Deletes an issue resolution. + * + * 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 deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: never, + ): Promise; + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/resolution/${parameters.id}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueResolutions.ts b/src/version2/issueResolutions.ts deleted file mode 100644 index 10922ceae9..0000000000 --- a/src/version2/issueResolutions.ts +++ /dev/null @@ -1,224 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueResolutions { - constructor(private client: Client) {} - - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback: Callback, - ): Promise; - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback?: never, - ): Promise; - async createResolution( - parameters: Parameters.CreateResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback: Callback, - ): Promise; - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution/default', - method: 'PUT', - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution/move', - method: 'PUT', - data: { - ids: parameters.ids, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters: Parameters.SearchResolutions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: never, - ): Promise; - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/resolution/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; - async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/resolution/${parameters.id}`, - method: 'PUT', - data: { - ...parameters, - name: parameters.name, - description: parameters.description, - id: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue resolution. - * - * 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 deleteResolution( - parameters: Parameters.DeleteResolution, - callback: Callback, - ): Promise; - /** - * Deletes an issue resolution. - * - * 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 deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: never, - ): Promise; - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/resolution/${parameters.id}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueSearch.mts b/src/version2/issueSearch.mts new file mode 100644 index 0000000000..b3ecbd444e --- /dev/null +++ b/src/version2/issueSearch.mts @@ -0,0 +1,234 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSearch { + constructor(private client: Client) {} + + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters: Parameters.GetIssuePickerResource | undefined, + callback: Callback, + ): Promise; + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: never, + ): Promise; + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/picker', + method: 'GET', + params: { + query: parameters?.query, + currentJQL: parameters?.currentJQL, + currentIssueKey: parameters?.currentIssueKey, + currentProjectId: parameters?.currentProjectId, + showSubTasks: parameters?.showSubTasks, + showSubTaskParent: parameters?.showSubTaskParent, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries 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 matchIssues( + parameters: Parameters.MatchIssues | undefined, + callback: Callback, + ): Promise; + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries 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 matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * 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. + * + * 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 searchForIssuesUsingJql( + parameters: Parameters.SearchForIssuesUsingJql | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * 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. + * + * 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 searchForIssuesUsingJql( + parameters?: Parameters.SearchForIssuesUsingJql, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-2-search-get) 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/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 searchForIssuesUsingJqlPost( + parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-2-search-get) 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/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 searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search', + method: 'POST', + data: { + jql: parameters?.jql, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fields: parameters?.fields, + validateQuery: parameters?.validateQuery, + expand: parameters?.expand, + properties: parameters?.properties, + fieldsByKeys: parameters?.fieldsByKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts deleted file mode 100644 index 0d6414ec3c..0000000000 --- a/src/version2/issueSearch.ts +++ /dev/null @@ -1,234 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueSearch { - constructor(private client: Client) {} - - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters: Parameters.GetIssuePickerResource | undefined, - callback: Callback, - ): Promise; - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: never, - ): Promise; - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/picker', - method: 'GET', - params: { - query: parameters?.query, - currentJQL: parameters?.currentJQL, - currentIssueKey: parameters?.currentIssueKey, - currentProjectId: parameters?.currentProjectId, - showSubTasks: parameters?.showSubTasks, - showSubTaskParent: parameters?.showSubTaskParent, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries 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 matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries 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 matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * 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. - * - * 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 searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * 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. - * - * 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 searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-2-search-get) 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/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 searchForIssuesUsingJqlPost( - parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-2-search-get) 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/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 searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/search', - method: 'POST', - data: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueSecurityLevel.mts b/src/version2/issueSecurityLevel.mts new file mode 100644 index 0000000000..a4a00d91ca --- /dev/null +++ b/src/version2/issueSecurityLevel.mts @@ -0,0 +1,95 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecurityLevel { + constructor(private client: Client) {} + + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects 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). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers | string, + callback: Callback, + ): Promise; + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects 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). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers | string, + callback?: never, + ): Promise; + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers | string, + callback?: Callback, + ): Promise { + const issueSecuritySchemeId = typeof parameters === 'string' ? parameters : parameters.issueSecuritySchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${issueSecuritySchemeId}/members`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + issueSecurityLevelId: typeof parameters !== 'string' && parameters.issueSecurityLevelId, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel | string, + callback: Callback, + ): Promise; + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel | string, + callback?: never, + ): Promise; + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/securitylevel/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueSecurityLevel.ts b/src/version2/issueSecurityLevel.ts deleted file mode 100644 index 5a665fbd60..0000000000 --- a/src/version2/issueSecurityLevel.ts +++ /dev/null @@ -1,95 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueSecurityLevel { - constructor(private client: Client) {} - - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects 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). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback: Callback, - ): Promise; - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects 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). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback?: never, - ): Promise; - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers | string, - callback?: Callback, - ): Promise { - const issueSecuritySchemeId = typeof parameters === 'string' ? parameters : parameters.issueSecuritySchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${issueSecuritySchemeId}/members`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - issueSecurityLevelId: typeof parameters !== 'string' && parameters.issueSecurityLevelId, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback: Callback, - ): Promise; - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-2-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback?: never, - ): Promise; - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/securitylevel/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueSecuritySchemes.mts b/src/version2/issueSecuritySchemes.mts new file mode 100644 index 0000000000..51af4394b9 --- /dev/null +++ b/src/version2/issueSecuritySchemes.mts @@ -0,0 +1,605 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '@/clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecuritySchemes { + constructor(private client: Client) {} + + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback: Callback): Promise; + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback?: never): Promise; + async getIssueSecuritySchemes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: never, + ): Promise; + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes', + method: 'POST', + data: { + description: parameters.description, + levels: parameters.levels, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters: Parameters.GetSecurityLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: never, + ): Promise; + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/level', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: paramSerializer('id', parameters?.id), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels( + parameters: Parameters.SetDefaultLevels | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; + async setDefaultLevels( + parameters?: Parameters.SetDefaultLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/level/default', + method: 'PUT', + data: { + defaultValues: parameters?.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters: Parameters.GetSecurityLevelMembers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: never, + ): Promise; + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/level/member', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: paramSerializer('id', parameters?.id), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + levelId: paramSerializer('levelId', parameters?.levelId), + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: never, + ): Promise; + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueSecuritySchemeId: parameters?.issueSecuritySchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * 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 associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback: Callback, + ): Promise; + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * 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 associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: never, + ): Promise; + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/project', + method: 'PUT', + data: { + oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, + projectId: parameters.projectId, + schemeId: parameters.schemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + * + * Only issue security schemes in the context of classic projects 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). + */ + async searchSecuritySchemes( + parameters: Parameters.SearchSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + * + * Only issue security schemes in the context of classic projects 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). + */ + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: never, + ): Promise; + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuesecurityschemes/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: paramSerializer('id', parameters?.id), + projectId: paramSerializer('projectId', parameters?.projectId), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme | string, + callback: Callback, + ): Promise; + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme | string, + callback?: never, + ): Promise; + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security 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 updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Updates the issue security 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 updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: never, + ): Promise; + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security 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 deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue security 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 deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; + async deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level`, + method: 'PUT', + data: { + levels: parameters.levels, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; + async updateSecurityLevel( + parameters: Parameters.UpdateSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security level. + * + * 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 removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; + /** + * Deletes an issue security level. + * + * 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 removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; + async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback: Callback, + ): Promise; + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, + method: 'PUT', + data: { + members: parameters.members, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback: Callback, + ): Promise; + /** + * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: never, + ): Promise; + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueSecuritySchemes.ts b/src/version2/issueSecuritySchemes.ts deleted file mode 100644 index 60c089ea24..0000000000 --- a/src/version2/issueSecuritySchemes.ts +++ /dev/null @@ -1,605 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class IssueSecuritySchemes { - constructor(private client: Client) {} - - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback: Callback): Promise; - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback?: never): Promise; - async getIssueSecuritySchemes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: never, - ): Promise; - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes', - method: 'POST', - data: { - description: parameters.description, - levels: parameters.levels, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters: Parameters.GetSecurityLevels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: never, - ): Promise; - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/level', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels( - parameters: Parameters.SetDefaultLevels | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; - async setDefaultLevels( - parameters?: Parameters.SetDefaultLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/level/default', - method: 'PUT', - data: { - defaultValues: parameters?.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters: Parameters.GetSecurityLevelMembers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: never, - ): Promise; - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/level/member', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - schemeId: paramSerializer('schemeId', parameters?.schemeId), - levelId: paramSerializer('levelId', parameters?.levelId), - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: never, - ): Promise; - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueSecuritySchemeId: parameters?.issueSecuritySchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * 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 associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback: Callback, - ): Promise; - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * 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 associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: never, - ): Promise; - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/project', - method: 'PUT', - data: { - oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, - projectId: parameters.projectId, - schemeId: parameters.schemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - * - * Only issue security schemes in the context of classic projects 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). - */ - async searchSecuritySchemes( - parameters: Parameters.SearchSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - * - * Only issue security schemes in the context of classic projects 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). - */ - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: never, - ): Promise; - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuesecurityschemes/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: paramSerializer('id', parameters?.id), - projectId: paramSerializer('projectId', parameters?.projectId), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security 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 updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Updates the issue security 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 updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: never, - ): Promise; - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security 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 deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue security 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 deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level`, - method: 'PUT', - data: { - levels: parameters.levels, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; - async updateSecurityLevel( - parameters: Parameters.UpdateSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security level. - * - * 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 removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; - /** - * Deletes an issue security level. - * - * 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 removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; - async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, - method: 'PUT', - data: { - members: parameters.members, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback: Callback, - ): Promise; - /** - * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: never, - ): Promise; - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypeProperties.mts b/src/version2/issueTypeProperties.mts new file mode 100644 index 0000000000..d3cfa102ae --- /dev/null +++ b/src/version2/issueTypeProperties.mts @@ -0,0 +1,176 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeProperties { + constructor(private client: Client) {} + + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys | string, + callback?: never, + ): Promise; + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys | string, + callback?: Callback, + ): Promise { + const issueTypeId = typeof parameters === 'string' ? parameters : parameters.issueTypeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${issueTypeId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: never, + ): Promise; + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypeProperties.ts b/src/version2/issueTypeProperties.ts deleted file mode 100644 index cb3dd26eb3..0000000000 --- a/src/version2/issueTypeProperties.ts +++ /dev/null @@ -1,176 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypeProperties { - constructor(private client: Client) {} - - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback?: never, - ): Promise; - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys | string, - callback?: Callback, - ): Promise { - const issueTypeId = typeof parameters === 'string' ? parameters : parameters.issueTypeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${issueTypeId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: never, - ): Promise; - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypeSchemes.mts b/src/version2/issueTypeSchemes.mts new file mode 100644 index 0000000000..6650604d2b --- /dev/null +++ b/src/version2/issueTypeSchemes.mts @@ -0,0 +1,437 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects 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). + */ + async getAllIssueTypeSchemes( + parameters: Parameters.GetAllIssueTypeSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects 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). + */ + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: never, + ): Promise; + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + queryString: parameters?.queryString, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type 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 createIssueTypeScheme( + parameters: Parameters.CreateIssueTypeScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type 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 createIssueTypeScheme( + parameters?: Parameters.CreateIssueTypeScheme, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects 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). + */ + async getIssueTypeSchemesMapping( + parameters: Parameters.GetIssueTypeSchemesMapping | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects 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). + */ + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: never, + ): Promise; + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeSchemeId: parameters?.issueTypeSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects 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). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects 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). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: never, + ): Promise; + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters?: Parameters.AssignIssueTypeSchemeToProject, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type 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 updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type 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 updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; + async updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultIssueTypeId: parameters.defaultIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme | string, + callback?: never, + ): Promise; + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme | string, + callback?: Callback, + ): Promise { + const issueTypeSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${issueTypeSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: never, + ): Promise; + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: never, + ): Promise; + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: never, + ): Promise; + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypeSchemes.ts b/src/version2/issueTypeSchemes.ts deleted file mode 100644 index 1f9e7cfe95..0000000000 --- a/src/version2/issueTypeSchemes.ts +++ /dev/null @@ -1,437 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypeSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects 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). - */ - async getAllIssueTypeSchemes( - parameters: Parameters.GetAllIssueTypeSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects 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). - */ - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: never, - ): Promise; - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - queryString: parameters?.queryString, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type 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 createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type 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 createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects 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). - */ - async getIssueTypeSchemesMapping( - parameters: Parameters.GetIssueTypeSchemesMapping | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects 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). - */ - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: never, - ): Promise; - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeSchemeId: parameters?.issueTypeSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects 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). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects 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). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: never, - ): Promise; - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type 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 updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type 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 updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultIssueTypeId: parameters.defaultIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback?: never, - ): Promise; - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme | string, - callback?: Callback, - ): Promise { - const issueTypeSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${issueTypeSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: never, - ): Promise; - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: never, - ): Promise; - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: never, - ): Promise; - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypeScreenSchemes.mts b/src/version2/issueTypeScreenSchemes.mts new file mode 100644 index 0000000000..76fd27b999 --- /dev/null +++ b/src/version2/issueTypeScreenSchemes.mts @@ -0,0 +1,440 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemes( + parameters: Parameters.GetIssueTypeScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type screen 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 createIssueTypeScreenScheme( + parameters: Parameters.CreateIssueTypeScreenScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type screen 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 createIssueTypeScreenScheme( + parameters?: Parameters.CreateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeMappings( + parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: never, + ): Promise; + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetypescreenscheme/project', + method: 'PUT', + data: { + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type screen 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 updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type screen 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 updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme | string, + callback?: never, + ): Promise; + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme | string, + callback?: Callback, + ): Promise { + const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: never, + ): Promise; + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, + method: 'PUT', + data: { + issueTypeMappings: parameters.issueTypeMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: never, + ): Promise; + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, + method: 'PUT', + data: { + screenSchemeId: parameters.screenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: never, + ): Promise; + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme 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). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme 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). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, + callback?: never, + ): Promise; + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, + callback?: Callback, + ): Promise { + const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}/project`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + query: typeof parameters !== 'string' && parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypeScreenSchemes.ts b/src/version2/issueTypeScreenSchemes.ts deleted file mode 100644 index 34dacadc5f..0000000000 --- a/src/version2/issueTypeScreenSchemes.ts +++ /dev/null @@ -1,440 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypeScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemes( - parameters: Parameters.GetIssueTypeScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type screen 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 createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type screen 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 createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeMappings( - parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetypescreenscheme/project', - method: 'PUT', - data: { - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type screen 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 updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type screen 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 updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback?: never, - ): Promise; - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme | string, - callback?: Callback, - ): Promise { - const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, - method: 'PUT', - data: { - issueTypeMappings: parameters.issueTypeMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: never, - ): Promise; - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, - method: 'PUT', - data: { - screenSchemeId: parameters.screenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: never, - ): Promise; - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme 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). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme 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). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback?: never, - ): Promise; - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme | string, - callback?: Callback, - ): Promise { - const issueTypeScreenSchemeId = typeof parameters === 'string' ? parameters : parameters.issueTypeScreenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/issuetypescreenscheme/${issueTypeScreenSchemeId}/project`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - query: typeof parameters !== 'string' && parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueTypes.mts b/src/version2/issueTypes.mts new file mode 100644 index 0000000000..c8b9e12fbe --- /dev/null +++ b/src/version2/issueTypes.mts @@ -0,0 +1,351 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypes { + constructor(private client: Client) {} + + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback: Callback): Promise; + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback?: never): Promise; + async getIssueAllTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetype', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type and adds it to the default issue type 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 createIssueType( + parameters: Parameters.CreateIssueType | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type and adds it to the default issue type 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 createIssueType( + parameters?: Parameters.CreateIssueType, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns issue types for a project. + * + * 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) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback: Callback, + ): Promise; + /** + * Returns issue types for a project. + * + * 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) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: never, + ): Promise; + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issuetype/project', + method: 'GET', + params: { + projectId: parameters.projectId, + level: parameters.level, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue type. + * + * 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) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType( + parameters: Parameters.GetIssueType | string, + callback: Callback, + ): Promise; + /** + * Returns an issue type. + * + * 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) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType( + parameters: Parameters.GetIssueType | string, + callback?: never, + ): Promise; + async getIssueType( + parameters: Parameters.GetIssueType | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback: Callback, + ): Promise; + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: never, + ): Promise; + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + avatarId: parameters.avatarId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType( + parameters: Parameters.DeleteIssueType | string, + callback: Callback, + ): Promise; + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType(parameters: Parameters.DeleteIssueType | string, callback?: never): Promise; + async deleteIssueType( + parameters: Parameters.DeleteIssueType | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${id}`, + method: 'DELETE', + params: { + alternativeIssueTypeId: typeof parameters !== 'string' && parameters.alternativeIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes | string, + callback: Callback, + ): Promise; + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes | string, + callback?: never, + ): Promise; + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${id}/alternatives`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * 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-2-issuetype-id-put) to set it as the issue type'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 createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback: Callback, + ): Promise; + /** + * 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. + * + * 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-2-issuetype-id-put) to set it as the issue type'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 createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: never, + ): Promise; + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts deleted file mode 100644 index 84721d580e..0000000000 --- a/src/version2/issueTypes.ts +++ /dev/null @@ -1,351 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypes { - constructor(private client: Client) {} - - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback: Callback): Promise; - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback?: never): Promise; - async getIssueAllTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetype', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type and adds it to the default issue type 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 createIssueType( - parameters: Parameters.CreateIssueType | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type and adds it to the default issue type 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 createIssueType( - parameters?: Parameters.CreateIssueType, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns issue types for a project. - * - * 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) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback: Callback, - ): Promise; - /** - * Returns issue types for a project. - * - * 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) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: never, - ): Promise; - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issuetype/project', - method: 'GET', - params: { - projectId: parameters.projectId, - level: parameters.level, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue type. - * - * 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) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback: Callback, - ): Promise; - /** - * Returns an issue type. - * - * 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) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback?: never, - ): Promise; - async getIssueType( - parameters: Parameters.GetIssueType | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback: Callback, - ): Promise; - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: never, - ): Promise; - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - avatarId: parameters.avatarId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType( - parameters: Parameters.DeleteIssueType | string, - callback: Callback, - ): Promise; - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-2-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType | string, callback?: never): Promise; - async deleteIssueType( - parameters: Parameters.DeleteIssueType | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}`, - method: 'DELETE', - params: { - alternativeIssueTypeId: typeof parameters !== 'string' && parameters.alternativeIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback: Callback, - ): Promise; - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback?: never, - ): Promise; - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${id}/alternatives`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * 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-2-issuetype-id-put) to set it as the issue type'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 createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback: Callback, - ): Promise; - /** - * 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. - * - * 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-2-issuetype-id-put) to set it as the issue type'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 createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: never, - ): Promise; - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueVotes.mts b/src/version2/issueVotes.mts new file mode 100644 index 0000000000..e4882b4219 --- /dev/null +++ b/src/version2/issueVotes.mts @@ -0,0 +1,148 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueVotes { + constructor(private client: Client) {} + + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes | string, callback: Callback): Promise; + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes | string, callback?: never): Promise; + async getVotes( + parameters: Parameters.GetVotes | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/votes`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 addVote(parameters: Parameters.AddVote | string, callback: Callback): Promise; + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 addVote(parameters: Parameters.AddVote | string, callback?: never): Promise; + async addVote(parameters: Parameters.AddVote | string, callback?: Callback): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/votes`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 removeVote(parameters: Parameters.RemoveVote | string, callback: Callback): Promise; + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 removeVote(parameters: Parameters.RemoveVote | string, callback?: never): Promise; + async removeVote(parameters: Parameters.RemoveVote | string, callback?: Callback): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/votes`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueVotes.ts b/src/version2/issueVotes.ts deleted file mode 100644 index 913436f674..0000000000 --- a/src/version2/issueVotes.ts +++ /dev/null @@ -1,148 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueVotes { - constructor(private client: Client) {} - - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes | string, callback: Callback): Promise; - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes | string, callback?: never): Promise; - async getVotes( - parameters: Parameters.GetVotes | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 addVote(parameters: Parameters.AddVote | string, callback: Callback): Promise; - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 addVote(parameters: Parameters.AddVote | string, callback?: never): Promise; - async addVote(parameters: Parameters.AddVote | string, callback?: Callback): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 removeVote(parameters: Parameters.RemoveVote | string, callback: Callback): Promise; - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 removeVote(parameters: Parameters.RemoveVote | string, callback?: never): Promise; - async removeVote(parameters: Parameters.RemoveVote | string, callback?: Callback): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/votes`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueWatchers.mts b/src/version2/issueWatchers.mts new file mode 100644 index 0000000000..8d862f2ed7 --- /dev/null +++ b/src/version2/issueWatchers.mts @@ -0,0 +1,215 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWatchers { + constructor(private client: Client) {} + + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 getIsWatchingIssueBulk( + parameters: Parameters.GetIsWatchingIssueBulk | undefined, + callback: Callback, + ): Promise; + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: never, + ): Promise; + async getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/watching', + method: 'POST', + data: { + issueIds: parameters?.issueIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers | string, + callback: Callback, + ): Promise; + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers | string, + callback?: never, + ): Promise; + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/watchers`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; + async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.accountId, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, + method: 'DELETE', + params: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueWatchers.ts b/src/version2/issueWatchers.ts deleted file mode 100644 index 43144b8aba..0000000000 --- a/src/version2/issueWatchers.ts +++ /dev/null @@ -1,215 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueWatchers { - constructor(private client: Client) {} - - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 getIsWatchingIssueBulk( - parameters: Parameters.GetIsWatchingIssueBulk | undefined, - callback: Callback, - ): Promise; - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: never, - ): Promise; - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/watching', - method: 'POST', - data: { - issueIds: parameters?.issueIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback: Callback, - ): Promise; - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback?: never, - ): Promise; - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/watchers`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; - async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.accountId, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/watchers`, - method: 'DELETE', - params: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueWorklogProperties.mts b/src/version2/issueWorklogProperties.mts new file mode 100644 index 0000000000..043b1b430c --- /dev/null +++ b/src/version2/issueWorklogProperties.mts @@ -0,0 +1,197 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWorklogProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a worklog. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a worklog. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: never, + ): Promise; + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: never, + ): Promise; + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback: Callback, + ): Promise; + /** + * Deletes a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueWorklogProperties.ts b/src/version2/issueWorklogProperties.ts deleted file mode 100644 index 8cac5e88da..0000000000 --- a/src/version2/issueWorklogProperties.ts +++ /dev/null @@ -1,197 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueWorklogProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a worklog. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a worklog. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: never, - ): Promise; - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: never, - ): Promise; - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback: Callback, - ): Promise; - /** - * Deletes a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issueWorklogs.mts b/src/version2/issueWorklogs.mts new file mode 100644 index 0000000000..6b8d24eafb --- /dev/null +++ b/src/version2/issueWorklogs.mts @@ -0,0 +1,456 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +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. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Workloads are only returned 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog | string, + 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. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Workloads are only returned 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog | string, + callback?: never, + ): Promise; + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a worklog to an issue. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; + /** + * Adds a worklog to an issue. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; + async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, + method: 'POST', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + reduceBy: parameters.reduceBy, + expand: parameters.expand, + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a worklog. + * + * 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). + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; + /** + * Returns a worklog. + * + * 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). + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; + async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a worklog. + * + * 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). + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; + /** + * Updates a worklog. + * + * 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). + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; + async updateWorklog( + parameters: Parameters.UpdateWorklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + comment: parameters.comment, + visibility: parameters.visibility, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog from an issue. + * + * 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). + * + * 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 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. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; + /** + * Deletes a worklog from an issue. + * + * 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). + * + * 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 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. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'DELETE', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + increaseBy: parameters.increaseBy, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/worklog/deleted', + method: 'GET', + params: { + since: parameters?.since, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters: Parameters.GetWorklogsForIds | undefined, + callback: Callback, + ): Promise; + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: never, + ): Promise; + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/worklog/list', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ids: parameters?.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/worklog/updated', + method: 'GET', + params: { + since: parameters?.since, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts deleted file mode 100644 index 31482bb4df..0000000000 --- a/src/version2/issueWorklogs.ts +++ /dev/null @@ -1,456 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -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. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Workloads are only returned 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - 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. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Workloads are only returned 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback?: never, - ): Promise; - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a worklog to an issue. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; - /** - * Adds a worklog to an issue. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; - async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, - method: 'POST', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - reduceBy: parameters.reduceBy, - expand: parameters.expand, - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a worklog. - * - * 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). - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; - /** - * Returns a worklog. - * - * 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). - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; - async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a worklog. - * - * 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). - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; - /** - * Updates a worklog. - * - * 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). - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; - async updateWorklog( - parameters: Parameters.UpdateWorklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - comment: parameters.comment, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog from an issue. - * - * 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). - * - * 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 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. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; - /** - * Deletes a worklog from an issue. - * - * 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). - * - * 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 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. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'DELETE', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - increaseBy: parameters.increaseBy, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/worklog/deleted', - method: 'GET', - params: { - since: parameters?.since, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters: Parameters.GetWorklogsForIds | undefined, - callback: Callback, - ): Promise; - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: never, - ): Promise; - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/worklog/list', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ids: parameters?.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/worklog/updated', - method: 'GET', - params: { - since: parameters?.since, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/issues.mts b/src/version2/issues.mts new file mode 100644 index 0000000000..05e833208b --- /dev/null +++ b/src/version2/issues.mts @@ -0,0 +1,1062 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Issues { + constructor(private client: Client) {} + + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback: Callback): Promise; + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback?: never): Promise; + async getEvents(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/events', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; + async createIssue( + parameters: Parameters.CreateIssue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue', + method: 'POST', + params: { + updateHistory: parameters.updateHistory, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **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. + */ + 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) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **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. + */ + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/archive', + method: 'POST', + data: { + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/archive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues( + parameters: Parameters.CreateIssues | undefined, + callback: Callback, + ): Promise; + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; + async createIssues( + parameters?: Parameters.CreateIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/bulk', + method: 'POST', + data: { + issueUpdates: parameters?.issueUpdates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * 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). + * + * 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, + callback?: never, + ): Promise; + async getCreateIssueMeta( + parameters?: Parameters.GetCreateIssueMeta, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/createmeta', + method: 'GET', + params: { + projectIds: parameters?.projectIds, + projectKeys: parameters?.projectKeys, + issuetypeIds: parameters?.issuetypeIds, + issuetypeNames: parameters?.issuetypeNames, + expand: parameters?.expand, + }, + }; + + 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. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback: Callback, + ): Promise; + /** + * 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. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: never, + ): Promise; + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/unarchive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the details for an issue. + * + * The 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 issue key returned in the response is the key of the issue found. + * + * 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 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 getIssue(parameters: Parameters.GetIssue | string, callback: Callback): Promise; + /** + * Returns the details for an issue. + * + * The 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 issue key returned in the response is the key of the issue found. + * + * 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 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 getIssue(parameters: Parameters.GetIssue | string, callback?: never): Promise; + async getIssue( + parameters: Parameters.GetIssue | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * 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). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * 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). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; + async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + returnIssue: parameters.returnIssue, + expand: parameters.expand, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue | string, callback: Callback): Promise; + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: never): Promise; + async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: Callback): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}`, + method: 'DELETE', + params: { + deleteSubtasks: typeof parameters !== 'string' && parameters.deleteSubtasks, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; + async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/assignee`, + method: 'PUT', + data: { + accountId: parameters.accountId, + accountType: parameters.accountType, + active: parameters.active, + applicationRoles: parameters.applicationRoles, + avatarUrls: parameters.avatarUrls, + displayName: parameters.displayName, + emailAddress: parameters.emailAddress, + expand: parameters.expand, + groups: parameters.groups, + key: parameters.key, + locale: parameters.locale, + name: parameters.name, + self: parameters.self, + timeZone: parameters.timeZone, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * 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 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 getChangeLogs( + parameters: Parameters.GetChangeLogs | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * 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 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 getChangeLogs( + parameters: Parameters.GetChangeLogs | string, + callback?: never, + ): Promise; + async getChangeLogs( + parameters: Parameters.GetChangeLogs | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * 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 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 getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback: Callback, + ): Promise; + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * 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 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 getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: never, + ): Promise; + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog/list`, + method: 'POST', + data: { + changelogIds: parameters.changelogIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * 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 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. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta | string, + callback: Callback, + ): Promise; + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * 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 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. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta | string, + callback?: never, + ): Promise; + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, + method: 'GET', + params: { + overrideScreenSecurity: typeof parameters !== 'string' && parameters.overrideScreenSecurity, + overrideEditableFlag: typeof parameters !== 'string' && parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[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 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 notify(parameters: Parameters.Notify, callback: Callback): Promise; + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[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 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 notify(parameters: Parameters.Notify, callback?: never): Promise; + async notify(parameters: Parameters.Notify, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/notify`, + method: 'POST', + data: { + htmlBody: parameters.htmlBody, + restrict: parameters.restrict, + subject: parameters.subject, + textBody: parameters.textBody, + to: parameters.to, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or + * transition is returned only when 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. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions( + parameters: Parameters.GetTransitions | string, + callback: Callback, + ): Promise; + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or + * transition is returned only when 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. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions( + parameters: Parameters.GetTransitions | string, + callback?: never, + ): Promise; + async getTransitions( + parameters: Parameters.GetTransitions | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; + async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, + method: 'POST', + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues, + callback?: never, + ): Promise; + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issues/archive/export', + method: 'PUT', + data: { + archivedBy: parameters.archivedBy, + archivedDateRange: parameters.archivedDateRange, + issueTypes: parameters.issueTypes, + projects: parameters.projects, + reporters: parameters.reporters, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/issues.ts b/src/version2/issues.ts deleted file mode 100644 index 2c00ffa2c5..0000000000 --- a/src/version2/issues.ts +++ /dev/null @@ -1,1062 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Issues { - constructor(private client: Client) {} - - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback: Callback): Promise; - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback?: never): Promise; - async getEvents(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/events', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; - async createIssue( - parameters: Parameters.CreateIssue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue', - method: 'POST', - params: { - updateHistory: parameters.updateHistory, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **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. - */ - 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) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **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. - */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/archive', - method: 'POST', - data: { - jql: parameters.jql, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/archive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues( - parameters: Parameters.CreateIssues | undefined, - callback: Callback, - ): Promise; - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-2-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-2-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; - async createIssues( - parameters?: Parameters.CreateIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/bulk', - method: 'POST', - data: { - issueUpdates: parameters?.issueUpdates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * 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). - * - * 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, - callback?: never, - ): Promise; - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/createmeta', - method: 'GET', - params: { - projectIds: parameters?.projectIds, - projectKeys: parameters?.projectKeys, - issuetypeIds: parameters?.issuetypeIds, - issuetypeNames: parameters?.issuetypeNames, - expand: parameters?.expand, - }, - }; - - 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. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback: Callback, - ): Promise; - /** - * 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. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: never, - ): Promise; - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issue/unarchive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the details for an issue. - * - * The 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 issue key returned in the response is the key of the issue found. - * - * 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 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 getIssue(parameters: Parameters.GetIssue | string, callback: Callback): Promise; - /** - * Returns the details for an issue. - * - * The 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 issue key returned in the response is the key of the issue found. - * - * 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 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 getIssue(parameters: Parameters.GetIssue | string, callback?: never): Promise; - async getIssue( - parameters: Parameters.GetIssue | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * 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). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * 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). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; - async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - returnIssue: parameters.returnIssue, - expand: parameters.expand, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue | string, callback: Callback): Promise; - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: never): Promise; - async deleteIssue(parameters: Parameters.DeleteIssue | string, callback?: Callback): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}`, - method: 'DELETE', - params: { - deleteSubtasks: typeof parameters !== 'string' && parameters.deleteSubtasks, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; - async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/assignee`, - method: 'PUT', - data: { - accountId: parameters.accountId, - accountType: parameters.accountType, - active: parameters.active, - applicationRoles: parameters.applicationRoles, - avatarUrls: parameters.avatarUrls, - displayName: parameters.displayName, - emailAddress: parameters.emailAddress, - expand: parameters.expand, - groups: parameters.groups, - key: parameters.key, - locale: parameters.locale, - name: parameters.name, - self: parameters.self, - timeZone: parameters.timeZone, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * 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 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 getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * 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 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 getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback?: never, - ): Promise; - async getChangeLogs( - parameters: Parameters.GetChangeLogs | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * 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 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 getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback: Callback, - ): Promise; - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * 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 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 getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: never, - ): Promise; - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/changelog/list`, - method: 'POST', - data: { - changelogIds: parameters.changelogIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * 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 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. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback: Callback, - ): Promise; - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-2-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * 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 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. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback?: never, - ): Promise; - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, - method: 'GET', - params: { - overrideScreenSecurity: typeof parameters !== 'string' && parameters.overrideScreenSecurity, - overrideEditableFlag: typeof parameters !== 'string' && parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[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 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 notify(parameters: Parameters.Notify, callback: Callback): Promise; - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[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 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 notify(parameters: Parameters.Notify, callback?: never): Promise; - async notify(parameters: Parameters.Notify, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/notify`, - method: 'POST', - data: { - htmlBody: parameters.htmlBody, - restrict: parameters.restrict, - subject: parameters.subject, - textBody: parameters.textBody, - to: parameters.to, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or - * transition is returned only when 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. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback: Callback, - ): Promise; - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: A list or - * transition is returned only when 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. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback?: never, - ): Promise; - async getTransitions( - parameters: Parameters.GetTransitions | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-2-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; - async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/issue/${parameters.issueIdOrKey}/transitions`, - method: 'POST', - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback?: never, - ): Promise; - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/issues/archive/export', - method: 'PUT', - data: { - archivedBy: parameters.archivedBy, - archivedDateRange: parameters.archivedDateRange, - issueTypes: parameters.issueTypes, - projects: parameters.projects, - reporters: parameters.reporters, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jQL.ts b/src/version2/jQL.ts deleted file mode 100644 index a5dd54bb97..0000000000 --- a/src/version2/jQL.ts +++ /dev/null @@ -1,312 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JQL { - constructor(private client: Client) {} - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoComplete(callback: Callback): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoComplete(callback?: never): Promise; - async getAutoComplete(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/autocompletedata', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters: Parameters.GetAutoCompletePost | undefined, - callback: Callback, - ): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: never, - ): Promise; - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/autocompletedata', - method: 'POST', - data: { - includeCollapsedFields: parameters?.includeCollapsedFields, - projectIds: parameters?.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, - callback: Callback, - ): Promise; - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: never, - ): Promise; - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/autocompletedata/suggestions', - method: 'GET', - params: { - fieldName: parameters?.fieldName, - fieldValue: parameters?.fieldValue, - predicateName: parameters?.predicateName, - predicateValue: parameters?.predicateValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters: Parameters.ParseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: never, - ): Promise; - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/parse', - method: 'POST', - params: { - validation: parameters?.validation, - }, - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters: Parameters.MigrateQueries | undefined, - callback: Callback, - ): Promise; - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: never, - ): Promise; - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/pdcleaner', - method: 'POST', - data: { - queryStrings: parameters?.queryStrings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * 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). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters: Parameters.SanitiseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * 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). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: never, - ): Promise; - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/sanitize', - method: 'POST', - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jiraExpressions.mts b/src/version2/jiraExpressions.mts new file mode 100644 index 0000000000..b83c2510b8 --- /dev/null +++ b/src/version2/jiraExpressions.mts @@ -0,0 +1,193 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraExpressions { + constructor(private client: Client) {} + + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters: Parameters.AnalyseExpression | undefined, + callback: Callback, + ): Promise; + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: never, + ): Promise; + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/expression/analyse', + method: 'POST', + params: { + check: parameters?.check, + }, + data: { + expressions: parameters?.expressions, + contextVariables: parameters?.contextVariables, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Evaluates a Jira expression and returns its value. + * + * 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. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. 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. + * + * 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 evaluateJiraExpression( + parameters: Parameters.EvaluateJiraExpression | undefined, + callback: Callback, + ): Promise; + /** + * Evaluates a Jira expression and returns its value. + * + * 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. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. 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. + * + * 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 evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: never, + ): Promise; + async evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/expression/eval', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + expression: parameters?.expression, + context: parameters?.context, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts deleted file mode 100644 index 4138ae15ef..0000000000 --- a/src/version2/jiraExpressions.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JiraExpressions { - constructor(private client: Client) {} - - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters: Parameters.AnalyseExpression | undefined, - callback: Callback, - ): Promise; - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: never, - ): Promise; - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/expression/analyse', - method: 'POST', - params: { - check: parameters?.check, - }, - data: { - expressions: parameters?.expressions, - contextVariables: parameters?.contextVariables, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Evaluates a Jira expression and returns its value. - * - * 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. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. 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. - * - * 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 evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, - callback: Callback, - ): Promise; - /** - * Evaluates a Jira expression and returns its value. - * - * 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. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. 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. - * - * 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 evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: never, - ): Promise; - async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/expression/eval', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - expression: parameters?.expression, - context: parameters?.context, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jiraSettings.mts b/src/version2/jiraSettings.mts new file mode 100644 index 0000000000..6862194838 --- /dev/null +++ b/src/version2/jiraSettings.mts @@ -0,0 +1,241 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraSettings { + constructor(private client: Client) {} + + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters: Parameters.GetApplicationProperty | undefined, + callback: Callback, + ): Promise; + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: never, + ): Promise; + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/application-properties', + method: 'GET', + params: { + key: parameters?.key, + permissionLevel: parameters?.permissionLevel, + keyFilter: parameters?.keyFilter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback: Callback): Promise; + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback?: never): Promise; + async getAdvancedSettings(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/application-properties/advanced-settings', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * 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` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback: Callback, + ): Promise; + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * 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` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: never, + ): Promise; + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/application-properties/${parameters.id}`, + method: 'PUT', + data: parameters.body, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback: Callback): Promise; + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback?: never): Promise; + async getConfiguration(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jiraSettings.ts b/src/version2/jiraSettings.ts deleted file mode 100644 index 1ac57eaa79..0000000000 --- a/src/version2/jiraSettings.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JiraSettings { - constructor(private client: Client) {} - - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters: Parameters.GetApplicationProperty | undefined, - callback: Callback, - ): Promise; - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-2-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: never, - ): Promise; - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/application-properties', - method: 'GET', - params: { - key: parameters?.key, - permissionLevel: parameters?.permissionLevel, - keyFilter: parameters?.keyFilter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback: Callback): Promise; - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback?: never): Promise; - async getAdvancedSettings(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/application-properties/advanced-settings', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * 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` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback: Callback, - ): Promise; - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * 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` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: never, - ): Promise; - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/application-properties/${parameters.id}`, - method: 'PUT', - data: parameters.body, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback: Callback): Promise; - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback?: never): Promise; - async getConfiguration(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/jql.mts b/src/version2/jql.mts new file mode 100644 index 0000000000..8d2bd3fd54 --- /dev/null +++ b/src/version2/jql.mts @@ -0,0 +1,312 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JQL { + constructor(private client: Client) {} + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoComplete(callback: Callback): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-2-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoComplete(callback?: never): Promise; + async getAutoComplete(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/autocompletedata', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters: Parameters.GetAutoCompletePost | undefined, + callback: Callback, + ): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: never, + ): Promise; + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/autocompletedata', + method: 'POST', + data: { + includeCollapsedFields: parameters?.includeCollapsedFields, + projectIds: parameters?.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, + callback: Callback, + ): Promise; + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: never, + ): Promise; + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/autocompletedata/suggestions', + method: 'GET', + params: { + fieldName: parameters?.fieldName, + fieldValue: parameters?.fieldValue, + predicateName: parameters?.predicateName, + predicateValue: parameters?.predicateValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters: Parameters.ParseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: never, + ): Promise; + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/parse', + method: 'POST', + params: { + validation: parameters?.validation, + }, + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters: Parameters.MigrateQueries | undefined, + callback: Callback, + ): Promise; + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: never, + ): Promise; + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/pdcleaner', + method: 'POST', + data: { + queryStrings: parameters?.queryStrings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * 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). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters: Parameters.SanitiseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * 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). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: never, + ): Promise; + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/sanitize', + method: 'POST', + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jqlFunctionsApps.mts b/src/version2/jqlFunctionsApps.mts new file mode 100644 index 0000000000..475ebe05d1 --- /dev/null +++ b/src/version2/jqlFunctionsApps.mts @@ -0,0 +1,82 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JqlFunctionsApps { + constructor(private client: Client) {} + + /** + * Returns the list of a function's precomputations 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. + */ + async getPrecomputations( + parameters: Parameters.GetPrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of a function's precomputations 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. + */ + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: never, + ): Promise; + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/function/computation', + method: 'GET', + params: { + functionKey: parameters?.functionKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + filter: parameters?.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations( + parameters: Parameters.UpdatePrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations( + parameters?: Parameters.UpdatePrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/function/computation', + method: 'POST', + data: { + values: parameters?.values, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts deleted file mode 100644 index ac95c558e5..0000000000 --- a/src/version2/jqlFunctionsApps.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JqlFunctionsApps { - constructor(private client: Client) {} - - /** - * Returns the list of a function's precomputations 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. - */ - async getPrecomputations( - parameters: Parameters.GetPrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Returns the list of a function's precomputations 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. - */ - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: never, - ): Promise; - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/function/computation', - method: 'GET', - params: { - functionKey: parameters?.functionKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - filter: parameters?.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; - async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/jql/function/computation', - method: 'POST', - data: { - values: parameters?.values, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/labels.mts b/src/version2/labels.mts new file mode 100644 index 0000000000..df17f58556 --- /dev/null +++ b/src/version2/labels.mts @@ -0,0 +1,38 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Labels { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * labels. + */ + async getAllLabels( + parameters: Parameters.GetAllLabels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * labels. + */ + async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; + async getAllLabels( + parameters?: Parameters.GetAllLabels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/label', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/labels.ts b/src/version2/labels.ts deleted file mode 100644 index 9a8bc62248..0000000000 --- a/src/version2/labels.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Labels { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * labels. - */ - async getAllLabels( - parameters: Parameters.GetAllLabels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * labels. - */ - async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; - async getAllLabels( - parameters?: Parameters.GetAllLabels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/label', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/licenseMetrics.mts b/src/version2/licenseMetrics.mts new file mode 100644 index 0000000000..6a20bc1752 --- /dev/null +++ b/src/version2/licenseMetrics.mts @@ -0,0 +1,88 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class LicenseMetrics { + constructor(private client: Client) {} + + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLicense(callback: Callback): Promise; + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLicense(callback?: never): Promise; + async getLicense(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/instance/license', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback: Callback): Promise; + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback?: never): Promise; + async getApproximateLicenseCount(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/license/approximateLicenseCount', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback: Callback, + ): Promise; + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: never, + ): Promise; + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/license/approximateLicenseCount/product/${applicationKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/licenseMetrics.ts b/src/version2/licenseMetrics.ts deleted file mode 100644 index bf12582bf8..0000000000 --- a/src/version2/licenseMetrics.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class LicenseMetrics { - constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLicense(callback: Callback): Promise; - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLicense(callback?: never): Promise; - async getLicense(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/instance/license', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback: Callback): Promise; - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback?: never): Promise; - async getApproximateLicenseCount(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/license/approximateLicenseCount', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback: Callback, - ): Promise; - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: never, - ): Promise; - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/license/approximateLicenseCount/product/${applicationKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/models/actorInput.ts b/src/version2/models/actorInput.mts similarity index 100% rename from src/version2/models/actorInput.ts rename to src/version2/models/actorInput.mts diff --git a/src/version2/models/actorsMap.ts b/src/version2/models/actorsMap.mts similarity index 100% rename from src/version2/models/actorsMap.ts rename to src/version2/models/actorsMap.mts diff --git a/src/version2/models/addField.ts b/src/version2/models/addField.mts similarity index 100% rename from src/version2/models/addField.ts rename to src/version2/models/addField.mts diff --git a/src/version2/models/addGroup.ts b/src/version2/models/addGroup.mts similarity index 100% rename from src/version2/models/addGroup.ts rename to src/version2/models/addGroup.mts diff --git a/src/version2/models/addSecuritySchemeLevelsRequest.mts b/src/version2/models/addSecuritySchemeLevelsRequest.mts new file mode 100644 index 0000000000..30f8898c51 --- /dev/null +++ b/src/version2/models/addSecuritySchemeLevelsRequest.mts @@ -0,0 +1,6 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +export interface AddSecuritySchemeLevelsRequest { + /** The list of scheme levels which should be added to the security scheme. */ + levels: SecuritySchemeLevel[]; +} diff --git a/src/version2/models/addSecuritySchemeLevelsRequest.ts b/src/version2/models/addSecuritySchemeLevelsRequest.ts deleted file mode 100644 index df70a5daf2..0000000000 --- a/src/version2/models/addSecuritySchemeLevelsRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SecuritySchemeLevel } from './securitySchemeLevel'; - -export interface AddSecuritySchemeLevelsRequest { - /** The list of scheme levels which should be added to the security scheme. */ - levels: SecuritySchemeLevel[]; -} diff --git a/src/version2/models/announcementBannerConfiguration.ts b/src/version2/models/announcementBannerConfiguration.mts similarity index 100% rename from src/version2/models/announcementBannerConfiguration.ts rename to src/version2/models/announcementBannerConfiguration.mts diff --git a/src/version2/models/announcementBannerConfigurationUpdate.ts b/src/version2/models/announcementBannerConfigurationUpdate.mts similarity index 100% rename from src/version2/models/announcementBannerConfigurationUpdate.ts rename to src/version2/models/announcementBannerConfigurationUpdate.mts diff --git a/src/version2/models/application.ts b/src/version2/models/application.mts similarity index 100% rename from src/version2/models/application.ts rename to src/version2/models/application.mts diff --git a/src/version2/models/applicationProperty.ts b/src/version2/models/applicationProperty.mts similarity index 100% rename from src/version2/models/applicationProperty.ts rename to src/version2/models/applicationProperty.mts diff --git a/src/version2/models/applicationRole.mts b/src/version2/models/applicationRole.mts new file mode 100644 index 0000000000..da65b66b31 --- /dev/null +++ b/src/version2/models/applicationRole.mts @@ -0,0 +1,36 @@ +import type { GroupName } from './groupName.mjs'; + +/** Details of an application role. */ +export interface ApplicationRole { + /** + * The groups that are granted default access for this application role. As a group's name can change, use of + * `defaultGroupsDetails` is recommended to identify a groups. + */ + defaultGroups?: string[]; + /** The groups that are granted default access for this application role. */ + defaultGroupsDetails?: GroupName[]; + /** The groups associated with the application role. */ + groupDetails?: GroupName[]; + /** + * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended + * to identify a groups. + */ + groups?: string[]; + hasUnlimitedSeats?: boolean; + /** The key of the application role. */ + key?: string; + /** The display name of the application role. */ + name?: string; + /** The maximum count of users on your license. */ + numberOfSeats?: number; + /** Indicates if the application role belongs to Jira platform (`jira-core`). */ + platform?: boolean; + /** The count of users remaining on your license. */ + remainingSeats?: number; + /** Determines whether this application role should be selected by default on user creation. */ + selectedByDefault?: boolean; + /** The number of users counting against your license. */ + userCount?: number; + /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ + userCountDescription?: string; +} diff --git a/src/version2/models/applicationRole.ts b/src/version2/models/applicationRole.ts deleted file mode 100644 index 3180a57459..0000000000 --- a/src/version2/models/applicationRole.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { GroupName } from './groupName'; - -/** Details of an application role. */ -export interface ApplicationRole { - /** - * The groups that are granted default access for this application role. As a group's name can change, use of - * `defaultGroupsDetails` is recommended to identify a groups. - */ - defaultGroups?: string[]; - /** The groups that are granted default access for this application role. */ - defaultGroupsDetails?: GroupName[]; - /** The groups associated with the application role. */ - groupDetails?: GroupName[]; - /** - * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended - * to identify a groups. - */ - groups?: string[]; - hasUnlimitedSeats?: boolean; - /** The key of the application role. */ - key?: string; - /** The display name of the application role. */ - name?: string; - /** The maximum count of users on your license. */ - numberOfSeats?: number; - /** Indicates if the application role belongs to Jira platform (`jira-core`). */ - platform?: boolean; - /** The count of users remaining on your license. */ - remainingSeats?: number; - /** Determines whether this application role should be selected by default on user creation. */ - selectedByDefault?: boolean; - /** The number of users counting against your license. */ - userCount?: number; - /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ - userCountDescription?: string; -} diff --git a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts new file mode 100644 index 0000000000..f829c744b7 --- /dev/null +++ b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping.mjs'; + +/** Details of a field configuration to issue type mappings. */ +export interface AssociateFieldConfigurationsWithIssueTypesRequest { + /** Field configuration to issue type mappings. */ + mappings: FieldConfigurationToIssueTypeMapping[]; +} diff --git a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts b/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts deleted file mode 100644 index 61cd83082a..0000000000 --- a/src/version2/models/associateFieldConfigurationsWithIssueTypesRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping'; - -/** Details of a field configuration to issue type mappings. */ -export interface AssociateFieldConfigurationsWithIssueTypesRequest { - /** Field configuration to issue type mappings. */ - mappings: FieldConfigurationToIssueTypeMapping[]; -} diff --git a/src/version2/models/associatedItem.ts b/src/version2/models/associatedItem.mts similarity index 100% rename from src/version2/models/associatedItem.ts rename to src/version2/models/associatedItem.mts diff --git a/src/version2/models/attachment.mts b/src/version2/models/attachment.mts new file mode 100644 index 0000000000..3a2da45f96 --- /dev/null +++ b/src/version2/models/attachment.mts @@ -0,0 +1,22 @@ +import { UserDetails } from './userDetails.mjs'; + +/** Details about an attachment. */ +export interface Attachment { + author?: UserDetails; + /** The content of the attachment. */ + content?: string; + /** The datetime the attachment was created. */ + created?: string; + /** The file name of the attachment. */ + filename?: string; + /** The ID of the attachment. */ + id: string; + /** The MIME type of the attachment. */ + mimeType?: string; + /** The URL of the attachment details response. */ + self?: string; + /** The size of the attachment. */ + size?: number; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; +} diff --git a/src/version2/models/attachment.ts b/src/version2/models/attachment.ts deleted file mode 100644 index ce08248aca..0000000000 --- a/src/version2/models/attachment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** Details about an attachment. */ -export interface Attachment { - author?: UserDetails; - /** The content of the attachment. */ - content?: string; - /** The datetime the attachment was created. */ - created?: string; - /** The file name of the attachment. */ - filename?: string; - /** The ID of the attachment. */ - id: string; - /** The MIME type of the attachment. */ - mimeType?: string; - /** The URL of the attachment details response. */ - self?: string; - /** The size of the attachment. */ - size?: number; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; -} diff --git a/src/version2/models/attachmentArchiveEntry.ts b/src/version2/models/attachmentArchiveEntry.mts similarity index 100% rename from src/version2/models/attachmentArchiveEntry.ts rename to src/version2/models/attachmentArchiveEntry.mts diff --git a/src/version2/models/attachmentArchiveImpl.mts b/src/version2/models/attachmentArchiveImpl.mts new file mode 100644 index 0000000000..05d3d8c9b3 --- /dev/null +++ b/src/version2/models/attachmentArchiveImpl.mts @@ -0,0 +1,8 @@ +import { AttachmentArchiveEntry } from './attachmentArchiveEntry.mjs'; + +export interface AttachmentArchiveImpl { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveEntry[]; + /** The number of items in the archive. */ + totalEntryCount?: number; +} diff --git a/src/version2/models/attachmentArchiveImpl.ts b/src/version2/models/attachmentArchiveImpl.ts deleted file mode 100644 index 9af03cd0f7..0000000000 --- a/src/version2/models/attachmentArchiveImpl.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttachmentArchiveEntry } from './attachmentArchiveEntry'; - -export interface AttachmentArchiveImpl { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveEntry[]; - /** The number of items in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version2/models/attachmentArchiveItemReadable.ts b/src/version2/models/attachmentArchiveItemReadable.mts similarity index 100% rename from src/version2/models/attachmentArchiveItemReadable.ts rename to src/version2/models/attachmentArchiveItemReadable.mts diff --git a/src/version2/models/attachmentArchiveMetadataReadable.mts b/src/version2/models/attachmentArchiveMetadataReadable.mts new file mode 100644 index 0000000000..a29af8ab0f --- /dev/null +++ b/src/version2/models/attachmentArchiveMetadataReadable.mts @@ -0,0 +1,15 @@ +import { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable.mjs'; + +/** Metadata for an archive (for example a zip) and its contents. */ +export interface AttachmentArchiveMetadataReadable { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveItemReadable[]; + /** The ID of the attachment. */ + id?: number; + /** The MIME type of the attachment. */ + mediaType?: string; + /** The name of the archive file. */ + name?: string; + /** The number of items included in the archive. */ + totalEntryCount?: number; +} diff --git a/src/version2/models/attachmentArchiveMetadataReadable.ts b/src/version2/models/attachmentArchiveMetadataReadable.ts deleted file mode 100644 index e38e02a18a..0000000000 --- a/src/version2/models/attachmentArchiveMetadataReadable.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable'; - -/** Metadata for an archive (for example a zip) and its contents. */ -export interface AttachmentArchiveMetadataReadable { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveItemReadable[]; - /** The ID of the attachment. */ - id?: number; - /** The MIME type of the attachment. */ - mediaType?: string; - /** The name of the archive file. */ - name?: string; - /** The number of items included in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version2/models/attachmentMetadata.mts b/src/version2/models/attachmentMetadata.mts new file mode 100644 index 0000000000..2af5c89fd6 --- /dev/null +++ b/src/version2/models/attachmentMetadata.mts @@ -0,0 +1,29 @@ +import { User } from './user.mjs'; + +/** Metadata for an issue attachment. */ +export interface AttachmentMetadata { + /** The ID of the attachment. */ + id?: number; + /** The URL of the attachment metadata details. */ + self?: string; + /** The name of the attachment file. */ + filename?: string; + author?: User; + /** The datetime the attachment was created. */ + created?: string; + /** The size of the attachment. */ + size?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** Additional properties of the attachment. */ + properties?: {}; + /** The URL of the attachment. */ + content?: string; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; + /** + * The file ID of the attachment in the media store. See the [Media + * API](https://developer.atlassian.com/platform/media/) documentation for more details. + */ + mediaApiFileId?: string; +} diff --git a/src/version2/models/attachmentMetadata.ts b/src/version2/models/attachmentMetadata.ts deleted file mode 100644 index 9a252e607f..0000000000 --- a/src/version2/models/attachmentMetadata.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { User } from './user'; - -/** Metadata for an issue attachment. */ -export interface AttachmentMetadata { - /** The ID of the attachment. */ - id?: number; - /** The URL of the attachment metadata details. */ - self?: string; - /** The name of the attachment file. */ - filename?: string; - author?: User; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** Additional properties of the attachment. */ - properties?: {}; - /** The URL of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; - /** - * The file ID of the attachment in the media store. See the [Media - * API](https://developer.atlassian.com/platform/media/) documentation for more details. - */ - mediaApiFileId?: string; -} diff --git a/src/version2/models/attachmentSettings.ts b/src/version2/models/attachmentSettings.mts similarity index 100% rename from src/version2/models/attachmentSettings.ts rename to src/version2/models/attachmentSettings.mts diff --git a/src/version2/models/auditRecord.mts b/src/version2/models/auditRecord.mts new file mode 100644 index 0000000000..771cc5b916 --- /dev/null +++ b/src/version2/models/auditRecord.mts @@ -0,0 +1,28 @@ +import { AssociatedItem } from './associatedItem.mjs'; +import { ChangedValue } from './changedValue.mjs'; + +/** An audit record. */ +export interface AuditRecord { + /** The ID of the audit record. */ + id?: number; + /** The summary of the audit record. */ + summary?: string; + /** The URL of the computer where the creation of the audit record was initiated. */ + remoteAddress?: string; + /** The date and time on which the audit record was created. */ + created?: string; + /** + * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira + * applications](https://confluence.atlassian.com/x/noXKM). + */ + category?: string; + /** The event the audit record originated from. */ + eventSource?: string; + /** The description of the audit record. */ + description?: string; + objectItem?: AssociatedItem; + /** The list of values changed in the record event. */ + changedValues?: ChangedValue[]; + /** The list of items associated with the changed record. */ + associatedItems?: AssociatedItem[]; +} diff --git a/src/version2/models/auditRecord.ts b/src/version2/models/auditRecord.ts deleted file mode 100644 index 5b294091e0..0000000000 --- a/src/version2/models/auditRecord.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AssociatedItem } from './associatedItem'; -import { ChangedValue } from './changedValue'; - -/** An audit record. */ -export interface AuditRecord { - /** The ID of the audit record. */ - id?: number; - /** The summary of the audit record. */ - summary?: string; - /** The URL of the computer where the creation of the audit record was initiated. */ - remoteAddress?: string; - /** The date and time on which the audit record was created. */ - created?: string; - /** - * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira - * applications](https://confluence.atlassian.com/x/noXKM). - */ - category?: string; - /** The event the audit record originated from. */ - eventSource?: string; - /** The description of the audit record. */ - description?: string; - objectItem?: AssociatedItem; - /** The list of values changed in the record event. */ - changedValues?: ChangedValue[]; - /** The list of items associated with the changed record. */ - associatedItems?: AssociatedItem[]; -} diff --git a/src/version2/models/auditRecords.mts b/src/version2/models/auditRecords.mts new file mode 100644 index 0000000000..42632a7054 --- /dev/null +++ b/src/version2/models/auditRecords.mts @@ -0,0 +1,13 @@ +import { AuditRecord } from './auditRecord.mjs'; + +/** Container for a list of audit records. */ +export interface AuditRecords { + /** The requested or default limit on the number of audit items to be returned. */ + limit?: number; + /** The number of audit items skipped before the first item in this list. */ + offset?: number; + /** The list of audit items. */ + records?: AuditRecord[]; + /** The total number of audit items returned. */ + total?: number; +} diff --git a/src/version2/models/auditRecords.ts b/src/version2/models/auditRecords.ts deleted file mode 100644 index 0b36a5ae41..0000000000 --- a/src/version2/models/auditRecords.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AuditRecord } from './auditRecord'; - -/** Container for a list of audit records. */ -export interface AuditRecords { - /** The requested or default limit on the number of audit items to be returned. */ - limit?: number; - /** The number of audit items skipped before the first item in this list. */ - offset?: number; - /** The list of audit items. */ - records?: AuditRecord[]; - /** The total number of audit items returned. */ - total?: number; -} diff --git a/src/version2/models/autoCompleteSuggestion.ts b/src/version2/models/autoCompleteSuggestion.mts similarity index 100% rename from src/version2/models/autoCompleteSuggestion.ts rename to src/version2/models/autoCompleteSuggestion.mts diff --git a/src/version2/models/autoCompleteSuggestions.mts b/src/version2/models/autoCompleteSuggestions.mts new file mode 100644 index 0000000000..c170b32c19 --- /dev/null +++ b/src/version2/models/autoCompleteSuggestions.mts @@ -0,0 +1,7 @@ +import { AutoCompleteSuggestion } from './autoCompleteSuggestion.mjs'; + +/** The results from a Jql query. */ +export interface AutoCompleteSuggestions { + /** The list of suggested item. */ + results?: AutoCompleteSuggestion[]; +} diff --git a/src/version2/models/autoCompleteSuggestions.ts b/src/version2/models/autoCompleteSuggestions.ts deleted file mode 100644 index d8a5e00228..0000000000 --- a/src/version2/models/autoCompleteSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AutoCompleteSuggestion } from './autoCompleteSuggestion'; - -/** The results from a JQL query. */ -export interface AutoCompleteSuggestions { - /** The list of suggested item. */ - results?: AutoCompleteSuggestion[]; -} diff --git a/src/version2/models/availableDashboardGadget.ts b/src/version2/models/availableDashboardGadget.mts similarity index 100% rename from src/version2/models/availableDashboardGadget.ts rename to src/version2/models/availableDashboardGadget.mts diff --git a/src/version2/models/availableDashboardGadgetsResponse.mts b/src/version2/models/availableDashboardGadgetsResponse.mts new file mode 100644 index 0000000000..5f40eeae32 --- /dev/null +++ b/src/version2/models/availableDashboardGadgetsResponse.mts @@ -0,0 +1,7 @@ +import { AvailableDashboardGadget } from './availableDashboardGadget.mjs'; + +/** The list of available gadgets. */ +export interface AvailableDashboardGadgetsResponse { + /** The list of available gadgets. */ + gadgets: AvailableDashboardGadget[]; +} diff --git a/src/version2/models/availableDashboardGadgetsResponse.ts b/src/version2/models/availableDashboardGadgetsResponse.ts deleted file mode 100644 index d6edf26553..0000000000 --- a/src/version2/models/availableDashboardGadgetsResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AvailableDashboardGadget } from './availableDashboardGadget'; - -/** The list of available gadgets. */ -export interface AvailableDashboardGadgetsResponse { - /** The list of available gadgets. */ - gadgets: AvailableDashboardGadget[]; -} diff --git a/src/version2/models/availableWorkflowConnectRule.ts b/src/version2/models/availableWorkflowConnectRule.mts similarity index 100% rename from src/version2/models/availableWorkflowConnectRule.ts rename to src/version2/models/availableWorkflowConnectRule.mts diff --git a/src/version2/models/availableWorkflowForgeRule.ts b/src/version2/models/availableWorkflowForgeRule.mts similarity index 100% rename from src/version2/models/availableWorkflowForgeRule.ts rename to src/version2/models/availableWorkflowForgeRule.mts diff --git a/src/version2/models/availableWorkflowSystemRule.ts b/src/version2/models/availableWorkflowSystemRule.mts similarity index 100% rename from src/version2/models/availableWorkflowSystemRule.ts rename to src/version2/models/availableWorkflowSystemRule.mts diff --git a/src/version2/models/availableWorkflowTriggerTypes.ts b/src/version2/models/availableWorkflowTriggerTypes.mts similarity index 100% rename from src/version2/models/availableWorkflowTriggerTypes.ts rename to src/version2/models/availableWorkflowTriggerTypes.mts diff --git a/src/version2/models/availableWorkflowTriggers.mts b/src/version2/models/availableWorkflowTriggers.mts new file mode 100644 index 0000000000..e7895b4296 --- /dev/null +++ b/src/version2/models/availableWorkflowTriggers.mts @@ -0,0 +1,9 @@ +import { AvailableWorkflowTriggerTypes } from './availableWorkflowTriggerTypes.mjs'; + +/** The trigger rules available. */ +export interface AvailableWorkflowTriggers { + /** The list of available trigger types. */ + availableTypes: AvailableWorkflowTriggerTypes[]; + /** The rule key of the rule. */ + ruleKey: string; +} diff --git a/src/version2/models/availableWorkflowTriggers.ts b/src/version2/models/availableWorkflowTriggers.ts deleted file mode 100644 index 2fa661876b..0000000000 --- a/src/version2/models/availableWorkflowTriggers.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { AvailableWorkflowTriggerTypes } from './availableWorkflowTriggerTypes'; - -/** The trigger rules available. */ -export interface AvailableWorkflowTriggers { - /** The list of available trigger types. */ - availableTypes: AvailableWorkflowTriggerTypes[]; - /** The rule key of the rule. */ - ruleKey: string; -} diff --git a/src/version2/models/avatar.ts b/src/version2/models/avatar.mts similarity index 100% rename from src/version2/models/avatar.ts rename to src/version2/models/avatar.mts diff --git a/src/version2/models/avatarUrls.ts b/src/version2/models/avatarUrls.mts similarity index 100% rename from src/version2/models/avatarUrls.ts rename to src/version2/models/avatarUrls.mts diff --git a/src/version2/models/avatarWithDetails.ts b/src/version2/models/avatarWithDetails.mts similarity index 100% rename from src/version2/models/avatarWithDetails.ts rename to src/version2/models/avatarWithDetails.mts diff --git a/src/version2/models/avatars.mts b/src/version2/models/avatars.mts new file mode 100644 index 0000000000..4bcb388935 --- /dev/null +++ b/src/version2/models/avatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** Details about system and custom avatars. */ +export interface Avatars { + /** Custom avatars list. */ + custom?: Avatar[]; + /** System avatars list. */ + system?: Avatar[]; +} diff --git a/src/version2/models/avatars.ts b/src/version2/models/avatars.ts deleted file mode 100644 index df93aa3ca5..0000000000 --- a/src/version2/models/avatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Avatar } from './avatar'; - -/** Details about system and custom avatars. */ -export interface Avatars { - /** Custom avatars list. */ - custom?: Avatar[]; - /** System avatars list. */ - system?: Avatar[]; -} diff --git a/src/version2/models/bulkChangeOwnerDetails.ts b/src/version2/models/bulkChangeOwnerDetails.mts similarity index 100% rename from src/version2/models/bulkChangeOwnerDetails.ts rename to src/version2/models/bulkChangeOwnerDetails.mts diff --git a/src/version2/models/bulkCustomFieldOptionCreateRequest.mts b/src/version2/models/bulkCustomFieldOptionCreateRequest.mts new file mode 100644 index 0000000000..9374a43cc3 --- /dev/null +++ b/src/version2/models/bulkCustomFieldOptionCreateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionCreate } from './customFieldOptionCreate.mjs'; + +/** Details of the options to create for a custom field. */ +export interface BulkCustomFieldOptionCreateRequest { + /** Details of options to create. */ + options?: CustomFieldOptionCreate[]; +} diff --git a/src/version2/models/bulkCustomFieldOptionCreateRequest.ts b/src/version2/models/bulkCustomFieldOptionCreateRequest.ts deleted file mode 100644 index 0944e835e0..0000000000 --- a/src/version2/models/bulkCustomFieldOptionCreateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldOptionCreate } from './customFieldOptionCreate'; - -/** Details of the options to create for a custom field. */ -export interface BulkCustomFieldOptionCreateRequest { - /** Details of options to create. */ - options?: CustomFieldOptionCreate[]; -} diff --git a/src/version2/models/bulkCustomFieldOptionUpdateRequest.mts b/src/version2/models/bulkCustomFieldOptionUpdateRequest.mts new file mode 100644 index 0000000000..952315da41 --- /dev/null +++ b/src/version2/models/bulkCustomFieldOptionUpdateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** Details of the options to update for a custom field. */ +export interface BulkCustomFieldOptionUpdateRequest { + /** Details of the options to update. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts b/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts deleted file mode 100644 index c7b8076989..0000000000 --- a/src/version2/models/bulkCustomFieldOptionUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldOptionUpdate } from './customFieldOptionUpdate'; - -/** Details of the options to update for a custom field. */ -export interface BulkCustomFieldOptionUpdateRequest { - /** Details of the options to update. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version2/models/bulkEditShareableEntity.ts b/src/version2/models/bulkEditShareableEntity.mts similarity index 100% rename from src/version2/models/bulkEditShareableEntity.ts rename to src/version2/models/bulkEditShareableEntity.mts diff --git a/src/version2/models/bulkIssueIsWatching.ts b/src/version2/models/bulkIssueIsWatching.mts similarity index 100% rename from src/version2/models/bulkIssueIsWatching.ts rename to src/version2/models/bulkIssueIsWatching.mts diff --git a/src/version2/models/bulkIssuePropertyUpdateRequest.mts b/src/version2/models/bulkIssuePropertyUpdateRequest.mts new file mode 100644 index 0000000000..8adaefd124 --- /dev/null +++ b/src/version2/models/bulkIssuePropertyUpdateRequest.mts @@ -0,0 +1,18 @@ +import { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet.mjs'; + +/** Bulk issue property update request details. */ +export interface BulkIssuePropertyUpdateRequest { + /** + * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an + * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables + * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON + * representation is longer than 32768 characters are ignored. + */ + expression?: string; + filter?: IssueFilterForBulkPropertySet; + /** + * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. + * The maximum length is 32768 characters. + */ + value?: any; +} diff --git a/src/version2/models/bulkIssuePropertyUpdateRequest.ts b/src/version2/models/bulkIssuePropertyUpdateRequest.ts deleted file mode 100644 index 8162a61c86..0000000000 --- a/src/version2/models/bulkIssuePropertyUpdateRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet'; - -/** Bulk issue property update request details. */ -export interface BulkIssuePropertyUpdateRequest { - /** - * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an - * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables - * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON - * representation is longer than 32768 characters are ignored. - */ - expression?: string; - filter?: IssueFilterForBulkPropertySet; - /** - * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. - * The maximum length is 32768 characters. - */ - value?: any; -} diff --git a/src/version2/models/bulkOperationErrorResult.mts b/src/version2/models/bulkOperationErrorResult.mts new file mode 100644 index 0000000000..55f9a0a4c4 --- /dev/null +++ b/src/version2/models/bulkOperationErrorResult.mts @@ -0,0 +1,7 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +export interface BulkOperationErrorResult { + elementErrors?: ErrorCollection; + failedElementNumber?: number; + status?: number; +} diff --git a/src/version2/models/bulkOperationErrorResult.ts b/src/version2/models/bulkOperationErrorResult.ts deleted file mode 100644 index 7539a2009c..0000000000 --- a/src/version2/models/bulkOperationErrorResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ErrorCollection } from './errorCollection'; - -export interface BulkOperationErrorResult { - elementErrors?: ErrorCollection; - failedElementNumber?: number; - status?: number; -} diff --git a/src/version2/models/bulkPermissionGrants.mts b/src/version2/models/bulkPermissionGrants.mts new file mode 100644 index 0000000000..21ccbf956b --- /dev/null +++ b/src/version2/models/bulkPermissionGrants.mts @@ -0,0 +1,9 @@ +import { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants.mjs'; + +/** Details of global and project permissions granted to the user. */ +export interface BulkPermissionGrants { + /** List of permissions granted to the user. */ + globalPermissions: string[]; + /** List of project permissions and the projects and issues those permissions provide access to. */ + projectPermissions: BulkProjectPermissionGrants[]; +} diff --git a/src/version2/models/bulkPermissionGrants.ts b/src/version2/models/bulkPermissionGrants.ts deleted file mode 100644 index 10cc5e5f1b..0000000000 --- a/src/version2/models/bulkPermissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants'; - -/** Details of global and project permissions granted to the user. */ -export interface BulkPermissionGrants { - /** List of permissions granted to the user. */ - globalPermissions: string[]; - /** List of project permissions and the projects and issues those permissions provide access to. */ - projectPermissions: BulkProjectPermissionGrants[]; -} diff --git a/src/version2/models/bulkPermissionsRequest.mts b/src/version2/models/bulkPermissionsRequest.mts new file mode 100644 index 0000000000..15655fa2f4 --- /dev/null +++ b/src/version2/models/bulkPermissionsRequest.mts @@ -0,0 +1,11 @@ +import { BulkProjectPermissions } from './bulkProjectPermissions.mjs'; + +/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ +export interface BulkPermissionsRequest { + /** The account ID of a user. */ + accountId?: string; + /** Global permissions to look up. */ + globalPermissions?: string[]; + /** Project permissions with associated projects and issues to look up. */ + projectPermissions?: BulkProjectPermissions[]; +} diff --git a/src/version2/models/bulkPermissionsRequest.ts b/src/version2/models/bulkPermissionsRequest.ts deleted file mode 100644 index 69185f5e0d..0000000000 --- a/src/version2/models/bulkPermissionsRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BulkProjectPermissions } from './bulkProjectPermissions'; - -/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ -export interface BulkPermissionsRequest { - /** The account ID of a user. */ - accountId?: string; - /** Global permissions to look up. */ - globalPermissions?: string[]; - /** Project permissions with associated projects and issues to look up. */ - projectPermissions?: BulkProjectPermissions[]; -} diff --git a/src/version2/models/bulkProjectPermissionGrants.ts b/src/version2/models/bulkProjectPermissionGrants.mts similarity index 100% rename from src/version2/models/bulkProjectPermissionGrants.ts rename to src/version2/models/bulkProjectPermissionGrants.mts diff --git a/src/version2/models/bulkProjectPermissions.ts b/src/version2/models/bulkProjectPermissions.mts similarity index 100% rename from src/version2/models/bulkProjectPermissions.ts rename to src/version2/models/bulkProjectPermissions.mts diff --git a/src/version2/models/changeDetails.ts b/src/version2/models/changeDetails.mts similarity index 100% rename from src/version2/models/changeDetails.ts rename to src/version2/models/changeDetails.mts diff --git a/src/version2/models/changedValue.ts b/src/version2/models/changedValue.mts similarity index 100% rename from src/version2/models/changedValue.ts rename to src/version2/models/changedValue.mts diff --git a/src/version2/models/changedWorklog.mts b/src/version2/models/changedWorklog.mts new file mode 100644 index 0000000000..ed50e11b4e --- /dev/null +++ b/src/version2/models/changedWorklog.mts @@ -0,0 +1,11 @@ +import { EntityProperty } from './entityProperty.mjs'; + +/** Details of a changed worklog. */ +export interface ChangedWorklog { + /** Details of properties associated with the change. */ + properties?: EntityProperty[]; + /** The datetime of the change. */ + updatedTime?: number; + /** The ID of the worklog. */ + worklogId?: number; +} diff --git a/src/version2/models/changedWorklog.ts b/src/version2/models/changedWorklog.ts deleted file mode 100644 index 654ab2a43c..0000000000 --- a/src/version2/models/changedWorklog.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { EntityProperty } from './entityProperty'; - -/** Details of a changed worklog. */ -export interface ChangedWorklog { - /** Details of properties associated with the change. */ - properties?: EntityProperty[]; - /** The datetime of the change. */ - updatedTime?: number; - /** The ID of the worklog. */ - worklogId?: number; -} diff --git a/src/version2/models/changedWorklogs.mts b/src/version2/models/changedWorklogs.mts new file mode 100644 index 0000000000..58a8d21425 --- /dev/null +++ b/src/version2/models/changedWorklogs.mts @@ -0,0 +1,16 @@ +import { ChangedWorklog } from './changedWorklog.mjs'; + +/** List of changed worklogs. */ +export interface ChangedWorklogs { + lastPage?: boolean; + /** The URL of the next list of changed worklogs. */ + nextPage?: string; + /** The URL of this changed worklogs list. */ + self?: string; + /** The datetime of the first worklog item in the list. */ + since?: number; + /** The datetime of the last worklog item in the list. */ + until?: number; + /** Changed worklog list. */ + values?: ChangedWorklog[]; +} diff --git a/src/version2/models/changedWorklogs.ts b/src/version2/models/changedWorklogs.ts deleted file mode 100644 index ecd6bea3d8..0000000000 --- a/src/version2/models/changedWorklogs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ChangedWorklog } from './changedWorklog'; - -/** List of changed worklogs. */ -export interface ChangedWorklogs { - lastPage?: boolean; - /** The URL of the next list of changed worklogs. */ - nextPage?: string; - /** The URL of this changed worklogs list. */ - self?: string; - /** The datetime of the first worklog item in the list. */ - since?: number; - /** The datetime of the last worklog item in the list. */ - until?: number; - /** Changed worklog list. */ - values?: ChangedWorklog[]; -} diff --git a/src/version2/models/changelog.mts b/src/version2/models/changelog.mts new file mode 100644 index 0000000000..4917522f13 --- /dev/null +++ b/src/version2/models/changelog.mts @@ -0,0 +1,15 @@ +import { ChangeDetails } from './changeDetails.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** A log of changes made to issue fields. Changelogs related to workflow associations are currently being deprecated. */ +export interface Changelog { + author?: UserDetails; + /** The date on which the change took place. */ + created?: string; + historyMetadata?: HistoryMetadata; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: ChangeDetails[]; +} diff --git a/src/version2/models/changelog.ts b/src/version2/models/changelog.ts deleted file mode 100644 index 5671b53407..0000000000 --- a/src/version2/models/changelog.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ChangeDetails } from './changeDetails'; -import { HistoryMetadata } from './historyMetadata'; -import { UserDetails } from './userDetails'; - -/** A log of changes made to issue fields. Changelogs related to workflow associations are currently being deprecated. */ -export interface Changelog { - author?: UserDetails; - /** The date on which the change took place. */ - created?: string; - historyMetadata?: HistoryMetadata; - /** The ID of the changelog. */ - id?: string; - /** The list of items changed. */ - items?: ChangeDetails[]; -} diff --git a/src/version2/models/columnItem.ts b/src/version2/models/columnItem.mts similarity index 100% rename from src/version2/models/columnItem.ts rename to src/version2/models/columnItem.mts diff --git a/src/version2/models/comment.mts b/src/version2/models/comment.mts new file mode 100644 index 0000000000..07e4aa2321 --- /dev/null +++ b/src/version2/models/comment.mts @@ -0,0 +1,40 @@ +import { EntityProperty } from './entityProperty.mjs'; +import { UserDetails } from './userDetails.mjs'; +import { Visibility } from './visibility.mjs'; + +/** A comment. */ +export interface Comment { + author?: UserDetails; + /** The comment text. */ + comment?: string; + /** The date and time at which the comment was created. */ + created?: string; + /** The ID of the comment. */ + id?: string; + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest?: boolean; + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic?: boolean; + /** A list of comment properties. Optional on create and update. */ + properties?: EntityProperty[]; + /** The rendered version of the comment. */ + renderedBody?: string; + /** The URL of the comment. */ + self?: string; + updateAuthor?: UserDetails; + /** The date and time at which the comment was updated last. */ + updated?: string; + visibility?: Visibility; +} diff --git a/src/version2/models/comment.ts b/src/version2/models/comment.ts deleted file mode 100644 index b86ec65039..0000000000 --- a/src/version2/models/comment.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { EntityProperty } from './entityProperty'; -import { UserDetails } from './userDetails'; -import { Visibility } from './visibility'; - -/** A comment. */ -export interface Comment { - author?: UserDetails; - /** The comment text. */ - comment?: string; - /** The date and time at which the comment was created. */ - created?: string; - /** The ID of the comment. */ - id?: string; - /** - * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external - * emails to be added as comments on - * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for - * information on setting up this feature. - */ - jsdAuthorCanSeeRequest?: boolean; - /** - * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud - * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk - * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its - * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request - * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) - * operation. - */ - jsdPublic?: boolean; - /** A list of comment properties. Optional on create and update. */ - properties?: EntityProperty[]; - /** The rendered version of the comment. */ - renderedBody?: string; - /** The URL of the comment. */ - self?: string; - updateAuthor?: UserDetails; - /** The date and time at which the comment was updated last. */ - updated?: string; - visibility?: Visibility; -} diff --git a/src/version2/models/componentIssuesCount.ts b/src/version2/models/componentIssuesCount.mts similarity index 100% rename from src/version2/models/componentIssuesCount.ts rename to src/version2/models/componentIssuesCount.mts diff --git a/src/version2/models/componentWithIssueCount.mts b/src/version2/models/componentWithIssueCount.mts new file mode 100644 index 0000000000..40cf11a225 --- /dev/null +++ b/src/version2/models/componentWithIssueCount.mts @@ -0,0 +1,51 @@ +import { User } from './user.mjs'; + +/** Details about a component with a count of the issues it contains. */ +export interface ComponentWithIssueCount { + 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. Takes 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. + */ + assigneeType?: string; + /** The description for the component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + /** Count of issues for the component. */ + issueCount?: number; + lead?: User; + /** The name for the component. */ + name?: string; + /** The key of the project to which the component is assigned. */ + project?: string; + /** Not used. */ + projectId?: number; + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * 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. + */ + realAssigneeType?: string; + /** The URL for this count of the issues contained in the component. */ + self?: string; +} diff --git a/src/version2/models/componentWithIssueCount.ts b/src/version2/models/componentWithIssueCount.ts deleted file mode 100644 index a8598fc017..0000000000 --- a/src/version2/models/componentWithIssueCount.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { User } from './user'; - -/** Details about a component with a count of the issues it contains. */ -export interface ComponentWithIssueCount { - 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. Takes 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. - */ - assigneeType?: string; - /** The description for the component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - /** Count of issues for the component. */ - issueCount?: number; - lead?: User; - /** The name for the component. */ - name?: string; - /** The key of the project to which the component is assigned. */ - project?: string; - /** Not used. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * 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. - */ - realAssigneeType?: string; - /** The URL for this count of the issues contained in the component. */ - self?: string; -} diff --git a/src/version2/models/conditionGroupConfiguration.mts b/src/version2/models/conditionGroupConfiguration.mts new file mode 100644 index 0000000000..19adfe2ffe --- /dev/null +++ b/src/version2/models/conditionGroupConfiguration.mts @@ -0,0 +1,15 @@ +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; + +/** 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?: string; +} diff --git a/src/version2/models/conditionGroupConfiguration.ts b/src/version2/models/conditionGroupConfiguration.ts deleted file mode 100644 index bdc95aa010..0000000000 --- a/src/version2/models/conditionGroupConfiguration.ts +++ /dev/null @@ -1,15 +0,0 @@ -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?: string; -} diff --git a/src/version2/models/conditionGroupUpdate.mts b/src/version2/models/conditionGroupUpdate.mts new file mode 100644 index 0000000000..75bcd8b2de --- /dev/null +++ b/src/version2/models/conditionGroupUpdate.mts @@ -0,0 +1,15 @@ +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; + +/** The conditions group associated with the transition. */ +export interface ConditionGroupUpdate { + /** The nested conditions of the condition group. */ + conditionGroups?: ConditionGroupUpdate[]; + /** 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: string; +} diff --git a/src/version2/models/conditionGroupUpdate.ts b/src/version2/models/conditionGroupUpdate.ts deleted file mode 100644 index 6d1b17b6fb..0000000000 --- a/src/version2/models/conditionGroupUpdate.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; - -/** The conditions group associated with the transition. */ -export interface ConditionGroupUpdate { - /** The nested conditions of the condition group. */ - conditionGroups?: ConditionGroupUpdate[]; - /** 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: string; -} diff --git a/src/version2/models/configuration.mts b/src/version2/models/configuration.mts new file mode 100644 index 0000000000..71967f12b4 --- /dev/null +++ b/src/version2/models/configuration.mts @@ -0,0 +1,27 @@ +import { TimeTrackingConfiguration } from './timeTrackingConfiguration.mjs'; + +/** Details about the configuration of Jira. */ +export interface Configuration { + /** Whether the ability to add attachments to issues is enabled. */ + attachmentsEnabled?: boolean; + /** Whether the ability to link issues is enabled. */ + issueLinkingEnabled?: boolean; + /** Whether the ability to create subtasks for issues is enabled. */ + subTasksEnabled?: boolean; + timeTrackingConfiguration?: TimeTrackingConfiguration; + /** + * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + unassignedIssuesAllowed?: boolean; + /** + * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + votingEnabled?: boolean; + /** + * Whether the ability for users to watch issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + watchingEnabled?: boolean; +} diff --git a/src/version2/models/configuration.ts b/src/version2/models/configuration.ts deleted file mode 100644 index 1cfaf774aa..0000000000 --- a/src/version2/models/configuration.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TimeTrackingConfiguration } from './timeTrackingConfiguration'; - -/** Details about the configuration of Jira. */ -export interface Configuration { - /** Whether the ability to add attachments to issues is enabled. */ - attachmentsEnabled?: boolean; - /** Whether the ability to link issues is enabled. */ - issueLinkingEnabled?: boolean; - /** Whether the ability to create subtasks for issues is enabled. */ - subTasksEnabled?: boolean; - timeTrackingConfiguration?: TimeTrackingConfiguration; - /** - * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - unassignedIssuesAllowed?: boolean; - /** - * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - votingEnabled?: boolean; - /** - * Whether the ability for users to watch issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - watchingEnabled?: boolean; -} diff --git a/src/version2/models/connectCustomFieldValue.ts b/src/version2/models/connectCustomFieldValue.mts similarity index 100% rename from src/version2/models/connectCustomFieldValue.ts rename to src/version2/models/connectCustomFieldValue.mts diff --git a/src/version2/models/connectCustomFieldValues.mts b/src/version2/models/connectCustomFieldValues.mts new file mode 100644 index 0000000000..c9a349f477 --- /dev/null +++ b/src/version2/models/connectCustomFieldValues.mts @@ -0,0 +1,7 @@ +import { ConnectCustomFieldValue } from './connectCustomFieldValue.mjs'; + +/** Details of updates for a custom field. */ +export interface ConnectCustomFieldValues { + /** The list of custom field update details. */ + updateValueList?: ConnectCustomFieldValue[]; +} diff --git a/src/version2/models/connectCustomFieldValues.ts b/src/version2/models/connectCustomFieldValues.ts deleted file mode 100644 index b54c2562f6..0000000000 --- a/src/version2/models/connectCustomFieldValues.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ConnectCustomFieldValue } from './connectCustomFieldValue'; - -/** Details of updates for a custom field. */ -export interface ConnectCustomFieldValues { - /** The list of custom field update details. */ - updateValueList?: ConnectCustomFieldValue[]; -} diff --git a/src/version2/models/connectModule.ts b/src/version2/models/connectModule.mts similarity index 100% rename from src/version2/models/connectModule.ts rename to src/version2/models/connectModule.mts diff --git a/src/version2/models/connectModules.mts b/src/version2/models/connectModules.mts new file mode 100644 index 0000000000..4d5fe7c19c --- /dev/null +++ b/src/version2/models/connectModules.mts @@ -0,0 +1,9 @@ +import { ConnectModule } from './connectModule.mjs'; + +export interface ConnectModules { + /** + * A list of app modules in the same format as the `modules` property in the [app + * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: ConnectModule[]; +} diff --git a/src/version2/models/connectModules.ts b/src/version2/models/connectModules.ts deleted file mode 100644 index 4800ca7b1c..0000000000 --- a/src/version2/models/connectModules.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ConnectModule } from './connectModule'; - -export interface ConnectModules { - /** - * A list of app modules in the same format as the `modules` property in the [app - * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). - */ - modules: ConnectModule[]; -} diff --git a/src/version2/models/connectWorkflowTransitionRule.mts b/src/version2/models/connectWorkflowTransitionRule.mts new file mode 100644 index 0000000000..3953e6b7c9 --- /dev/null +++ b/src/version2/models/connectWorkflowTransitionRule.mts @@ -0,0 +1,12 @@ +import { RuleConfiguration } from './ruleConfiguration.mjs'; +import { WorkflowTransition } from './workflowTransition.mjs'; + +/** A workflow transition rule. */ +export interface ConnectWorkflowTransitionRule { + configuration: RuleConfiguration; + /** The ID of the transition rule. */ + id: string; + /** The key of the rule, as defined in the Connect app descriptor. */ + key: string; + transition?: WorkflowTransition; +} diff --git a/src/version2/models/connectWorkflowTransitionRule.ts b/src/version2/models/connectWorkflowTransitionRule.ts deleted file mode 100644 index 126c510de5..0000000000 --- a/src/version2/models/connectWorkflowTransitionRule.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { RuleConfiguration } from './ruleConfiguration'; -import { WorkflowTransition } from './workflowTransition'; - -/** A workflow transition rule. */ -export interface ConnectWorkflowTransitionRule { - configuration: RuleConfiguration; - /** The ID of the transition rule. */ - id: string; - /** The key of the rule, as defined in the Connect app descriptor. */ - key: string; - transition?: WorkflowTransition; -} diff --git a/src/version2/models/containerForProjectFeatures.mts b/src/version2/models/containerForProjectFeatures.mts new file mode 100644 index 0000000000..f0fd1db6ac --- /dev/null +++ b/src/version2/models/containerForProjectFeatures.mts @@ -0,0 +1,7 @@ +import { ProjectFeature } from './projectFeature.mjs'; + +/** The list of features on a project. */ +export interface ContainerForProjectFeatures { + /** The project features. */ + features?: ProjectFeature[]; +} diff --git a/src/version2/models/containerForProjectFeatures.ts b/src/version2/models/containerForProjectFeatures.ts deleted file mode 100644 index ab3369de95..0000000000 --- a/src/version2/models/containerForProjectFeatures.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProjectFeature } from './projectFeature'; - -/** The list of features on a project. */ -export interface ContainerForProjectFeatures { - /** The project features. */ - features?: ProjectFeature[]; -} diff --git a/src/version2/models/containerForRegisteredWebhooks.mts b/src/version2/models/containerForRegisteredWebhooks.mts new file mode 100644 index 0000000000..ce2973c7c3 --- /dev/null +++ b/src/version2/models/containerForRegisteredWebhooks.mts @@ -0,0 +1,7 @@ +import { RegisteredWebhook } from './registeredWebhook.mjs'; + +/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ +export interface ContainerForRegisteredWebhooks { + /** A list of registered webhooks. */ + webhookRegistrationResult?: RegisteredWebhook[]; +} diff --git a/src/version2/models/containerForRegisteredWebhooks.ts b/src/version2/models/containerForRegisteredWebhooks.ts deleted file mode 100644 index aa13caf5ff..0000000000 --- a/src/version2/models/containerForRegisteredWebhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { RegisteredWebhook } from './registeredWebhook'; - -/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ -export interface ContainerForRegisteredWebhooks { - /** A list of registered webhooks. */ - webhookRegistrationResult?: RegisteredWebhook[]; -} diff --git a/src/version2/models/containerForWebhookIDs.ts b/src/version2/models/containerForWebhookIDs.mts similarity index 100% rename from src/version2/models/containerForWebhookIDs.ts rename to src/version2/models/containerForWebhookIDs.mts diff --git a/src/version2/models/containerOfWorkflowSchemeAssociations.mts b/src/version2/models/containerOfWorkflowSchemeAssociations.mts new file mode 100644 index 0000000000..2ecc5fc29a --- /dev/null +++ b/src/version2/models/containerOfWorkflowSchemeAssociations.mts @@ -0,0 +1,7 @@ +import { WorkflowSchemeAssociations } from './workflowSchemeAssociations.mjs'; + +/** A container for a list of workflow schemes together with the projects they are associated with. */ +export interface ContainerOfWorkflowSchemeAssociations { + /** A list of workflow schemes together with projects they are associated with. */ + values: WorkflowSchemeAssociations[]; +} diff --git a/src/version2/models/containerOfWorkflowSchemeAssociations.ts b/src/version2/models/containerOfWorkflowSchemeAssociations.ts deleted file mode 100644 index 5c053d4112..0000000000 --- a/src/version2/models/containerOfWorkflowSchemeAssociations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowSchemeAssociations } from './workflowSchemeAssociations'; - -/** A container for a list of workflow schemes together with the projects they are associated with. */ -export interface ContainerOfWorkflowSchemeAssociations { - /** A list of workflow schemes together with projects they are associated with. */ - values: WorkflowSchemeAssociations[]; -} diff --git a/src/version2/models/contextForProjectAndIssueType.ts b/src/version2/models/contextForProjectAndIssueType.mts similarity index 100% rename from src/version2/models/contextForProjectAndIssueType.ts rename to src/version2/models/contextForProjectAndIssueType.mts diff --git a/src/version2/models/contextualConfiguration.ts b/src/version2/models/contextualConfiguration.mts similarity index 100% rename from src/version2/models/contextualConfiguration.ts rename to src/version2/models/contextualConfiguration.mts diff --git a/src/version2/models/convertedJQLQueries.mts b/src/version2/models/convertedJQLQueries.mts new file mode 100644 index 0000000000..f32f08fee4 --- /dev/null +++ b/src/version2/models/convertedJQLQueries.mts @@ -0,0 +1,9 @@ +import { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers.mjs'; + +/** The converted Jql queries. */ +export interface ConvertedJQLQueries { + /** List of queries containing user information that could not be mapped to an existing user */ + queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; + /** The list of converted query strings with account IDs in place of user identifiers. */ + queryStrings?: string[]; +} diff --git a/src/version2/models/convertedJQLQueries.ts b/src/version2/models/convertedJQLQueries.ts deleted file mode 100644 index c5cbfd6479..0000000000 --- a/src/version2/models/convertedJQLQueries.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers'; - -/** The converted JQL queries. */ -export interface ConvertedJQLQueries { - /** List of queries containing user information that could not be mapped to an existing user */ - queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; - /** The list of converted query strings with account IDs in place of user identifiers. */ - queryStrings?: string[]; -} diff --git a/src/version2/models/createCustomFieldContext.ts b/src/version2/models/createCustomFieldContext.mts similarity index 100% rename from src/version2/models/createCustomFieldContext.ts rename to src/version2/models/createCustomFieldContext.mts diff --git a/src/version2/models/createIssueSecuritySchemeDetails.mts b/src/version2/models/createIssueSecuritySchemeDetails.mts new file mode 100644 index 0000000000..1a5a1f7114 --- /dev/null +++ b/src/version2/models/createIssueSecuritySchemeDetails.mts @@ -0,0 +1,11 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +/** Issue security scheme and it's details */ +export interface CreateIssueSecuritySchemeDetails { + /** The description of the issue security scheme. */ + description?: string; + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevel[]; + /** The name of the issue security scheme. Must be unique (case-insensitive). */ + name: string; +} diff --git a/src/version2/models/createIssueSecuritySchemeDetails.ts b/src/version2/models/createIssueSecuritySchemeDetails.ts deleted file mode 100644 index d61b640ba1..0000000000 --- a/src/version2/models/createIssueSecuritySchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SecuritySchemeLevel } from './securitySchemeLevel'; - -/** Issue security scheme and it's details */ -export interface CreateIssueSecuritySchemeDetails { - /** The description of the issue security scheme. */ - description?: string; - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; - /** The name of the issue security scheme. Must be unique (case-insensitive). */ - name: string; -} diff --git a/src/version2/models/createNotificationSchemeDetails.mts b/src/version2/models/createNotificationSchemeDetails.mts new file mode 100644 index 0000000000..d76d5f6e57 --- /dev/null +++ b/src/version2/models/createNotificationSchemeDetails.mts @@ -0,0 +1,11 @@ +import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails.mjs'; + +/** Details of a notification scheme. */ +export interface CreateNotificationSchemeDetails { + /** The description of the notification scheme. */ + description?: string; + /** The name of the notification scheme. Must be unique (case-insensitive). */ + name: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents?: NotificationSchemeEventDetails[]; +} diff --git a/src/version2/models/createNotificationSchemeDetails.ts b/src/version2/models/createNotificationSchemeDetails.ts deleted file mode 100644 index bdabe0b9ff..0000000000 --- a/src/version2/models/createNotificationSchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails'; - -/** Details of a notification scheme. */ -export interface CreateNotificationSchemeDetails { - /** The description of the notification scheme. */ - description?: string; - /** The name of the notification scheme. Must be unique (case-insensitive). */ - name: string; - /** The list of notifications which should be added to the notification scheme. */ - notificationSchemeEvents?: NotificationSchemeEventDetails[]; -} diff --git a/src/version2/models/createPriorityDetails.ts b/src/version2/models/createPriorityDetails.mts similarity index 100% rename from src/version2/models/createPriorityDetails.ts rename to src/version2/models/createPriorityDetails.mts diff --git a/src/version2/models/createProjectDetails.ts b/src/version2/models/createProjectDetails.mts similarity index 100% rename from src/version2/models/createProjectDetails.ts rename to src/version2/models/createProjectDetails.mts diff --git a/src/version2/models/createResolutionDetails.ts b/src/version2/models/createResolutionDetails.mts similarity index 100% rename from src/version2/models/createResolutionDetails.ts rename to src/version2/models/createResolutionDetails.mts diff --git a/src/version2/models/createUiModificationDetails.mts b/src/version2/models/createUiModificationDetails.mts new file mode 100644 index 0000000000..7a34976ca3 --- /dev/null +++ b/src/version2/models/createUiModificationDetails.mts @@ -0,0 +1,13 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface CreateUiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; +} diff --git a/src/version2/models/createUiModificationDetails.ts b/src/version2/models/createUiModificationDetails.ts deleted file mode 100644 index a5152b29ad..0000000000 --- a/src/version2/models/createUiModificationDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface CreateUiModificationDetails { - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/createUpdateRoleRequest.ts b/src/version2/models/createUpdateRoleRequest.mts similarity index 100% rename from src/version2/models/createUpdateRoleRequest.ts rename to src/version2/models/createUpdateRoleRequest.mts diff --git a/src/version2/models/createWorkflowCondition.ts b/src/version2/models/createWorkflowCondition.mts similarity index 100% rename from src/version2/models/createWorkflowCondition.ts rename to src/version2/models/createWorkflowCondition.mts diff --git a/src/version2/models/createWorkflowDetails.mts b/src/version2/models/createWorkflowDetails.mts new file mode 100644 index 0000000000..1c13694dc0 --- /dev/null +++ b/src/version2/models/createWorkflowDetails.mts @@ -0,0 +1,29 @@ +import { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails.mjs'; +import { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails.mjs'; + +/** The details of a workflow. */ +export interface CreateWorkflowDetails { + /** The description of the workflow. The maximum length is 1000 characters. */ + description?: string; + /** + * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be + * separated by a whitespace but the name cannot start or end with a whitespace. + */ + name: string; + /** + * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a + * transition. + */ + statuses: CreateWorkflowStatusDetails[]; + /** + * The transitions of the workflow. For the request to be valid, these transitions must: + * + * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique + * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for + * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status + * on _directed_ transitions. + * + * All the transition statuses must be included in `statuses`. + */ + transitions: CreateWorkflowTransitionDetails[]; +} diff --git a/src/version2/models/createWorkflowDetails.ts b/src/version2/models/createWorkflowDetails.ts deleted file mode 100644 index 8c876ae677..0000000000 --- a/src/version2/models/createWorkflowDetails.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails'; -import { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails'; - -/** The details of a workflow. */ -export interface CreateWorkflowDetails { - /** The description of the workflow. The maximum length is 1000 characters. */ - description?: string; - /** - * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be - * separated by a whitespace but the name cannot start or end with a whitespace. - */ - name: string; - /** - * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a - * transition. - */ - statuses: CreateWorkflowStatusDetails[]; - /** - * The transitions of the workflow. For the request to be valid, these transitions must: - * - * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique - * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for - * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status - * on _directed_ transitions. - * - * All the transition statuses must be included in `statuses`. - */ - transitions: CreateWorkflowTransitionDetails[]; -} diff --git a/src/version2/models/createWorkflowStatusDetails.ts b/src/version2/models/createWorkflowStatusDetails.mts similarity index 100% rename from src/version2/models/createWorkflowStatusDetails.ts rename to src/version2/models/createWorkflowStatusDetails.mts diff --git a/src/version2/models/createWorkflowTransitionDetails.mts b/src/version2/models/createWorkflowTransitionDetails.mts new file mode 100644 index 0000000000..cdecab9dde --- /dev/null +++ b/src/version2/models/createWorkflowTransitionDetails.mts @@ -0,0 +1,20 @@ +import { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails.mjs'; +import { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails.mjs'; + +/** The details of a workflow transition. */ +export interface CreateWorkflowTransitionDetails { + /** The description of the transition. The maximum length is 1000 characters. */ + description?: string; + /** The statuses the transition can start from. */ + from?: string[]; + /** The name of the transition. The maximum length is 60 characters. */ + name: string; + /** The properties of the transition. */ + properties?: {}; + rules?: CreateWorkflowTransitionRulesDetails; + screen?: CreateWorkflowTransitionScreenDetails; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; +} diff --git a/src/version2/models/createWorkflowTransitionDetails.ts b/src/version2/models/createWorkflowTransitionDetails.ts deleted file mode 100644 index 7e948429e5..0000000000 --- a/src/version2/models/createWorkflowTransitionDetails.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails'; -import { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails'; - -/** The details of a workflow transition. */ -export interface CreateWorkflowTransitionDetails { - /** The description of the transition. The maximum length is 1000 characters. */ - description?: string; - /** The statuses the transition can start from. */ - from?: string[]; - /** The name of the transition. The maximum length is 60 characters. */ - name: string; - /** The properties of the transition. */ - properties?: {}; - rules?: CreateWorkflowTransitionRulesDetails; - screen?: CreateWorkflowTransitionScreenDetails; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; -} diff --git a/src/version2/models/createWorkflowTransitionRule.ts b/src/version2/models/createWorkflowTransitionRule.mts similarity index 100% rename from src/version2/models/createWorkflowTransitionRule.ts rename to src/version2/models/createWorkflowTransitionRule.mts diff --git a/src/version2/models/createWorkflowTransitionRulesDetails.mts b/src/version2/models/createWorkflowTransitionRulesDetails.mts new file mode 100644 index 0000000000..ad82dd9008 --- /dev/null +++ b/src/version2/models/createWorkflowTransitionRulesDetails.mts @@ -0,0 +1,72 @@ +import { CreateWorkflowCondition } from './createWorkflowCondition.mjs'; +import { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule.mjs'; + +/** The details of a workflow transition rules. */ +export interface CreateWorkflowTransitionRulesDetails { + conditions?: CreateWorkflowCondition; + /** + * The workflow post functions. + * + * _Note:_* The default post functions are always added to the _initial_ transition, as in: + * + * "postFunctions": [ + * { + * "type": "IssueCreateFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "1", + * "name": "issue_created" + * } + * } + * } + * ] + * + * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: + * + * "postFunctions": [ + * { + * "type": "UpdateIssueStatusFunction" + * }, + * { + * "type": "CreateCommentFunction" + * }, + * { + * "type": "GenerateChangeHistoryFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "13", + * "name": "issue_generic" + * } + * } + * } + * ] + */ + postFunctions?: CreateWorkflowTransitionRule[]; + /** + * The workflow validators. + * + * _Note:_* The default permission validator is always added to the _initial_ transition, as in: + * + * "validators": [ + * { + * "type": "PermissionValidator", + * "configuration": { + * "permissionKey": "CREATE_ISSUES" + * } + * } + * ] + */ + validators?: CreateWorkflowTransitionRule[]; +} diff --git a/src/version2/models/createWorkflowTransitionRulesDetails.ts b/src/version2/models/createWorkflowTransitionRulesDetails.ts deleted file mode 100644 index 739148ca91..0000000000 --- a/src/version2/models/createWorkflowTransitionRulesDetails.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { CreateWorkflowCondition } from './createWorkflowCondition'; -import { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule'; - -/** The details of a workflow transition rules. */ -export interface CreateWorkflowTransitionRulesDetails { - conditions?: CreateWorkflowCondition; - /** - * The workflow post functions. - * - * _Note:_* The default post functions are always added to the _initial_ transition, as in: - * - * "postFunctions": [ - * { - * "type": "IssueCreateFunction" - * }, - * { - * "type": "IssueReindexFunction" - * }, - * { - * "type": "FireIssueEventFunction", - * "configuration": { - * "event": { - * "id": "1", - * "name": "issue_created" - * } - * } - * } - * ] - * - * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: - * - * "postFunctions": [ - * { - * "type": "UpdateIssueStatusFunction" - * }, - * { - * "type": "CreateCommentFunction" - * }, - * { - * "type": "GenerateChangeHistoryFunction" - * }, - * { - * "type": "IssueReindexFunction" - * }, - * { - * "type": "FireIssueEventFunction", - * "configuration": { - * "event": { - * "id": "13", - * "name": "issue_generic" - * } - * } - * } - * ] - */ - postFunctions?: CreateWorkflowTransitionRule[]; - /** - * The workflow validators. - * - * _Note:_* The default permission validator is always added to the _initial_ transition, as in: - * - * "validators": [ - * { - * "type": "PermissionValidator", - * "configuration": { - * "permissionKey": "CREATE_ISSUES" - * } - * } - * ] - */ - validators?: CreateWorkflowTransitionRule[]; -} diff --git a/src/version2/models/createWorkflowTransitionScreenDetails.ts b/src/version2/models/createWorkflowTransitionScreenDetails.mts similarity index 100% rename from src/version2/models/createWorkflowTransitionScreenDetails.ts rename to src/version2/models/createWorkflowTransitionScreenDetails.mts diff --git a/src/version2/models/createdIssue.mts b/src/version2/models/createdIssue.mts new file mode 100644 index 0000000000..9c2c741b32 --- /dev/null +++ b/src/version2/models/createdIssue.mts @@ -0,0 +1,13 @@ +import { NestedResponse } from './nestedResponse.mjs'; + +/** Details about a created issue or subtask. */ +export interface CreatedIssue { + /** The ID of the created issue or subtask. */ + id: string; + /** The key of the created issue or subtask. */ + key: string; + /** The URL of the created issue or subtask. */ + self: string; + transition?: NestedResponse; + watchers?: NestedResponse; +} diff --git a/src/version2/models/createdIssue.ts b/src/version2/models/createdIssue.ts deleted file mode 100644 index aa78dd4879..0000000000 --- a/src/version2/models/createdIssue.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NestedResponse } from './nestedResponse'; - -/** Details about a created issue or subtask. */ -export interface CreatedIssue { - /** The ID of the created issue or subtask. */ - id: string; - /** The key of the created issue or subtask. */ - key: string; - /** The URL of the created issue or subtask. */ - self: string; - transition?: NestedResponse; - watchers?: NestedResponse; -} diff --git a/src/version2/models/createdIssues.mts b/src/version2/models/createdIssues.mts new file mode 100644 index 0000000000..449f8f8fb9 --- /dev/null +++ b/src/version2/models/createdIssues.mts @@ -0,0 +1,10 @@ +import { BulkOperationErrorResult } from './bulkOperationErrorResult.mjs'; +import { CreatedIssue } from './createdIssue.mjs'; + +/** Details about the issues created and the errors for requests that failed. */ +export interface CreatedIssues { + /** Error details for failed issue creation requests. */ + errors?: BulkOperationErrorResult[]; + /** Details of the issues created. */ + issues?: CreatedIssue[]; +} diff --git a/src/version2/models/createdIssues.ts b/src/version2/models/createdIssues.ts deleted file mode 100644 index bf048798b5..0000000000 --- a/src/version2/models/createdIssues.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BulkOperationErrorResult } from './bulkOperationErrorResult'; -import { CreatedIssue } from './createdIssue'; - -/** Details about the issues created and the errors for requests that failed. */ -export interface CreatedIssues { - /** Error details for failed issue creation requests. */ - errors?: BulkOperationErrorResult[]; - /** Details of the issues created. */ - issues?: CreatedIssue[]; -} diff --git a/src/version2/models/customContextVariable.ts b/src/version2/models/customContextVariable.mts similarity index 100% rename from src/version2/models/customContextVariable.ts rename to src/version2/models/customContextVariable.mts diff --git a/src/version2/models/customFieldConfigurations.mts b/src/version2/models/customFieldConfigurations.mts new file mode 100644 index 0000000000..40575ba1ed --- /dev/null +++ b/src/version2/models/customFieldConfigurations.mts @@ -0,0 +1,7 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** Details of configurations for a custom field. */ +export interface CustomFieldConfigurations { + /** The list of custom field configuration details. */ + configurations: ContextualConfiguration[]; +} diff --git a/src/version2/models/customFieldConfigurations.ts b/src/version2/models/customFieldConfigurations.ts deleted file mode 100644 index 40bc573c8d..0000000000 --- a/src/version2/models/customFieldConfigurations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ContextualConfiguration } from './contextualConfiguration'; - -/** Details of configurations for a custom field. */ -export interface CustomFieldConfigurations { - /** The list of custom field configuration details. */ - configurations: ContextualConfiguration[]; -} diff --git a/src/version2/models/customFieldContext.ts b/src/version2/models/customFieldContext.mts similarity index 100% rename from src/version2/models/customFieldContext.ts rename to src/version2/models/customFieldContext.mts diff --git a/src/version2/models/customFieldContextDefaultValue.ts b/src/version2/models/customFieldContextDefaultValue.mts similarity index 100% rename from src/version2/models/customFieldContextDefaultValue.ts rename to src/version2/models/customFieldContextDefaultValue.mts diff --git a/src/version2/models/customFieldContextDefaultValueUpdate.mts b/src/version2/models/customFieldContextDefaultValueUpdate.mts new file mode 100644 index 0000000000..4247319b72 --- /dev/null +++ b/src/version2/models/customFieldContextDefaultValueUpdate.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** Default values to update. */ +export interface CustomFieldContextDefaultValueUpdate { + defaultValues?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version2/models/customFieldContextDefaultValueUpdate.ts b/src/version2/models/customFieldContextDefaultValueUpdate.ts deleted file mode 100644 index c9bd5a4dc2..0000000000 --- a/src/version2/models/customFieldContextDefaultValueUpdate.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue'; - -/** Default values to update. */ -export interface CustomFieldContextDefaultValueUpdate { - defaultValues?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version2/models/customFieldContextOption.ts b/src/version2/models/customFieldContextOption.mts similarity index 100% rename from src/version2/models/customFieldContextOption.ts rename to src/version2/models/customFieldContextOption.mts diff --git a/src/version2/models/customFieldContextProjectMapping.ts b/src/version2/models/customFieldContextProjectMapping.mts similarity index 100% rename from src/version2/models/customFieldContextProjectMapping.ts rename to src/version2/models/customFieldContextProjectMapping.mts diff --git a/src/version2/models/customFieldContextUpdateDetails.ts b/src/version2/models/customFieldContextUpdateDetails.mts similarity index 100% rename from src/version2/models/customFieldContextUpdateDetails.ts rename to src/version2/models/customFieldContextUpdateDetails.mts diff --git a/src/version2/models/customFieldCreatedContextOptionsList.mts b/src/version2/models/customFieldCreatedContextOptionsList.mts new file mode 100644 index 0000000000..1ae6d0203c --- /dev/null +++ b/src/version2/models/customFieldCreatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldCreatedContextOptionsList { + /** The created custom field options. */ + options?: CustomFieldContextOption[]; +} diff --git a/src/version2/models/customFieldCreatedContextOptionsList.ts b/src/version2/models/customFieldCreatedContextOptionsList.ts deleted file mode 100644 index 9dac124a5d..0000000000 --- a/src/version2/models/customFieldCreatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldContextOption } from './customFieldContextOption'; - -/** A list of custom field options for a context. */ -export interface CustomFieldCreatedContextOptionsList { - /** The created custom field options. */ - options?: CustomFieldContextOption[]; -} diff --git a/src/version2/models/customFieldDefinitionJson.mts b/src/version2/models/customFieldDefinitionJson.mts new file mode 100644 index 0000000000..fdb6e97f05 --- /dev/null +++ b/src/version2/models/customFieldDefinitionJson.mts @@ -0,0 +1,61 @@ +export interface CustomFieldDefinitionJson { + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: string; + /** The description of the custom field, which is displayed in Jira. */ + description?: string; + /** + * The type of the custom field. These built-in custom field types are available: + * + * `cascadingselect`: Enables values to be selected from two levels of select lists (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a + * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates + * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: + * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using + * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) + * `multiselect`: Stores multiple values using a select list (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using + * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: + * Stores multiple versions from the versions available in a project using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of + * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * `radiobuttons`: Stores a value using radio buttons (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, + * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * `select`: Stores a value from a configurable list of options (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline + * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string + * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a + * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a + * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), + * use the ID of the Forge custom field type as the value. For example, + * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: string; + /** + * The searcher defines the way the field is searched in Jira. For example, + * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and Jql + * search) will display different operations and values for the field, based on the field searcher. You must specify a + * searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: + * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` + * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` + * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` + * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: + * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` + * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) + * have a searcher set automatically, so are always searchable. + */ + searcherKey?: string; +} diff --git a/src/version2/models/customFieldDefinitionJson.ts b/src/version2/models/customFieldDefinitionJson.ts deleted file mode 100644 index b55d9a816e..0000000000 --- a/src/version2/models/customFieldDefinitionJson.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface CustomFieldDefinitionJson { - /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ - name: string; - /** The description of the custom field, which is displayed in Jira. */ - description?: string; - /** - * The type of the custom field. These built-in custom field types are available: - * - * `cascadingselect`: Enables values to be selected from two levels of select lists (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a - * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates - * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: - * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) - * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using - * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) - * `multiselect`: Stores multiple values using a select list (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using - * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: - * Stores multiple versions from the versions available in a project using a picker control (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of - * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) - * `radiobuttons`: Stores a value using radio buttons (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, - * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) - * `select`: Stores a value from a configurable list of options (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline - * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string - * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a - * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a - * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) - * - * To create a field based on a [Forge custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), - * use the ID of the Forge custom field type as the value. For example, - * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. - */ - type: string; - /** - * The searcher defines the way the field is searched in Jira. For example, - * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL - * search) will display different operations and values for the field, based on the field searcher. You must specify a - * searcher that is valid for the field type, as listed below (abbreviated values shown): - * - * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: - * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` - * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` - * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` - * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: - * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` - * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` - * - * If no searcher is provided, the field isn't searchable. However, [Forge custom - * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) - * have a searcher set automatically, so are always searchable. - */ - searcherKey?: string; -} diff --git a/src/version2/models/customFieldOption.ts b/src/version2/models/customFieldOption.mts similarity index 100% rename from src/version2/models/customFieldOption.ts rename to src/version2/models/customFieldOption.mts diff --git a/src/version2/models/customFieldOptionCreate.ts b/src/version2/models/customFieldOptionCreate.mts similarity index 100% rename from src/version2/models/customFieldOptionCreate.ts rename to src/version2/models/customFieldOptionCreate.mts diff --git a/src/version2/models/customFieldOptionUpdate.ts b/src/version2/models/customFieldOptionUpdate.mts similarity index 100% rename from src/version2/models/customFieldOptionUpdate.ts rename to src/version2/models/customFieldOptionUpdate.mts diff --git a/src/version2/models/customFieldReplacement.ts b/src/version2/models/customFieldReplacement.mts similarity index 100% rename from src/version2/models/customFieldReplacement.ts rename to src/version2/models/customFieldReplacement.mts diff --git a/src/version2/models/customFieldUpdatedContextOptionsList.mts b/src/version2/models/customFieldUpdatedContextOptionsList.mts new file mode 100644 index 0000000000..e9d8f14784 --- /dev/null +++ b/src/version2/models/customFieldUpdatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldUpdatedContextOptionsList { + /** The updated custom field options. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version2/models/customFieldUpdatedContextOptionsList.ts b/src/version2/models/customFieldUpdatedContextOptionsList.ts deleted file mode 100644 index 2f26a260f0..0000000000 --- a/src/version2/models/customFieldUpdatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldOptionUpdate } from './customFieldOptionUpdate'; - -/** A list of custom field options for a context. */ -export interface CustomFieldUpdatedContextOptionsList { - /** The updated custom field options. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version2/models/customFieldValueUpdate.ts b/src/version2/models/customFieldValueUpdate.mts similarity index 100% rename from src/version2/models/customFieldValueUpdate.ts rename to src/version2/models/customFieldValueUpdate.mts diff --git a/src/version2/models/customFieldValueUpdateDetails.mts b/src/version2/models/customFieldValueUpdateDetails.mts new file mode 100644 index 0000000000..2f7a27f5c7 --- /dev/null +++ b/src/version2/models/customFieldValueUpdateDetails.mts @@ -0,0 +1,7 @@ +import { CustomFieldValueUpdate } from './customFieldValueUpdate.mjs'; + +/** Details of updates for a custom field. */ +export interface CustomFieldValueUpdateDetails { + /** The list of custom field update details. */ + updates?: CustomFieldValueUpdate[]; +} diff --git a/src/version2/models/customFieldValueUpdateDetails.ts b/src/version2/models/customFieldValueUpdateDetails.ts deleted file mode 100644 index ba1dc10b05..0000000000 --- a/src/version2/models/customFieldValueUpdateDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldValueUpdate } from './customFieldValueUpdate'; - -/** Details of updates for a custom field. */ -export interface CustomFieldValueUpdateDetails { - /** The list of custom field update details. */ - updates?: CustomFieldValueUpdate[]; -} diff --git a/src/version2/models/dashboard.mts b/src/version2/models/dashboard.mts new file mode 100644 index 0000000000..dba892cacd --- /dev/null +++ b/src/version2/models/dashboard.mts @@ -0,0 +1,32 @@ +import type { DashboardUser } from './dashboardUser.mjs'; +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface Dashboard { + description?: string; + /** The ID of the dashboard. */ + id: string; + /** Whether the dashboard is selected as a favorite by the user. */ + isFavourite?: boolean; + /** The name of the dashboard. */ + name?: string; + owner?: DashboardUser; + /** The number of users who have this dashboard as a favorite. */ + popularity?: number; + /** The rank of this dashboard. */ + rank?: number; + /** The URL of these dashboard details. */ + self?: string; + /** The details of any view share permissions for the dashboard. */ + sharePermissions?: SharePermission[]; + /** The details of any edit share permissions for the dashboard. */ + editPermissions?: SharePermission[]; + /** The automatic refresh interval for the dashboard in milliseconds. */ + automaticRefreshMs?: number; + /** The URL of the dashboard. */ + view?: string; + /** Whether the current user has permission to edit the dashboard. */ + isWritable?: boolean; + /** Whether the current dashboard is system dashboard. */ + systemDashboard?: boolean; +} diff --git a/src/version2/models/dashboard.ts b/src/version2/models/dashboard.ts deleted file mode 100644 index e680128cc0..0000000000 --- a/src/version2/models/dashboard.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { DashboardUser } from './dashboardUser'; -import { SharePermission } from './sharePermission'; - -/** Details of a dashboard. */ -export interface Dashboard { - description?: string; - /** The ID of the dashboard. */ - id: string; - /** Whether the dashboard is selected as a favorite by the user. */ - isFavourite?: boolean; - /** The name of the dashboard. */ - name?: string; - owner?: DashboardUser; - /** The number of users who have this dashboard as a favorite. */ - popularity?: number; - /** The rank of this dashboard. */ - rank?: number; - /** The URL of these dashboard details. */ - self?: string; - /** The details of any view share permissions for the dashboard. */ - sharePermissions?: SharePermission[]; - /** The details of any edit share permissions for the dashboard. */ - editPermissions?: SharePermission[]; - /** The automatic refresh interval for the dashboard in milliseconds. */ - automaticRefreshMs?: number; - /** The URL of the dashboard. */ - view?: string; - /** Whether the current user has permission to edit the dashboard. */ - isWritable?: boolean; - /** Whether the current dashboard is system dashboard. */ - systemDashboard?: boolean; -} diff --git a/src/version2/models/dashboardDetails.mts b/src/version2/models/dashboardDetails.mts new file mode 100644 index 0000000000..a164ef9799 --- /dev/null +++ b/src/version2/models/dashboardDetails.mts @@ -0,0 +1,13 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface DashboardDetails { + /** The description of the dashboard. */ + description?: string; + /** The edit permissions for the dashboard. */ + editPermissions: SharePermission[]; + /** The name of the dashboard. */ + name: string; + /** The share permissions for the dashboard. */ + sharePermissions: SharePermission[]; +} diff --git a/src/version2/models/dashboardDetails.ts b/src/version2/models/dashboardDetails.ts deleted file mode 100644 index 35fdb9b664..0000000000 --- a/src/version2/models/dashboardDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { SharePermission } from './sharePermission'; - -/** Details of a dashboard. */ -export interface DashboardDetails { - /** The description of the dashboard. */ - description?: string; - /** The edit permissions for the dashboard. */ - editPermissions: SharePermission[]; - /** The name of the dashboard. */ - name: string; - /** The share permissions for the dashboard. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version2/models/dashboardGadget.mts b/src/version2/models/dashboardGadget.mts new file mode 100644 index 0000000000..0c3011b653 --- /dev/null +++ b/src/version2/models/dashboardGadget.mts @@ -0,0 +1,16 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of a gadget. */ +export interface DashboardGadget { + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: string; + /** The ID of the gadget instance. */ + id: number; + /** The module key of the gadget type. */ + moduleKey?: string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title: string; + /** The URI of the gadget type. */ + uri?: string; +} diff --git a/src/version2/models/dashboardGadget.ts b/src/version2/models/dashboardGadget.ts deleted file mode 100644 index 3ca3b83957..0000000000 --- a/src/version2/models/dashboardGadget.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** Details of a gadget. */ -export interface DashboardGadget { - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color: string; - /** The ID of the gadget instance. */ - id: number; - /** The module key of the gadget type. */ - moduleKey?: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title: string; - /** The URI of the gadget type. */ - uri?: string; -} diff --git a/src/version2/models/dashboardGadgetPosition.ts b/src/version2/models/dashboardGadgetPosition.mts similarity index 100% rename from src/version2/models/dashboardGadgetPosition.ts rename to src/version2/models/dashboardGadgetPosition.mts diff --git a/src/version2/models/dashboardGadgetResponse.mts b/src/version2/models/dashboardGadgetResponse.mts new file mode 100644 index 0000000000..8d8d2c3bbf --- /dev/null +++ b/src/version2/models/dashboardGadgetResponse.mts @@ -0,0 +1,7 @@ +import { DashboardGadget } from './dashboardGadget.mjs'; + +/** The list of gadgets on the dashboard. */ +export interface DashboardGadgetResponse { + /** The list of gadgets. */ + gadgets: DashboardGadget[]; +} diff --git a/src/version2/models/dashboardGadgetResponse.ts b/src/version2/models/dashboardGadgetResponse.ts deleted file mode 100644 index 8b1d537985..0000000000 --- a/src/version2/models/dashboardGadgetResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DashboardGadget } from './dashboardGadget'; - -/** The list of gadgets on the dashboard. */ -export interface DashboardGadgetResponse { - /** The list of gadgets. */ - gadgets: DashboardGadget[]; -} diff --git a/src/version2/models/dashboardGadgetSettings.mts b/src/version2/models/dashboardGadgetSettings.mts new file mode 100644 index 0000000000..150af2f40d --- /dev/null +++ b/src/version2/models/dashboardGadgetSettings.mts @@ -0,0 +1,19 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of the settings for a dashboard gadget. */ +export interface DashboardGadgetSettings { + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey?: string; + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title?: string; + /** + * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an + * application that isn't installed. + */ + ignoreUriAndModuleKeyValidation?: boolean; +} diff --git a/src/version2/models/dashboardGadgetSettings.ts b/src/version2/models/dashboardGadgetSettings.ts deleted file mode 100644 index 94e624fa5d..0000000000 --- a/src/version2/models/dashboardGadgetSettings.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** Details of the settings for a dashboard gadget. */ -export interface DashboardGadgetSettings { - /** The module key of the gadget type. Can't be provided with `uri`. */ - moduleKey?: string; - /** The URI of the gadget type. Can't be provided with `moduleKey`. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title?: string; - /** - * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an - * application that isn't installed. - */ - ignoreUriAndModuleKeyValidation?: boolean; -} diff --git a/src/version2/models/dashboardGadgetUpdateRequest.mts b/src/version2/models/dashboardGadgetUpdateRequest.mts new file mode 100644 index 0000000000..039e7421cd --- /dev/null +++ b/src/version2/models/dashboardGadgetUpdateRequest.mts @@ -0,0 +1,10 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** The details of the gadget to update. */ +export interface DashboardGadgetUpdateRequest { + /** The title of the gadget. */ + title?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; + position?: DashboardGadgetPosition; +} diff --git a/src/version2/models/dashboardGadgetUpdateRequest.ts b/src/version2/models/dashboardGadgetUpdateRequest.ts deleted file mode 100644 index 796ce1a535..0000000000 --- a/src/version2/models/dashboardGadgetUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** The details of the gadget to update. */ -export interface DashboardGadgetUpdateRequest { - /** The title of the gadget. */ - title?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: 'blue' | 'red' | 'yellow' | 'green' | 'cyan' | 'purple' | 'gray' | 'white' | string; - position?: DashboardGadgetPosition; -} diff --git a/src/version2/models/dashboardUser.mts b/src/version2/models/dashboardUser.mts new file mode 100644 index 0000000000..723c864d5e --- /dev/null +++ b/src/version2/models/dashboardUser.mts @@ -0,0 +1,16 @@ +import { UserAvatarUrls } from './userAvatarUrls.mjs'; + +export interface DashboardUser { + /** The URL of the user. */ + self?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + avatarUrls?: UserAvatarUrls; +} diff --git a/src/version2/models/dashboardUser.ts b/src/version2/models/dashboardUser.ts deleted file mode 100644 index 8907f7d266..0000000000 --- a/src/version2/models/dashboardUser.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { UserAvatarUrls } from './userAvatarUrls'; - -export interface DashboardUser { - /** The URL of the user. */ - self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - avatarUrls?: UserAvatarUrls; -} diff --git a/src/version2/models/dateRangeFilter.ts b/src/version2/models/dateRangeFilter.mts similarity index 100% rename from src/version2/models/dateRangeFilter.ts rename to src/version2/models/dateRangeFilter.mts diff --git a/src/version2/models/defaultLevelValue.ts b/src/version2/models/defaultLevelValue.mts similarity index 100% rename from src/version2/models/defaultLevelValue.ts rename to src/version2/models/defaultLevelValue.mts diff --git a/src/version2/models/defaultShareScope.ts b/src/version2/models/defaultShareScope.mts similarity index 100% rename from src/version2/models/defaultShareScope.ts rename to src/version2/models/defaultShareScope.mts diff --git a/src/version2/models/defaultWorkflow.ts b/src/version2/models/defaultWorkflow.mts similarity index 100% rename from src/version2/models/defaultWorkflow.ts rename to src/version2/models/defaultWorkflow.mts diff --git a/src/version2/models/documentVersion.ts b/src/version2/models/documentVersion.mts similarity index 100% rename from src/version2/models/documentVersion.ts rename to src/version2/models/documentVersion.mts diff --git a/src/version2/models/entityProperty.ts b/src/version2/models/entityProperty.mts similarity index 100% rename from src/version2/models/entityProperty.ts rename to src/version2/models/entityProperty.mts diff --git a/src/version2/models/entityPropertyDetails.ts b/src/version2/models/entityPropertyDetails.mts similarity index 100% rename from src/version2/models/entityPropertyDetails.ts rename to src/version2/models/entityPropertyDetails.mts diff --git a/src/version2/models/error.ts b/src/version2/models/error.mts similarity index 100% rename from src/version2/models/error.ts rename to src/version2/models/error.mts diff --git a/src/version2/models/errorCollection.ts b/src/version2/models/errorCollection.mts similarity index 100% rename from src/version2/models/errorCollection.ts rename to src/version2/models/errorCollection.mts diff --git a/src/version2/models/errors.mts b/src/version2/models/errors.mts new file mode 100644 index 0000000000..f185578248 --- /dev/null +++ b/src/version2/models/errors.mts @@ -0,0 +1,8 @@ +import { Error } from './error.mjs'; + +export interface Errors { + issueIsSubtask?: Error; + issuesInArchivedProjects?: Error; + issuesInUnlicensedProjects?: Error; + issuesNotFound?: Error; +} diff --git a/src/version2/models/errors.ts b/src/version2/models/errors.ts deleted file mode 100644 index bc20bd9dd8..0000000000 --- a/src/version2/models/errors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Error } from './error'; - -export interface Errors { - issueIsSubtask?: Error; - issuesInArchivedProjects?: Error; - issuesInUnlicensedProjects?: Error; - issuesNotFound?: Error; -} diff --git a/src/version2/models/eventNotification.mts b/src/version2/models/eventNotification.mts new file mode 100644 index 0000000000..86b1a018db --- /dev/null +++ b/src/version2/models/eventNotification.mts @@ -0,0 +1,39 @@ +import { FieldDetails } from './fieldDetails.mjs'; +import type { GroupName } from './groupName.mjs'; +import type { ProjectRole } from './projectRole.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details about a notification associated with an event. */ +export interface EventNotification { + /** The email address. */ + emailAddress?: string; + /** Expand options that include additional event notification details in the response. */ + expand?: string; + field?: FieldDetails; + group?: GroupName; + /** The ID of the notification. */ + id?: number; + /** Identifies the recipients of the notification. */ + notificationType?: string; + /** + * As a group's name can change, use of `recipient` is recommended. The identifier associated with the + * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by + * `notificationType` value. So, when `notificationType` is: + * + * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The + * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. + * `GroupCustomField` The `parameter` is the ID of the custom field. + */ + parameter?: string; + projectRole?: ProjectRole; + /** + * The identifier associated with the `notificationType` value that defines the receiver of the notification, where + * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: + * + * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the + * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is + * the ID of the custom field. + */ + recipient?: string; + user?: UserDetails; +} diff --git a/src/version2/models/eventNotification.ts b/src/version2/models/eventNotification.ts deleted file mode 100644 index ed3e0e0e82..0000000000 --- a/src/version2/models/eventNotification.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { FieldDetails } from './fieldDetails'; -import { GroupName } from './groupName'; -import { ProjectRole } from './projectRole'; -import { UserDetails } from './userDetails'; - -/** Details about a notification associated with an event. */ -export interface EventNotification { - /** The email address. */ - emailAddress?: string; - /** Expand options that include additional event notification details in the response. */ - expand?: string; - field?: FieldDetails; - group?: GroupName; - /** The ID of the notification. */ - id?: number; - /** Identifies the recipients of the notification. */ - notificationType?: string; - /** - * As a group's name can change, use of `recipient` is recommended. The identifier associated with the - * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by - * `notificationType` value. So, when `notificationType` is: - * - * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The - * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. - * `GroupCustomField` The `parameter` is the ID of the custom field. - */ - parameter?: string; - projectRole?: ProjectRole; - /** - * The identifier associated with the `notificationType` value that defines the receiver of the notification, where - * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: - * - * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the - * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is - * the ID of the custom field. - */ - recipient?: string; - user?: UserDetails; -} diff --git a/src/version2/models/exportArchivedIssuesTaskProgress.ts b/src/version2/models/exportArchivedIssuesTaskProgress.mts similarity index 100% rename from src/version2/models/exportArchivedIssuesTaskProgress.ts rename to src/version2/models/exportArchivedIssuesTaskProgress.mts diff --git a/src/version2/models/failedWebhook.ts b/src/version2/models/failedWebhook.mts similarity index 100% rename from src/version2/models/failedWebhook.ts rename to src/version2/models/failedWebhook.mts diff --git a/src/version2/models/failedWebhooks.mts b/src/version2/models/failedWebhooks.mts new file mode 100644 index 0000000000..5e1534c803 --- /dev/null +++ b/src/version2/models/failedWebhooks.mts @@ -0,0 +1,18 @@ +import { FailedWebhook } from './failedWebhook.mjs'; + +/** A page of failed webhooks. */ +export interface FailedWebhooks { + /** + * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more + * pages. + */ + maxResults: number; + /** + * The URL to the next page of results. Present only if the request returned at least one result.The next page may be + * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to + * the next page and query for new results periodically (for example, every hour). + */ + next?: string; + /** The list of webhooks. */ + values: FailedWebhook[]; +} diff --git a/src/version2/models/failedWebhooks.ts b/src/version2/models/failedWebhooks.ts deleted file mode 100644 index 83559538b5..0000000000 --- a/src/version2/models/failedWebhooks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { FailedWebhook } from './failedWebhook'; - -/** A page of failed webhooks. */ -export interface FailedWebhooks { - /** - * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more - * pages. - */ - maxResults: number; - /** - * The URL to the next page of results. Present only if the request returned at least one result.The next page may be - * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to - * the next page and query for new results periodically (for example, every hour). - */ - next?: string; - /** The list of webhooks. */ - values: FailedWebhook[]; -} diff --git a/src/version2/models/field.mts b/src/version2/models/field.mts new file mode 100644 index 0000000000..3d3b62cc50 --- /dev/null +++ b/src/version2/models/field.mts @@ -0,0 +1,28 @@ +import { FieldLastUsed } from './fieldLastUsed.mjs'; +import { JsonType } from './jsonType.mjs'; + +/** Details of a field. */ +export interface Field { + /** Number of contexts where the field is used. */ + contextsCount?: number; + /** The description of the field. */ + description?: string; + /** The ID of the field. */ + id: string; + /** Whether the field is locked. */ + isLocked?: boolean; + /** Whether the field is shown on screen or not. */ + isUnscreenable?: boolean; + /** The key of the field. */ + key?: string; + lastUsed?: FieldLastUsed; + /** The name of the field. */ + name: string; + /** Number of projects where the field is used. */ + projectsCount?: number; + schema: JsonType; + /** Number of screens where the field is used. */ + screensCount?: number; + /** The searcher key of the field. Returned for custom fields. */ + searcherKey?: string; +} diff --git a/src/version2/models/field.ts b/src/version2/models/field.ts deleted file mode 100644 index 11baae0c86..0000000000 --- a/src/version2/models/field.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FieldLastUsed } from './fieldLastUsed'; -import { JsonType } from './jsonType'; - -/** Details of a field. */ -export interface Field { - /** Number of contexts where the field is used. */ - contextsCount?: number; - /** The description of the field. */ - description?: string; - /** The ID of the field. */ - id: string; - /** Whether the field is locked. */ - isLocked?: boolean; - /** Whether the field is shown on screen or not. */ - isUnscreenable?: boolean; - /** The key of the field. */ - key?: string; - lastUsed?: FieldLastUsed; - /** The name of the field. */ - name: string; - /** Number of projects where the field is used. */ - projectsCount?: number; - schema: JsonType; - /** Number of screens where the field is used. */ - screensCount?: number; - /** The searcher key of the field. Returned for custom fields. */ - searcherKey?: string; -} diff --git a/src/version2/models/fieldConfiguration.ts b/src/version2/models/fieldConfiguration.mts similarity index 100% rename from src/version2/models/fieldConfiguration.ts rename to src/version2/models/fieldConfiguration.mts diff --git a/src/version2/models/fieldConfigurationDetails.ts b/src/version2/models/fieldConfigurationDetails.mts similarity index 100% rename from src/version2/models/fieldConfigurationDetails.ts rename to src/version2/models/fieldConfigurationDetails.mts diff --git a/src/version2/models/fieldConfigurationIssueTypeItem.ts b/src/version2/models/fieldConfigurationIssueTypeItem.mts similarity index 100% rename from src/version2/models/fieldConfigurationIssueTypeItem.ts rename to src/version2/models/fieldConfigurationIssueTypeItem.mts diff --git a/src/version2/models/fieldConfigurationItem.ts b/src/version2/models/fieldConfigurationItem.mts similarity index 100% rename from src/version2/models/fieldConfigurationItem.ts rename to src/version2/models/fieldConfigurationItem.mts diff --git a/src/version2/models/fieldConfigurationItemsDetails.mts b/src/version2/models/fieldConfigurationItemsDetails.mts new file mode 100644 index 0000000000..05d214a2ce --- /dev/null +++ b/src/version2/models/fieldConfigurationItemsDetails.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** Details of field configuration items. */ +export interface FieldConfigurationItemsDetails { + /** Details of fields in a field configuration. */ + fieldConfigurationItems: FieldConfigurationItem[]; +} diff --git a/src/version2/models/fieldConfigurationItemsDetails.ts b/src/version2/models/fieldConfigurationItemsDetails.ts deleted file mode 100644 index 47685e551b..0000000000 --- a/src/version2/models/fieldConfigurationItemsDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { FieldConfigurationItem } from './fieldConfigurationItem'; - -/** Details of field configuration items. */ -export interface FieldConfigurationItemsDetails { - /** Details of fields in a field configuration. */ - fieldConfigurationItems: FieldConfigurationItem[]; -} diff --git a/src/version2/models/fieldConfigurationScheme.ts b/src/version2/models/fieldConfigurationScheme.mts similarity index 100% rename from src/version2/models/fieldConfigurationScheme.ts rename to src/version2/models/fieldConfigurationScheme.mts diff --git a/src/version2/models/fieldConfigurationSchemeProjectAssociation.ts b/src/version2/models/fieldConfigurationSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/fieldConfigurationSchemeProjectAssociation.ts rename to src/version2/models/fieldConfigurationSchemeProjectAssociation.mts diff --git a/src/version2/models/fieldConfigurationSchemeProjects.mts b/src/version2/models/fieldConfigurationSchemeProjects.mts new file mode 100644 index 0000000000..18d456c99f --- /dev/null +++ b/src/version2/models/fieldConfigurationSchemeProjects.mts @@ -0,0 +1,8 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** Project list with assigned field configuration schema. */ +export interface FieldConfigurationSchemeProjects { + fieldConfigurationScheme?: FieldConfigurationScheme; + /** The IDs of projects using the field configuration scheme. */ + projectIds: string[]; +} diff --git a/src/version2/models/fieldConfigurationSchemeProjects.ts b/src/version2/models/fieldConfigurationSchemeProjects.ts deleted file mode 100644 index cb59fdaf8d..0000000000 --- a/src/version2/models/fieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FieldConfigurationScheme } from './fieldConfigurationScheme'; - -/** Project list with assigned field configuration schema. */ -export interface FieldConfigurationSchemeProjects { - fieldConfigurationScheme?: FieldConfigurationScheme; - /** The IDs of projects using the field configuration scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/fieldConfigurationToIssueTypeMapping.ts b/src/version2/models/fieldConfigurationToIssueTypeMapping.mts similarity index 100% rename from src/version2/models/fieldConfigurationToIssueTypeMapping.ts rename to src/version2/models/fieldConfigurationToIssueTypeMapping.mts diff --git a/src/version2/models/fieldDetails.mts b/src/version2/models/fieldDetails.mts new file mode 100644 index 0000000000..7912ffb3bd --- /dev/null +++ b/src/version2/models/fieldDetails.mts @@ -0,0 +1,27 @@ +import { JsonType } from './jsonType.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a field. */ +export interface FieldDetails { + /** + * The names that can be used to reference the field in an advanced search. For more information, see [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). + */ + clauseNames?: string[]; + /** Whether the field is a custom field. */ + custom?: boolean; + /** The ID of the field. */ + id?: string; + /** The key of the field. */ + key?: string; + /** The name of the field. */ + name?: string; + /** Whether the field can be used as a column on the issue navigator. */ + navigable?: boolean; + /** Whether the content of the field can be used to order lists. */ + orderable?: boolean; + schema?: JsonType; + scope?: Scope; + /** Whether the content of the field can be searched. */ + searchable?: boolean; +} diff --git a/src/version2/models/fieldDetails.ts b/src/version2/models/fieldDetails.ts deleted file mode 100644 index f2fe580fae..0000000000 --- a/src/version2/models/fieldDetails.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { JsonType } from './jsonType'; -import { Scope } from './scope'; - -/** Details about a field. */ -export interface FieldDetails { - /** - * The names that can be used to reference the field in an advanced search. For more information, see [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). - */ - clauseNames?: string[]; - /** Whether the field is a custom field. */ - custom?: boolean; - /** The ID of the field. */ - id?: string; - /** The key of the field. */ - key?: string; - /** The name of the field. */ - name?: string; - /** Whether the field can be used as a column on the issue navigator. */ - navigable?: boolean; - /** Whether the content of the field can be used to order lists. */ - orderable?: boolean; - schema?: JsonType; - scope?: Scope; - /** Whether the content of the field can be searched. */ - searchable?: boolean; -} diff --git a/src/version2/models/fieldLastUsed.ts b/src/version2/models/fieldLastUsed.mts similarity index 100% rename from src/version2/models/fieldLastUsed.ts rename to src/version2/models/fieldLastUsed.mts diff --git a/src/version2/models/fieldMetadata.mts b/src/version2/models/fieldMetadata.mts new file mode 100644 index 0000000000..504c598645 --- /dev/null +++ b/src/version2/models/fieldMetadata.mts @@ -0,0 +1,24 @@ +import { JsonType } from './jsonType.mjs'; + +/** The metadata describing an issue field. */ +export interface FieldMetadata { + /** The list of values allowed in the field. */ + allowedValues?: any[]; + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl?: string; + /** The configuration properties. */ + configuration?: any; + /** The default value of the field. */ + defaultValue?: any; + /** 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/fieldMetadata.ts b/src/version2/models/fieldMetadata.ts deleted file mode 100644 index 255d970adc..0000000000 --- a/src/version2/models/fieldMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { JsonType } from './jsonType'; - -/** The metadata describing an issue field. */ -export interface FieldMetadata { - /** The list of values allowed in the field. */ - allowedValues?: any[]; - /** The URL that can be used to automatically complete the field. */ - autoCompleteUrl?: string; - /** The configuration properties. */ - configuration?: any; - /** The default value of the field. */ - defaultValue?: any; - /** 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/fieldReferenceData.ts b/src/version2/models/fieldReferenceData.mts similarity index 100% rename from src/version2/models/fieldReferenceData.ts rename to src/version2/models/fieldReferenceData.mts diff --git a/src/version2/models/fields.mts b/src/version2/models/fields.mts new file mode 100644 index 0000000000..d5610aa0a1 --- /dev/null +++ b/src/version2/models/fields.mts @@ -0,0 +1,98 @@ +import type { Attachment } from './attachment.mjs'; +import type { Comment } from './comment.mjs'; +import type { FixVersion } from './fixVersion.mjs'; +import type { Issue } from './issue.mjs'; +import type { IssueLink } from './issueLink.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { Priority } from './priority.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { Resolution } from './resolution.mjs'; +import type { RichText } from './richText.mjs'; +import type { StatusDetails } from './statusDetails.mjs'; +import type { TimeTrackingDetails } from './timeTrackingDetails.mjs'; +import { User } from './user.mjs'; +import { UserDetails } from './userDetails.mjs'; +import type { Votes } from './votes.mjs'; +import type { Watchers } from './watchers.mjs'; +import type { Worklog } from './worklog.mjs'; + +/** Key fields from the linked issue. */ +export interface Fields { + /** The estimate of how much longer working on the issue will take, in seconds. */ + aggregatetimespent: number | null; + /** The assignee of the linked issue. */ + assignee: UserDetails; + /** The list of issue attachments. */ + attachment: Attachment[]; + /** The list of issue comment. */ + comment: { + /** The list of issue comment. */ + comments: Comment[]; + self: string; + maxResults: number; + total: number; + startAt: number; + }; + /** The list of project components the issue belongs to. */ + components: ProjectComponent[]; + /** The creation time of the issue. */ + created: string; + /** The user who created the issue */ + creator: User; + /** The issue description. */ + description?: string; + /** The time the issue is due. */ + duedate: string | null; + /** The value of the environment field. */ + environment: RichText | null; + /** The list of versions where the issue was fixed. */ + fixVersions: FixVersion[]; + /** The list of issue links. */ + issuelinks: IssueLink[]; + issuerestriction?: { + issuerestrictions: any; + shouldDisplay: boolean; + }; + /** The type of the linked issue. */ + issuetype: IssueTypeDetails; + /** The list of labels associated with the issue. */ + labels: string[]; + lastViewed: string | null; + /** The issue parent. */ + parent?: Issue; + /** The priority of the linked issue. */ + priority: Priority; + /** The reporter of the issue. */ + reporter: User; + /** The resolution of the issue. */ + resolution: Resolution | null; + /** The time the issue was resolved at. */ + resolutiondate: string | null; + /** The status of the linked issue. */ + status: StatusDetails; + statuscategorychangedate?: string; + /** The list of subtasks. */ + subtasks: Issue[]; + /** The summary description of the linked issue. */ + summary: string; + timeoriginalestimate?: any; + /** The time that was spent working on the issue, in seconds. */ + timespent: number | null; + /** The time tracking of the linked issue. */ + timetracking: TimeTrackingDetails; + /** The time when the issue was last updated at. */ + updated: string; + /** The number of voters of the issue. Returns an error if voting is disabled. */ + votes: Votes & { voters: never }; + /** The number of watchers of the issue. Returns an error if watching is disabled. */ + watches: Watchers; + worklog: { + startAt: number; + maxResults: number; + total: number; + worklogs: Worklog[]; + }; + workratio: number; + + [key: string]: any; +} diff --git a/src/version2/models/fields.ts b/src/version2/models/fields.ts deleted file mode 100644 index 820f27c009..0000000000 --- a/src/version2/models/fields.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { Attachment } from './attachment'; -import { Comment } from './comment'; -import { FixVersion } from './fixVersion'; -import { Issue } from './issue'; -import { IssueLink } from './issueLink'; -import { IssueTypeDetails } from './issueTypeDetails'; -import { Priority } from './priority'; -import { ProjectComponent } from './projectComponent'; -import { Resolution } from './resolution'; -import { RichText } from './richText'; -import { StatusDetails } from './statusDetails'; -import { TimeTrackingDetails } from './timeTrackingDetails'; -import { User } from './user'; -import { UserDetails } from './userDetails'; -import { Votes } from './votes'; -import { Watchers } from './watchers'; -import { Worklog } from './worklog'; - -/** Key fields from the linked issue. */ -export interface Fields { - /** The estimate of how much longer working on the issue will take, in seconds. */ - aggregatetimespent: number | null; - /** The assignee of the linked issue. */ - assignee: UserDetails; - /** The list of issue attachments. */ - attachment: Attachment[]; - /** The list of issue comment. */ - comment: { - /** The list of issue comment. */ - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - /** The list of project components the issue belongs to. */ - components: ProjectComponent[]; - /** The creation time of the issue. */ - created: string; - /** The user who created the issue */ - creator: User; - /** The issue description. */ - description?: string; - /** The time the issue is due. */ - duedate: string | null; - /** The value of the environment field. */ - environment: RichText | null; - /** The list of versions where the issue was fixed. */ - fixVersions: FixVersion[]; - /** The list of issue links. */ - issuelinks: IssueLink[]; - issuerestriction?: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - /** The type of the linked issue. */ - issuetype: IssueTypeDetails; - /** The list of labels associated with the issue. */ - labels: string[]; - lastViewed: string | null; - /** The issue parent. */ - parent?: Issue; - /** The priority of the linked issue. */ - priority: Priority; - /** The reporter of the issue. */ - reporter: User; - /** The resolution of the issue. */ - resolution: Resolution | null; - /** The time the issue was resolved at. */ - resolutiondate: string | null; - /** The status of the linked issue. */ - status: StatusDetails; - statuscategorychangedate?: string; - /** The list of subtasks. */ - subtasks: Issue[]; - /** The summary description of the linked issue. */ - summary: string; - timeoriginalestimate?: any; - /** The time that was spent working on the issue, in seconds. */ - timespent: number | null; - /** The time tracking of the linked issue. */ - timetracking: TimeTrackingDetails; - /** The time when the issue was last updated at. */ - updated: string; - /** The number of voters of the issue. Returns an error if voting is disabled. */ - votes: Votes & { voters: never }; - /** The number of watchers of the issue. Returns an error if watching is disabled. */ - watches: Watchers; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - workratio: number; - - [key: string]: any; -} diff --git a/src/version2/models/filter.mts b/src/version2/models/filter.mts new file mode 100644 index 0000000000..0313502311 --- /dev/null +++ b/src/version2/models/filter.mts @@ -0,0 +1,40 @@ +import { FilterSubscriptionsList } from './filterSubscriptionsList.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; +import { UserList } from './userList.mjs'; + +/** Details about a filter. */ +export interface Filter { + /** 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; + owner?: User; + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * Jql](#api-rest-api-2-filter-search-get) operation with the filter's Jql string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl?: string; + /** The URL of the filter. */ + self?: string; + /** The groups and projects that the filter is shared with. */ + sharePermissions?: 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/version2/models/filter.ts b/src/version2/models/filter.ts deleted file mode 100644 index ac37b1db24..0000000000 --- a/src/version2/models/filter.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { FilterSubscriptionsList } from './filterSubscriptionsList'; -import { SharePermission } from './sharePermission'; -import { User } from './user'; -import { UserList } from './userList'; - -/** Details about a filter. */ -export interface Filter { - /** 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; - owner?: User; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** The URL of the filter. */ - self?: string; - /** The groups and projects that the filter is shared with. */ - sharePermissions?: 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/version2/models/filterDetails.mts b/src/version2/models/filterDetails.mts new file mode 100644 index 0000000000..a95ec545e3 --- /dev/null +++ b/src/version2/models/filterDetails.mts @@ -0,0 +1,47 @@ +import { FilterSubscription } from './filterSubscription.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; + +/** Details of a filter. */ +export interface FilterDetails { + /** The description of the filter. */ + description?: string; + /** + * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when + * creating a filter. + */ + editPermissions?: SharePermission[]; + /** Expand options that include additional filter details in the response. */ + expand?: string; + /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ + 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. */ + name: string; + owner?: User; + /** + * A URL to view the filter results in Jira, using the [Search for issues using + * Jql](#api-rest-api-2-filter-search-get) operation with the filter's Jql string to return the filter results. For + * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. + */ + searchUrl?: string; + /** The URL of the filter. */ + self?: string; + /** + * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when + * creating a filter. + */ + sharePermissions?: SharePermission[]; + /** The users that are subscribed to the filter. */ + subscriptions?: FilterSubscription[]; + /** + * 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/version2/models/filterDetails.ts b/src/version2/models/filterDetails.ts deleted file mode 100644 index d4b8b3d624..0000000000 --- a/src/version2/models/filterDetails.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { FilterSubscription } from './filterSubscription'; -import { SharePermission } from './sharePermission'; -import { User } from './user'; - -/** Details of a filter. */ -export interface FilterDetails { - /** The description of the filter. */ - description?: string; - /** - * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when - * creating a filter. - */ - editPermissions?: SharePermission[]; - /** Expand options that include additional filter details in the response. */ - expand?: string; - /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ - 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. */ - name: string; - owner?: User; - /** - * A URL to view the filter results in Jira, using the [Search for issues using - * JQL](#api-rest-api-2-filter-search-get) operation with the filter's JQL string to return the filter results. For - * example, _https://your-domain.atlassian.net/rest/api/2/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. - */ - searchUrl?: string; - /** The URL of the filter. */ - self?: string; - /** - * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when - * creating a filter. - */ - sharePermissions?: SharePermission[]; - /** The users that are subscribed to the filter. */ - subscriptions?: FilterSubscription[]; - /** - * 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/version2/models/filterSubscription.mts b/src/version2/models/filterSubscription.mts new file mode 100644 index 0000000000..70f66af1cd --- /dev/null +++ b/src/version2/models/filterSubscription.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import { User } from './user.mjs'; + +/** Details of a user or group subscribing to a filter. */ +export interface FilterSubscription { + group?: GroupName; + /** The ID of the filter subscription. */ + id?: number; + user?: User; +} diff --git a/src/version2/models/filterSubscription.ts b/src/version2/models/filterSubscription.ts deleted file mode 100644 index d5dd4380f2..0000000000 --- a/src/version2/models/filterSubscription.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GroupName } from './groupName'; -import { User } from './user'; - -/** Details of a user or group subscribing to a filter. */ -export interface FilterSubscription { - group?: GroupName; - /** The ID of the filter subscription. */ - id?: number; - user?: User; -} diff --git a/src/version2/models/filterSubscriptionsList.mts b/src/version2/models/filterSubscriptionsList.mts new file mode 100644 index 0000000000..1fb0281642 --- /dev/null +++ b/src/version2/models/filterSubscriptionsList.mts @@ -0,0 +1,15 @@ +import { FilterSubscription } from './filterSubscription.mjs'; + +/** A paginated list of subscriptions to a filter. */ +export interface FilterSubscriptionsList { + /** The index of the last item returned on the page. */ + 'end-index'?: number; + /** The list of items. */ + items?: FilterSubscription[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The number of items on the page. */ + size?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; +} diff --git a/src/version2/models/filterSubscriptionsList.ts b/src/version2/models/filterSubscriptionsList.ts deleted file mode 100644 index 35dd5b1f74..0000000000 --- a/src/version2/models/filterSubscriptionsList.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { FilterSubscription } from './filterSubscription'; - -/** A paginated list of subscriptions to a filter. */ -export interface FilterSubscriptionsList { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: FilterSubscription[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/fixVersion.ts b/src/version2/models/fixVersion.mts similarity index 100% rename from src/version2/models/fixVersion.ts rename to src/version2/models/fixVersion.mts diff --git a/src/version2/models/foundGroup.mts b/src/version2/models/foundGroup.mts new file mode 100644 index 0000000000..43219af1c7 --- /dev/null +++ b/src/version2/models/foundGroup.mts @@ -0,0 +1,15 @@ +import { GroupLabel } from './groupLabel.mjs'; + +/** A group found in a search. */ +export interface FoundGroup { + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; + /** The group name with the matched query string highlighted with the HTML bold tag. */ + html?: string; + labels?: GroupLabel[]; + /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ + name?: string; +} diff --git a/src/version2/models/foundGroup.ts b/src/version2/models/foundGroup.ts deleted file mode 100644 index c66e8a0b5c..0000000000 --- a/src/version2/models/foundGroup.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { GroupLabel } from './groupLabel'; - -/** A group found in a search. */ -export interface FoundGroup { - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The group name with the matched query string highlighted with the HTML bold tag. */ - html?: string; - labels?: GroupLabel[]; - /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ - name?: string; -} diff --git a/src/version2/models/foundGroups.mts b/src/version2/models/foundGroups.mts new file mode 100644 index 0000000000..c06940ca63 --- /dev/null +++ b/src/version2/models/foundGroups.mts @@ -0,0 +1,13 @@ +import { FoundGroup } from './foundGroup.mjs'; + +/** + * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched + * groups. + */ +export interface FoundGroups { + groups?: FoundGroup[]; + /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ + header?: string; + /** The total number of groups found in the search. */ + total?: number; +} diff --git a/src/version2/models/foundGroups.ts b/src/version2/models/foundGroups.ts deleted file mode 100644 index cf7e63f3ed..0000000000 --- a/src/version2/models/foundGroups.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FoundGroup } from './foundGroup'; - -/** - * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched - * groups. - */ -export interface FoundGroups { - groups?: FoundGroup[]; - /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ - header?: string; - /** The total number of groups found in the search. */ - total?: number; -} diff --git a/src/version2/models/foundUsers.mts b/src/version2/models/foundUsers.mts new file mode 100644 index 0000000000..1f480f2411 --- /dev/null +++ b/src/version2/models/foundUsers.mts @@ -0,0 +1,13 @@ +import { UserPickerUser } from './userPickerUser.mjs'; + +/** + * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched + * users. + */ +export interface FoundUsers { + /** Header text indicating the number of users in the response and the total number of users found in the search. */ + header?: string; + /** The total number of users found in the search. */ + total?: number; + users?: UserPickerUser[]; +} diff --git a/src/version2/models/foundUsers.ts b/src/version2/models/foundUsers.ts deleted file mode 100644 index 92a4f1a16b..0000000000 --- a/src/version2/models/foundUsers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UserPickerUser } from './userPickerUser'; - -/** - * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched - * users. - */ -export interface FoundUsers { - /** Header text indicating the number of users in the response and the total number of users found in the search. */ - header?: string; - /** The total number of users found in the search. */ - total?: number; - users?: UserPickerUser[]; -} diff --git a/src/version2/models/foundUsersAndGroups.mts b/src/version2/models/foundUsersAndGroups.mts new file mode 100644 index 0000000000..5d70ffcfe9 --- /dev/null +++ b/src/version2/models/foundUsersAndGroups.mts @@ -0,0 +1,8 @@ +import { FoundGroups } from './foundGroups.mjs'; +import { FoundUsers } from './foundUsers.mjs'; + +/** List of users and groups found in a search. */ +export interface FoundUsersAndGroups { + groups?: FoundGroups; + users?: FoundUsers; +} diff --git a/src/version2/models/foundUsersAndGroups.ts b/src/version2/models/foundUsersAndGroups.ts deleted file mode 100644 index 779d52f775..0000000000 --- a/src/version2/models/foundUsersAndGroups.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FoundGroups } from './foundGroups'; -import { FoundUsers } from './foundUsers'; - -/** List of users and groups found in a search. */ -export interface FoundUsersAndGroups { - groups?: FoundGroups; - users?: FoundUsers; -} diff --git a/src/version2/models/functionReferenceData.ts b/src/version2/models/functionReferenceData.mts similarity index 100% rename from src/version2/models/functionReferenceData.ts rename to src/version2/models/functionReferenceData.mts diff --git a/src/version2/models/globalScope.ts b/src/version2/models/globalScope.mts similarity index 100% rename from src/version2/models/globalScope.ts rename to src/version2/models/globalScope.mts diff --git a/src/version2/models/group.mts b/src/version2/models/group.mts new file mode 100644 index 0000000000..72e87a5421 --- /dev/null +++ b/src/version2/models/group.mts @@ -0,0 +1,16 @@ +import { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser.mjs'; + +export interface Group { + /** Expand options that include additional group details in the response. */ + expand?: string; + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; + /** The name of group. */ + name?: string; + /** The URL for these group details. */ + self?: string; + users?: PagedListUserDetailsApplicationUser; +} diff --git a/src/version2/models/group.ts b/src/version2/models/group.ts deleted file mode 100644 index 7ff70b6e7a..0000000000 --- a/src/version2/models/group.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser'; - -export interface Group { - /** Expand options that include additional group details in the response. */ - expand?: string; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The name of group. */ - name?: string; - /** The URL for these group details. */ - self?: string; - users?: PagedListUserDetailsApplicationUser; -} diff --git a/src/version2/models/groupDetails.ts b/src/version2/models/groupDetails.mts similarity index 100% rename from src/version2/models/groupDetails.ts rename to src/version2/models/groupDetails.mts diff --git a/src/version2/models/groupLabel.ts b/src/version2/models/groupLabel.mts similarity index 100% rename from src/version2/models/groupLabel.ts rename to src/version2/models/groupLabel.mts diff --git a/src/version2/models/groupName.ts b/src/version2/models/groupName.mts similarity index 100% rename from src/version2/models/groupName.ts rename to src/version2/models/groupName.mts diff --git a/src/version2/models/hierarchy.mts b/src/version2/models/hierarchy.mts new file mode 100644 index 0000000000..e118049eb9 --- /dev/null +++ b/src/version2/models/hierarchy.mts @@ -0,0 +1,7 @@ +import { HierarchyLevel } from './hierarchyLevel.mjs'; + +/** The project issue type hierarchy. */ +export interface Hierarchy { + /** Details about the hierarchy level. */ + levels?: HierarchyLevel[]; +} diff --git a/src/version2/models/hierarchy.ts b/src/version2/models/hierarchy.ts deleted file mode 100644 index 96fa6cdd4f..0000000000 --- a/src/version2/models/hierarchy.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { HierarchyLevel } from './hierarchyLevel'; - -/** The project issue type hierarchy. */ -export interface Hierarchy { - /** Details about the hierarchy level. */ - levels?: HierarchyLevel[]; -} diff --git a/src/version2/models/hierarchyLevel.ts b/src/version2/models/hierarchyLevel.mts similarity index 100% rename from src/version2/models/hierarchyLevel.ts rename to src/version2/models/hierarchyLevel.mts diff --git a/src/version2/models/historyMetadata.mts b/src/version2/models/historyMetadata.mts new file mode 100644 index 0000000000..06e4041d09 --- /dev/null +++ b/src/version2/models/historyMetadata.mts @@ -0,0 +1,24 @@ +import { HistoryMetadataParticipant } from './historyMetadataParticipant.mjs'; + +/** Details of issue history metadata. */ +export interface HistoryMetadata { + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + actor?: HistoryMetadataParticipant; + cause?: HistoryMetadataParticipant; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: {}; + generator?: HistoryMetadataParticipant; + /** The type of the history record. */ + type?: string; +} diff --git a/src/version2/models/historyMetadata.ts b/src/version2/models/historyMetadata.ts deleted file mode 100644 index 28f94003e3..0000000000 --- a/src/version2/models/historyMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { HistoryMetadataParticipant } from './historyMetadataParticipant'; - -/** Details of issue history metadata. */ -export interface HistoryMetadata { - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - actor?: HistoryMetadataParticipant; - cause?: HistoryMetadataParticipant; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - /** Additional arbitrary information about the history record. */ - extraData?: {}; - generator?: HistoryMetadataParticipant; - /** The type of the history record. */ - type?: string; -} diff --git a/src/version2/models/historyMetadataParticipant.ts b/src/version2/models/historyMetadataParticipant.mts similarity index 100% rename from src/version2/models/historyMetadataParticipant.ts rename to src/version2/models/historyMetadataParticipant.mts diff --git a/src/version2/models/icon.ts b/src/version2/models/icon.mts similarity index 100% rename from src/version2/models/icon.ts rename to src/version2/models/icon.mts diff --git a/src/version2/models/id.ts b/src/version2/models/id.mts similarity index 100% rename from src/version2/models/id.ts rename to src/version2/models/id.mts diff --git a/src/version2/models/idOrKey.ts b/src/version2/models/idOrKey.mts similarity index 100% rename from src/version2/models/idOrKey.ts rename to src/version2/models/idOrKey.mts diff --git a/src/version2/models/includedFields.ts b/src/version2/models/includedFields.mts similarity index 100% rename from src/version2/models/includedFields.ts rename to src/version2/models/includedFields.mts diff --git a/src/version2/models/index.mts b/src/version2/models/index.mts new file mode 100644 index 0000000000..1004c0e268 --- /dev/null +++ b/src/version2/models/index.mts @@ -0,0 +1,543 @@ +export * from './actorInput.mjs'; +export * from './actorsMap.mjs'; +export * from './addField.mjs'; +export * from './addGroup.mjs'; +export * from './addSecuritySchemeLevelsRequest.mjs'; +export * from './announcementBannerConfiguration.mjs'; +export * from './announcementBannerConfigurationUpdate.mjs'; +export * from './application.mjs'; +export * from './applicationProperty.mjs'; +export * from './applicationRole.mjs'; +export * from './associatedItem.mjs'; +export * from './associateFieldConfigurationsWithIssueTypesRequest.mjs'; +export * from './attachment.mjs'; +export * from './attachmentArchiveEntry.mjs'; +export * from './attachmentArchiveImpl.mjs'; +export * from './attachmentArchiveItemReadable.mjs'; +export * from './attachmentArchiveMetadataReadable.mjs'; +export * from './attachmentMetadata.mjs'; +export * from './attachmentSettings.mjs'; +export * from './auditRecord.mjs'; +export * from './auditRecords.mjs'; +export * from './autoCompleteSuggestion.mjs'; +export * from './autoCompleteSuggestions.mjs'; +export * from './availableDashboardGadget.mjs'; +export * from './availableDashboardGadgetsResponse.mjs'; +export * from './availableWorkflowConnectRule.mjs'; +export * from './availableWorkflowForgeRule.mjs'; +export * from './availableWorkflowSystemRule.mjs'; +export * from './availableWorkflowTriggers.mjs'; +export * from './availableWorkflowTriggerTypes.mjs'; +export * from './avatar.mjs'; +export * from './avatars.mjs'; +export * from './avatarUrls.mjs'; +export * from './avatarWithDetails.mjs'; +export * from './bulkChangeOwnerDetails.mjs'; +export * from './bulkCustomFieldOptionCreateRequest.mjs'; +export * from './bulkCustomFieldOptionUpdateRequest.mjs'; +export * from './bulkEditShareableEntity.mjs'; +export * from './bulkIssueIsWatching.mjs'; +export * from './bulkIssuePropertyUpdateRequest.mjs'; +export * from './bulkOperationErrorResult.mjs'; +export * from './bulkPermissionGrants.mjs'; +export * from './bulkPermissionsRequest.mjs'; +export * from './bulkProjectPermissionGrants.mjs'; +export * from './bulkProjectPermissions.mjs'; +export * from './changeDetails.mjs'; +export * from './changedValue.mjs'; +export * from './changedWorklog.mjs'; +export * from './changedWorklogs.mjs'; +export * from './changelog.mjs'; +export * from './columnItem.mjs'; +export * from './comment.mjs'; +export * from './componentIssuesCount.mjs'; +export * from './componentWithIssueCount.mjs'; +export * from './conditionGroupConfiguration.mjs'; +export * from './conditionGroupUpdate.mjs'; +export * from './configuration.mjs'; +export * from './connectCustomFieldValue.mjs'; +export * from './connectCustomFieldValues.mjs'; +export * from './connectModule.mjs'; +export * from './connectModules.mjs'; +export * from './connectWorkflowTransitionRule.mjs'; +export * from './containerForProjectFeatures.mjs'; +export * from './containerForRegisteredWebhooks.mjs'; +export * from './containerForWebhookIDs.mjs'; +export * from './containerOfWorkflowSchemeAssociations.mjs'; +export * from './contextForProjectAndIssueType.mjs'; +export * from './contextualConfiguration.mjs'; +export * from './convertedJQLQueries.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createdIssue.mjs'; +export * from './createdIssues.mjs'; +export * from './createIssueSecuritySchemeDetails.mjs'; +export * from './createNotificationSchemeDetails.mjs'; +export * from './createPriorityDetails.mjs'; +export * from './createProjectDetails.mjs'; +export * from './createResolutionDetails.mjs'; +export * from './createUiModificationDetails.mjs'; +export * from './createUpdateRoleRequest.mjs'; +export * from './createWorkflowCondition.mjs'; +export * from './createWorkflowDetails.mjs'; +export * from './createWorkflowStatusDetails.mjs'; +export * from './createWorkflowTransitionDetails.mjs'; +export * from './createWorkflowTransitionRule.mjs'; +export * from './createWorkflowTransitionRulesDetails.mjs'; +export * from './createWorkflowTransitionScreenDetails.mjs'; +export * from './customContextVariable.mjs'; +export * from './customFieldConfigurations.mjs'; +export * from './customFieldContext.mjs'; +export * from './customFieldContextDefaultValue.mjs'; +export * from './customFieldContextDefaultValueUpdate.mjs'; +export * from './customFieldContextOption.mjs'; +export * from './customFieldContextProjectMapping.mjs'; +export * from './customFieldContextUpdateDetails.mjs'; +export * from './customFieldCreatedContextOptionsList.mjs'; +export * from './customFieldDefinitionJson.mjs'; +export * from './customFieldOption.mjs'; +export * from './customFieldOptionCreate.mjs'; +export * from './customFieldOptionUpdate.mjs'; +export * from './customFieldReplacement.mjs'; +export * from './customFieldUpdatedContextOptionsList.mjs'; +export * from './customFieldValueUpdate.mjs'; +export * from './customFieldValueUpdateDetails.mjs'; +export * from './dashboard.mjs'; +export * from './dashboardDetails.mjs'; +export * from './dashboardGadget.mjs'; +export * from './dashboardGadgetPosition.mjs'; +export * from './dashboardGadgetResponse.mjs'; +export * from './dashboardGadgetSettings.mjs'; +export * from './dashboardGadgetUpdateRequest.mjs'; +export * from './dashboardUser.mjs'; +export * from './dateRangeFilter.mjs'; +export * from './defaultLevelValue.mjs'; +export * from './defaultShareScope.mjs'; +export * from './defaultWorkflow.mjs'; +export * from './documentVersion.mjs'; +export * from './entityProperty.mjs'; +export * from './entityPropertyDetails.mjs'; +export * from './error.mjs'; +export * from './errorCollection.mjs'; +export * from './errors.mjs'; +export * from './eventNotification.mjs'; +export * from './exportArchivedIssuesTaskProgress.mjs'; +export * from './failedWebhook.mjs'; +export * from './failedWebhooks.mjs'; +export * from './field.mjs'; +export * from './fieldConfiguration.mjs'; +export * from './fieldConfigurationDetails.mjs'; +export * from './fieldConfigurationIssueTypeItem.mjs'; +export * from './fieldConfigurationItem.mjs'; +export * from './fieldConfigurationItemsDetails.mjs'; +export * from './fieldConfigurationScheme.mjs'; +export * from './fieldConfigurationSchemeProjectAssociation.mjs'; +export * from './fieldConfigurationSchemeProjects.mjs'; +export * from './fieldConfigurationToIssueTypeMapping.mjs'; +export * from './fieldDetails.mjs'; +export * from './fieldLastUsed.mjs'; +export * from './fieldMetadata.mjs'; +export * from './fieldReferenceData.mjs'; +export * from './fields.mjs'; +export * from './filter.mjs'; +export * from './filterDetails.mjs'; +export * from './filterSubscription.mjs'; +export * from './filterSubscriptionsList.mjs'; +export * from './fixVersion.mjs'; +export * from './foundGroup.mjs'; +export * from './foundGroups.mjs'; +export * from './foundUsers.mjs'; +export * from './foundUsersAndGroups.mjs'; +export * from './functionReferenceData.mjs'; +export * from './globalScope.mjs'; +export * from './group.mjs'; +export * from './groupDetails.mjs'; +export * from './groupLabel.mjs'; +export * from './groupName.mjs'; +export * from './hierarchy.mjs'; +export * from './hierarchyLevel.mjs'; +export * from './historyMetadata.mjs'; +export * from './historyMetadataParticipant.mjs'; +export * from './icon.mjs'; +export * from './id.mjs'; +export * from './idOrKey.mjs'; +export * from './includedFields.mjs'; +export * from './issue.mjs'; +export * from './issueArchivalSync.mjs'; +export * from './issueChangelogIds.mjs'; +export * from './issueCommentListRequest.mjs'; +export * from './issueCreateMetadata.mjs'; +export * from './issueEntityProperties.mjs'; +export * from './issueEntityPropertiesForMultiUpdate.mjs'; +export * from './issueEvent.mjs'; +export * from './issueFieldOption.mjs'; +export * from './issueFieldOptionConfiguration.mjs'; +export * from './issueFieldOptionCreate.mjs'; +export * from './issueFieldOptionScope.mjs'; +export * from './issueFilterForBulkPropertyDelete.mjs'; +export * from './issueFilterForBulkPropertySet.mjs'; +export * from './issueLink.mjs'; +export * from './issueLinkType.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueList.mjs'; +export * from './issueMatches.mjs'; +export * from './issueMatchesForJQL.mjs'; +export * from './issuePickerSuggestions.mjs'; +export * from './issuePickerSuggestionsIssueType.mjs'; +export * from './issuesAndJQLQueries.mjs'; +export * from './issueSecurityLevelMember.mjs'; +export * from './issueSecuritySchemeToProjectMapping.mjs'; +export * from './issuesJqlMetaData.mjs'; +export * from './issuesMeta.mjs'; +export * from './issuesUpdate.mjs'; +export * from './issueTransition.mjs'; +export * from './issueTypeCreate.mjs'; +export * from './issueTypeDetails.mjs'; +export * from './issueTypeIds.mjs'; +export * from './issueTypeIdsToRemove.mjs'; +export * from './issueTypeInfo.mjs'; +export * from './issueTypeIssueCreateMetadata.mjs'; +export * from './issueTypeScheme.mjs'; +export * from './issueTypeSchemeDetails.mjs'; +export * from './issueTypeSchemeID.mjs'; +export * from './issueTypeSchemeMapping.mjs'; +export * from './issueTypeSchemeProjectAssociation.mjs'; +export * from './issueTypeSchemeProjects.mjs'; +export * from './issueTypeSchemeUpdateDetails.mjs'; +export * from './issueTypeScreenScheme.mjs'; +export * from './issueTypeScreenSchemeDetails.mjs'; +export * from './issueTypeScreenSchemeId.mjs'; +export * from './issueTypeScreenSchemeItem.mjs'; +export * from './issueTypeScreenSchemeMapping.mjs'; +export * from './issueTypeScreenSchemeMappingDetails.mjs'; +export * from './issueTypeScreenSchemeProjectAssociation.mjs'; +export * from './issueTypeScreenSchemesProjects.mjs'; +export * from './issueTypeScreenSchemeUpdateDetails.mjs'; +export * from './issueTypesWorkflowMapping.mjs'; +export * from './issueTypeToContextMapping.mjs'; +export * from './issueTypeUpdate.mjs'; +export * from './issueTypeWithStatus.mjs'; +export * from './issueTypeWorkflowMapping.mjs'; +export * from './issueUpdateDetails.mjs'; +export * from './issueUpdateMetadata.mjs'; +export * from './jexpIssues.mjs'; +export * from './jexpJqlIssues.mjs'; +export * from './jiraExpressionAnalysis.mjs'; +export * from './jiraExpressionComplexity.mjs'; +export * from './jiraExpressionEvalContext.mjs'; +export * from './jiraExpressionEvalRequest.mjs'; +export * from './jiraExpressionEvaluationMetaData.mjs'; +export * from './jiraExpressionForAnalysis.mjs'; +export * from './jiraExpressionResult.mjs'; +export * from './jiraExpressionsAnalysis.mjs'; +export * from './jiraExpressionsComplexity.mjs'; +export * from './jiraExpressionsComplexityValue.mjs'; +export * from './jiraExpressionValidationError.mjs'; +export * from './jiraStatus.mjs'; +export * from './jiraWorkflow.mjs'; +export * from './jiraWorkflowStatus.mjs'; +export * from './jqlFunctionPrecomputation.mjs'; +export * from './jqlFunctionPrecomputationUpdate.mjs'; +export * from './jqlFunctionPrecomputationUpdateRequest.mjs'; +export * from './jQLPersonalDataMigrationRequest.mjs'; +export * from './jqlQueriesToParse.mjs'; +export * from './jqlQueriesToSanitize.mjs'; +export * from './jqlQuery.mjs'; +export * from './jqlQueryClause.mjs'; +export * from './jqlQueryField.mjs'; +export * from './jqlQueryFieldEntityProperty.mjs'; +export * from './jqlQueryOrderByClause.mjs'; +export * from './jqlQueryOrderByClauseElement.mjs'; +export * from './jqlQueryToSanitize.mjs'; +export * from './jQLQueryWithUnknownUsers.mjs'; +export * from './jQLReferenceData.mjs'; +export * from './jsonType.mjs'; +export * from './license.mjs'; +export * from './licensedApplication.mjs'; +export * from './licenseMetric.mjs'; +export * from './linkedIssue.mjs'; +export * from './linkGroup.mjs'; +export * from './linkIssueRequestJson.mjs'; +export * from './listWrapperCallbackApplicationRole.mjs'; +export * from './listWrapperCallbackGroupName.mjs'; +export * from './locale.mjs'; +export * from './moveField.mjs'; +export * from './multiIssueEntityProperties.mjs'; +export * from './multipleCustomFieldValuesUpdate.mjs'; +export * from './multipleCustomFieldValuesUpdateDetails.mjs'; +export * from './nestedResponse.mjs'; +export * from './newUserDetails.mjs'; +export * from './notification.mjs'; +export * from './notificationEvent.mjs'; +export * from './notificationRecipients.mjs'; +export * from './notificationRecipientsRestrictions.mjs'; +export * from './notificationScheme.mjs'; +export * from './notificationSchemeAndProjectMapping.mjs'; +export * from './notificationSchemeAndProjectMappingPage.mjs'; +export * from './notificationSchemeEvent.mjs'; +export * from './notificationSchemeEventDetails.mjs'; +export * from './notificationSchemeEventTypeId.mjs'; +export * from './notificationSchemeId.mjs'; +export * from './notificationSchemeNotificationDetails.mjs'; +export * from './oldToNewSecurityLevelMappings.mjs'; +export * from './operationMessage.mjs'; +export * from './operations.mjs'; +export * from './orderOfCustomFieldOptions.mjs'; +export * from './orderOfIssueTypes.mjs'; +export * from './pageChangelog.mjs'; +export * from './pageComment.mjs'; +export * from './pageComponentWithIssueCount.mjs'; +export * from './pageContextForProjectAndIssueType.mjs'; +export * from './pageContextualConfiguration.mjs'; +export * from './pageCustomFieldContext.mjs'; +export * from './pageCustomFieldContextDefaultValue.mjs'; +export * from './pageCustomFieldContextOption.mjs'; +export * from './pageCustomFieldContextProjectMapping.mjs'; +export * from './pageDashboard.mjs'; +export * from './pagedListUserDetailsApplicationUser.mjs'; +export * from './pageField.mjs'; +export * from './pageFieldConfiguration.mjs'; +export * from './pageFieldConfigurationIssueTypeItem.mjs'; +export * from './pageFieldConfigurationItem.mjs'; +export * from './pageFieldConfigurationScheme.mjs'; +export * from './pageFieldConfigurationSchemeProjects.mjs'; +export * from './pageFilterDetails.mjs'; +export * from './pageGroupDetails.mjs'; +export * from './pageIssueFieldOption.mjs'; +export * from './pageIssueSecurityLevelMember.mjs'; +export * from './pageIssueSecuritySchemeToProjectMapping.mjs'; +export * from './pageIssueTypeScheme.mjs'; +export * from './pageIssueTypeSchemeMapping.mjs'; +export * from './pageIssueTypeSchemeProjects.mjs'; +export * from './pageIssueTypeScreenScheme.mjs'; +export * from './pageIssueTypeScreenSchemeItem.mjs'; +export * from './pageIssueTypeScreenSchemesProjects.mjs'; +export * from './pageIssueTypeToContextMapping.mjs'; +export * from './pageJqlFunctionPrecomputation.mjs'; +export * from './pageNotificationScheme.mjs'; +export * from './pageOfChangelogs.mjs'; +export * from './pageOfComments.mjs'; +export * from './pageOfDashboards.mjs'; +export * from './pageOfStatuses.mjs'; +export * from './pageOfWorklogs.mjs'; +export * from './pagePriority.mjs'; +export * from './pageProject.mjs'; +export * from './pageProjectDetails.mjs'; +export * from './pageResolution.mjs'; +export * from './pageScreen.mjs'; +export * from './pageScreenScheme.mjs'; +export * from './pageScreenWithTab.mjs'; +export * from './pageSecurityLevel.mjs'; +export * from './pageSecurityLevelMember.mjs'; +export * from './pageSecuritySchemeWithProjects.mjs'; +export * from './pageString.mjs'; +export * from './pageUiModificationDetails.mjs'; +export * from './pageUser.mjs'; +export * from './pageUserDetails.mjs'; +export * from './pageUserKey.mjs'; +export * from './pageVersion.mjs'; +export * from './pageWebhook.mjs'; +export * from './pageWorkflow.mjs'; +export * from './pageWorkflowScheme.mjs'; +export * from './pageWorkflowTransitionRules.mjs'; +export * from './parsedJqlQueries.mjs'; +export * from './parsedJqlQuery.mjs'; +export * from './permissionDetails.mjs'; +export * from './permissionGrant.mjs'; +export * from './permissionGrants.mjs'; +export * from './permissionHolder.mjs'; +export * from './permissions.mjs'; +export * from './permissionScheme.mjs'; +export * from './permissionSchemes.mjs'; +export * from './permissionsKeys.mjs'; +export * from './permittedProjects.mjs'; +export * from './priority.mjs'; +export * from './priorityId.mjs'; +export * from './project.mjs'; +export * from './projectAndIssueTypePair.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategory.mjs'; +export * from './projectComponent.mjs'; +export * from './projectDetails.mjs'; +export * from './projectEmailAddress.mjs'; +export * from './projectFeature.mjs'; +export * from './projectFeatureToggleRequest.mjs'; +export * from './projectId.mjs'; +export * from './projectIdentifier.mjs'; +export * from './projectIdentifiers.mjs'; +export * from './projectIds.mjs'; +export * from './projectInsight.mjs'; +export * from './projectIssueCreateMetadata.mjs'; +export * from './projectIssueSecurityLevels.mjs'; +export * from './projectIssueTypeHierarchy.mjs'; +export * from './projectIssueTypeMapping.mjs'; +export * from './projectIssueTypeMappings.mjs'; +export * from './projectIssueTypes.mjs'; +export * from './projectIssueTypesHierarchyLevel.mjs'; +export * from './projectLandingPageInfo.mjs'; +export * from './projectPermissions.mjs'; +export * from './projectRole.mjs'; +export * from './projectRoleActorsUpdate.mjs'; +export * from './projectRoleDetails.mjs'; +export * from './projectRoleGroup.mjs'; +export * from './projectRoleUser.mjs'; +export * from './projectScope.mjs'; +export * from './projectType.mjs'; +export * from './propertyKey.mjs'; +export * from './propertyKeys.mjs'; +export * from './publishedWorkflowId.mjs'; +export * from './registeredWebhook.mjs'; +export * from './remoteIssueLink.mjs'; +export * from './remoteIssueLinkIdentifies.mjs'; +export * from './remoteIssueLinkRequest.mjs'; +export * from './remoteObject.mjs'; +export * from './reorderIssuePriorities.mjs'; +export * from './reorderIssueResolutionsRequest.mjs'; +export * from './resolution.mjs'; +export * from './resolutionId.mjs'; +export * from './restrictedPermission.mjs'; +export * from './richText.mjs'; +export * from './roleActor.mjs'; +export * from './ruleConfiguration.mjs'; +export * from './sanitizedJqlQueries.mjs'; +export * from './sanitizedJqlQuery.mjs'; +export * from './scope.mjs'; +export * from './screen.mjs'; +export * from './screenableField.mjs'; +export * from './screenableTab.mjs'; +export * from './screenDetails.mjs'; +export * from './screenScheme.mjs'; +export * from './screenSchemeDetails.mjs'; +export * from './screenSchemeId.mjs'; +export * from './screenTypes.mjs'; +export * from './screenWithTab.mjs'; +export * from './searchAutoComplete.mjs'; +export * from './searchRequest.mjs'; +export * from './searchResults.mjs'; +export * from './securityLevel.mjs'; +export * from './securityLevelMember.mjs'; +export * from './securityScheme.mjs'; +export * from './securitySchemeId.mjs'; +export * from './securitySchemeLevel.mjs'; +export * from './securitySchemeLevelMember.mjs'; +export * from './securitySchemeMembersRequest.mjs'; +export * from './securitySchemes.mjs'; +export * from './securitySchemeWithProjects.mjs'; +export * from './serverInformation.mjs'; +export * from './setDefaultLevelsRequest.mjs'; +export * from './setDefaultPriorityRequest.mjs'; +export * from './setDefaultResolutionRequest.mjs'; +export * from './sharePermission.mjs'; +export * from './sharePermissionInput.mjs'; +export * from './simpleApplicationProperty.mjs'; +export * from './simpleLink.mjs'; +export * from './simpleListWrapperApplicationRole.mjs'; +export * from './simpleListWrapperGroupName.mjs'; +export * from './status.mjs'; +export * from './statusCategory.mjs'; +export * from './statusCreate.mjs'; +export * from './statusCreateRequest.mjs'; +export * from './statusDetails.mjs'; +export * from './statusLayoutUpdate.mjs'; +export * from './statusMapping.mjs'; +export * from './statusMappingDTO.mjs'; +export * from './statusMigration.mjs'; +export * from './statusReferenceAndPort.mjs'; +export * from './statusScope.mjs'; +export * from './statusUpdate.mjs'; +export * from './statusUpdateRequest.mjs'; +export * from './suggestedIssue.mjs'; +export * from './systemAvatars.mjs'; +export * from './tabMetadata.mjs'; +export * from './taskProgressObject.mjs'; +export * from './timeTrackingConfiguration.mjs'; +export * from './timeTrackingDetails.mjs'; +export * from './timeTrackingProvider.mjs'; +export * from './transition.mjs'; +export * from './transitions.mjs'; +export * from './transitionScreenDetails.mjs'; +export * from './transitionUpdateDTO.mjs'; +export * from './uiModificationContextDetails.mjs'; +export * from './uiModificationDetails.mjs'; +export * from './uiModificationIdentifiers.mjs'; +export * from './unrestrictedUserEmail.mjs'; +export * from './updateCustomFieldDetails.mjs'; +export * from './updatedProjectCategory.mjs'; +export * from './updateFieldConfigurationSchemeDetails.mjs'; +export * from './updateIssueSecurityLevelDetails.mjs'; +export * from './updateIssueSecuritySchemeRequest.mjs'; +export * from './updateNotificationSchemeDetails.mjs'; +export * from './updatePriorityDetails.mjs'; +export * from './updateProjectDetails.mjs'; +export * from './updateResolutionDetails.mjs'; +export * from './updateScreenDetails.mjs'; +export * from './updateScreenSchemeDetails.mjs'; +export * from './updateScreenTypes.mjs'; +export * from './updateUiModificationDetails.mjs'; +export * from './updateUserToGroup.mjs'; +export * from './user.mjs'; +export * from './userAvatarUrls.mjs'; +export * from './userDetails.mjs'; +export * from './userKey.mjs'; +export * from './userList.mjs'; +export * from './userMigration.mjs'; +export * from './userPickerUser.mjs'; +export * from './validationOptionsForCreate.mjs'; +export * from './validationOptionsForUpdate.mjs'; +export * from './version.mjs'; +export * from './versionIssueCounts.mjs'; +export * from './versionIssuesStatus.mjs'; +export * from './versionMove.mjs'; +export * from './versionUnresolvedIssuesCount.mjs'; +export * from './versionUsageInCustomField.mjs'; +export * from './visibility.mjs'; +export * from './votes.mjs'; +export * from './warningCollection.mjs'; +export * from './watchers.mjs'; +export * from './webhook.mjs'; +export * from './webhookDetails.mjs'; +export * from './webhookRegistrationDetails.mjs'; +export * from './webhooksExpirationDate.mjs'; +export * from './workflow.mjs'; +export * from './workflowCapabilities.mjs'; +export * from './workflowCondition.mjs'; +export * from './workflowCreate.mjs'; +export * from './workflowCreateRequest.mjs'; +export * from './workflowCreateResponse.mjs'; +export * from './workflowElementReference.mjs'; +export * from './workflowId.mjs'; +export * from './workflowLayout.mjs'; +export * from './workflowOperations.mjs'; +export * from './workflowRead.mjs'; +export * from './workflowReferenceStatus.mjs'; +export * from './workflowRuleConfiguration.mjs'; +export * from './workflowRules.mjs'; +export * from './workflowRulesSearch.mjs'; +export * from './workflowRulesSearchDetails.mjs'; +export * from './workflowScheme.mjs'; +export * from './workflowSchemeAssociations.mjs'; +export * from './workflowSchemeIdName.mjs'; +export * from './workflowSchemeProjectAssociation.mjs'; +export * from './workflowScope.mjs'; +export * from './workflowStatus.mjs'; +export * from './workflowStatusAndPort.mjs'; +export * from './workflowStatusLayout.mjs'; +export * from './workflowStatusProperties.mjs'; +export * from './workflowStatusUpdate.mjs'; +export * from './workflowsWithTransitionRulesDetails.mjs'; +export * from './workflowTransition.mjs'; +export * from './workflowTransitionProperty.mjs'; +export * from './workflowTransitionRule.mjs'; +export * from './workflowTransitionRules.mjs'; +export * from './workflowTransitionRulesDetails.mjs'; +export * from './workflowTransitionRulesUpdate.mjs'; +export * from './workflowTransitionRulesUpdateErrorDetails.mjs'; +export * from './workflowTransitionRulesUpdateErrors.mjs'; +export * from './workflowTransitions.mjs'; +export * from './workflowTrigger.mjs'; +export * from './workflowUpdate.mjs'; +export * from './workflowUpdateRequest.mjs'; +export * from './workflowUpdateResponse.mjs'; +export * from './workflowValidationError.mjs'; +export * from './workflowValidationErrorList.mjs'; +export * from './worklog.mjs'; +export * from './worklogIdsRequest.mjs'; diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts deleted file mode 100644 index 63f87a2208..0000000000 --- a/src/version2/models/index.ts +++ /dev/null @@ -1,543 +0,0 @@ -export * from './actorInput'; -export * from './actorsMap'; -export * from './addField'; -export * from './addGroup'; -export * from './addSecuritySchemeLevelsRequest'; -export * from './announcementBannerConfiguration'; -export * from './announcementBannerConfigurationUpdate'; -export * from './application'; -export * from './applicationProperty'; -export * from './applicationRole'; -export * from './associatedItem'; -export * from './associateFieldConfigurationsWithIssueTypesRequest'; -export * from './attachment'; -export * from './attachmentArchiveEntry'; -export * from './attachmentArchiveImpl'; -export * from './attachmentArchiveItemReadable'; -export * from './attachmentArchiveMetadataReadable'; -export * from './attachmentMetadata'; -export * from './attachmentSettings'; -export * from './auditRecord'; -export * from './auditRecords'; -export * from './autoCompleteSuggestion'; -export * from './autoCompleteSuggestions'; -export * from './availableDashboardGadget'; -export * from './availableDashboardGadgetsResponse'; -export * from './availableWorkflowConnectRule'; -export * from './availableWorkflowForgeRule'; -export * from './availableWorkflowSystemRule'; -export * from './availableWorkflowTriggers'; -export * from './availableWorkflowTriggerTypes'; -export * from './avatar'; -export * from './avatars'; -export * from './avatarUrls'; -export * from './avatarWithDetails'; -export * from './bulkChangeOwnerDetails'; -export * from './bulkCustomFieldOptionCreateRequest'; -export * from './bulkCustomFieldOptionUpdateRequest'; -export * from './bulkEditShareableEntity'; -export * from './bulkIssueIsWatching'; -export * from './bulkIssuePropertyUpdateRequest'; -export * from './bulkOperationErrorResult'; -export * from './bulkPermissionGrants'; -export * from './bulkPermissionsRequest'; -export * from './bulkProjectPermissionGrants'; -export * from './bulkProjectPermissions'; -export * from './changeDetails'; -export * from './changedValue'; -export * from './changedWorklog'; -export * from './changedWorklogs'; -export * from './changelog'; -export * from './columnItem'; -export * from './comment'; -export * from './componentIssuesCount'; -export * from './componentWithIssueCount'; -export * from './conditionGroupConfiguration'; -export * from './conditionGroupUpdate'; -export * from './configuration'; -export * from './connectCustomFieldValue'; -export * from './connectCustomFieldValues'; -export * from './connectModule'; -export * from './connectModules'; -export * from './connectWorkflowTransitionRule'; -export * from './containerForProjectFeatures'; -export * from './containerForRegisteredWebhooks'; -export * from './containerForWebhookIDs'; -export * from './containerOfWorkflowSchemeAssociations'; -export * from './contextForProjectAndIssueType'; -export * from './contextualConfiguration'; -export * from './convertedJQLQueries'; -export * from './createCustomFieldContext'; -export * from './createdIssue'; -export * from './createdIssues'; -export * from './createIssueSecuritySchemeDetails'; -export * from './createNotificationSchemeDetails'; -export * from './createPriorityDetails'; -export * from './createProjectDetails'; -export * from './createResolutionDetails'; -export * from './createUiModificationDetails'; -export * from './createUpdateRoleRequest'; -export * from './createWorkflowCondition'; -export * from './createWorkflowDetails'; -export * from './createWorkflowStatusDetails'; -export * from './createWorkflowTransitionDetails'; -export * from './createWorkflowTransitionRule'; -export * from './createWorkflowTransitionRulesDetails'; -export * from './createWorkflowTransitionScreenDetails'; -export * from './customContextVariable'; -export * from './customFieldConfigurations'; -export * from './customFieldContext'; -export * from './customFieldContextDefaultValue'; -export * from './customFieldContextDefaultValueUpdate'; -export * from './customFieldContextOption'; -export * from './customFieldContextProjectMapping'; -export * from './customFieldContextUpdateDetails'; -export * from './customFieldCreatedContextOptionsList'; -export * from './customFieldDefinitionJson'; -export * from './customFieldOption'; -export * from './customFieldOptionCreate'; -export * from './customFieldOptionUpdate'; -export * from './customFieldReplacement'; -export * from './customFieldUpdatedContextOptionsList'; -export * from './customFieldValueUpdate'; -export * from './customFieldValueUpdateDetails'; -export * from './dashboard'; -export * from './dashboardDetails'; -export * from './dashboardGadget'; -export * from './dashboardGadgetPosition'; -export * from './dashboardGadgetResponse'; -export * from './dashboardGadgetSettings'; -export * from './dashboardGadgetUpdateRequest'; -export * from './dashboardUser'; -export * from './dateRangeFilter'; -export * from './defaultLevelValue'; -export * from './defaultShareScope'; -export * from './defaultWorkflow'; -export * from './documentVersion'; -export * from './entityProperty'; -export * from './entityPropertyDetails'; -export * from './error'; -export * from './errorCollection'; -export * from './errors'; -export * from './eventNotification'; -export * from './exportArchivedIssuesTaskProgress'; -export * from './failedWebhook'; -export * from './failedWebhooks'; -export * from './field'; -export * from './fieldConfiguration'; -export * from './fieldConfigurationDetails'; -export * from './fieldConfigurationIssueTypeItem'; -export * from './fieldConfigurationItem'; -export * from './fieldConfigurationItemsDetails'; -export * from './fieldConfigurationScheme'; -export * from './fieldConfigurationSchemeProjectAssociation'; -export * from './fieldConfigurationSchemeProjects'; -export * from './fieldConfigurationToIssueTypeMapping'; -export * from './fieldDetails'; -export * from './fieldLastUsed'; -export * from './fieldMetadata'; -export * from './fieldReferenceData'; -export * from './fields'; -export * from './filter'; -export * from './filterDetails'; -export * from './filterSubscription'; -export * from './filterSubscriptionsList'; -export * from './fixVersion'; -export * from './foundGroup'; -export * from './foundGroups'; -export * from './foundUsers'; -export * from './foundUsersAndGroups'; -export * from './functionReferenceData'; -export * from './globalScope'; -export * from './group'; -export * from './groupDetails'; -export * from './groupLabel'; -export * from './groupName'; -export * from './hierarchy'; -export * from './hierarchyLevel'; -export * from './historyMetadata'; -export * from './historyMetadataParticipant'; -export * from './icon'; -export * from './id'; -export * from './idOrKey'; -export * from './includedFields'; -export * from './issue'; -export * from './issueArchivalSync'; -export * from './issueChangelogIds'; -export * from './issueCommentListRequest'; -export * from './issueCreateMetadata'; -export * from './issueEntityProperties'; -export * from './issueEntityPropertiesForMultiUpdate'; -export * from './issueEvent'; -export * from './issueFieldOption'; -export * from './issueFieldOptionConfiguration'; -export * from './issueFieldOptionCreate'; -export * from './issueFieldOptionScope'; -export * from './issueFilterForBulkPropertyDelete'; -export * from './issueFilterForBulkPropertySet'; -export * from './issueLink'; -export * from './issueLinkType'; -export * from './issueLinkTypes'; -export * from './issueList'; -export * from './issueMatches'; -export * from './issueMatchesForJQL'; -export * from './issuePickerSuggestions'; -export * from './issuePickerSuggestionsIssueType'; -export * from './issuesAndJQLQueries'; -export * from './issueSecurityLevelMember'; -export * from './issueSecuritySchemeToProjectMapping'; -export * from './issuesJqlMetaData'; -export * from './issuesMeta'; -export * from './issuesUpdate'; -export * from './issueTransition'; -export * from './issueTypeCreate'; -export * from './issueTypeDetails'; -export * from './issueTypeIds'; -export * from './issueTypeIdsToRemove'; -export * from './issueTypeInfo'; -export * from './issueTypeIssueCreateMetadata'; -export * from './issueTypeScheme'; -export * from './issueTypeSchemeDetails'; -export * from './issueTypeSchemeID'; -export * from './issueTypeSchemeMapping'; -export * from './issueTypeSchemeProjectAssociation'; -export * from './issueTypeSchemeProjects'; -export * from './issueTypeSchemeUpdateDetails'; -export * from './issueTypeScreenScheme'; -export * from './issueTypeScreenSchemeDetails'; -export * from './issueTypeScreenSchemeId'; -export * from './issueTypeScreenSchemeItem'; -export * from './issueTypeScreenSchemeMapping'; -export * from './issueTypeScreenSchemeMappingDetails'; -export * from './issueTypeScreenSchemeProjectAssociation'; -export * from './issueTypeScreenSchemesProjects'; -export * from './issueTypeScreenSchemeUpdateDetails'; -export * from './issueTypesWorkflowMapping'; -export * from './issueTypeToContextMapping'; -export * from './issueTypeUpdate'; -export * from './issueTypeWithStatus'; -export * from './issueTypeWorkflowMapping'; -export * from './issueUpdateDetails'; -export * from './issueUpdateMetadata'; -export * from './jexpIssues'; -export * from './jexpJqlIssues'; -export * from './jiraExpressionAnalysis'; -export * from './jiraExpressionComplexity'; -export * from './jiraExpressionEvalContext'; -export * from './jiraExpressionEvalRequest'; -export * from './jiraExpressionEvaluationMetaData'; -export * from './jiraExpressionForAnalysis'; -export * from './jiraExpressionResult'; -export * from './jiraExpressionsAnalysis'; -export * from './jiraExpressionsComplexity'; -export * from './jiraExpressionsComplexityValue'; -export * from './jiraExpressionValidationError'; -export * from './jiraStatus'; -export * from './jiraWorkflow'; -export * from './jiraWorkflowStatus'; -export * from './jqlFunctionPrecomputation'; -export * from './jqlFunctionPrecomputationUpdate'; -export * from './jqlFunctionPrecomputationUpdateRequest'; -export * from './jQLPersonalDataMigrationRequest'; -export * from './jqlQueriesToParse'; -export * from './jqlQueriesToSanitize'; -export * from './jqlQuery'; -export * from './jqlQueryClause'; -export * from './jqlQueryField'; -export * from './jqlQueryFieldEntityProperty'; -export * from './jqlQueryOrderByClause'; -export * from './jqlQueryOrderByClauseElement'; -export * from './jqlQueryToSanitize'; -export * from './jQLQueryWithUnknownUsers'; -export * from './jQLReferenceData'; -export * from './jsonType'; -export * from './license'; -export * from './licensedApplication'; -export * from './licenseMetric'; -export * from './linkedIssue'; -export * from './linkGroup'; -export * from './linkIssueRequestJson'; -export * from './listWrapperCallbackApplicationRole'; -export * from './listWrapperCallbackGroupName'; -export * from './locale'; -export * from './moveField'; -export * from './multiIssueEntityProperties'; -export * from './multipleCustomFieldValuesUpdate'; -export * from './multipleCustomFieldValuesUpdateDetails'; -export * from './nestedResponse'; -export * from './newUserDetails'; -export * from './notification'; -export * from './notificationEvent'; -export * from './notificationRecipients'; -export * from './notificationRecipientsRestrictions'; -export * from './notificationScheme'; -export * from './notificationSchemeAndProjectMapping'; -export * from './notificationSchemeAndProjectMappingPage'; -export * from './notificationSchemeEvent'; -export * from './notificationSchemeEventDetails'; -export * from './notificationSchemeEventTypeId'; -export * from './notificationSchemeId'; -export * from './notificationSchemeNotificationDetails'; -export * from './oldToNewSecurityLevelMappings'; -export * from './operationMessage'; -export * from './operations'; -export * from './orderOfCustomFieldOptions'; -export * from './orderOfIssueTypes'; -export * from './pageChangelog'; -export * from './pageComment'; -export * from './pageComponentWithIssueCount'; -export * from './pageContextForProjectAndIssueType'; -export * from './pageContextualConfiguration'; -export * from './pageCustomFieldContext'; -export * from './pageCustomFieldContextDefaultValue'; -export * from './pageCustomFieldContextOption'; -export * from './pageCustomFieldContextProjectMapping'; -export * from './pageDashboard'; -export * from './pagedListUserDetailsApplicationUser'; -export * from './pageField'; -export * from './pageFieldConfiguration'; -export * from './pageFieldConfigurationIssueTypeItem'; -export * from './pageFieldConfigurationItem'; -export * from './pageFieldConfigurationScheme'; -export * from './pageFieldConfigurationSchemeProjects'; -export * from './pageFilterDetails'; -export * from './pageGroupDetails'; -export * from './pageIssueFieldOption'; -export * from './pageIssueSecurityLevelMember'; -export * from './pageIssueSecuritySchemeToProjectMapping'; -export * from './pageIssueTypeScheme'; -export * from './pageIssueTypeSchemeMapping'; -export * from './pageIssueTypeSchemeProjects'; -export * from './pageIssueTypeScreenScheme'; -export * from './pageIssueTypeScreenSchemeItem'; -export * from './pageIssueTypeScreenSchemesProjects'; -export * from './pageIssueTypeToContextMapping'; -export * from './pageJqlFunctionPrecomputation'; -export * from './pageNotificationScheme'; -export * from './pageOfChangelogs'; -export * from './pageOfComments'; -export * from './pageOfDashboards'; -export * from './pageOfStatuses'; -export * from './pageOfWorklogs'; -export * from './pagePriority'; -export * from './pageProject'; -export * from './pageProjectDetails'; -export * from './pageResolution'; -export * from './pageScreen'; -export * from './pageScreenScheme'; -export * from './pageScreenWithTab'; -export * from './pageSecurityLevel'; -export * from './pageSecurityLevelMember'; -export * from './pageSecuritySchemeWithProjects'; -export * from './pageString'; -export * from './pageUiModificationDetails'; -export * from './pageUser'; -export * from './pageUserDetails'; -export * from './pageUserKey'; -export * from './pageVersion'; -export * from './pageWebhook'; -export * from './pageWorkflow'; -export * from './pageWorkflowScheme'; -export * from './pageWorkflowTransitionRules'; -export * from './parsedJqlQueries'; -export * from './parsedJqlQuery'; -export * from './permissionDetails'; -export * from './permissionGrant'; -export * from './permissionGrants'; -export * from './permissionHolder'; -export * from './permissions'; -export * from './permissionScheme'; -export * from './permissionSchemes'; -export * from './permissionsKeys'; -export * from './permittedProjects'; -export * from './priority'; -export * from './priorityId'; -export * from './project'; -export * from './projectAndIssueTypePair'; -export * from './projectAvatars'; -export * from './projectCategory'; -export * from './projectComponent'; -export * from './projectDetails'; -export * from './projectEmailAddress'; -export * from './projectFeature'; -export * from './projectFeatureToggleRequest'; -export * from './projectId'; -export * from './projectIdentifier'; -export * from './projectIdentifiers'; -export * from './projectIds'; -export * from './projectInsight'; -export * from './projectIssueCreateMetadata'; -export * from './projectIssueSecurityLevels'; -export * from './projectIssueTypeHierarchy'; -export * from './projectIssueTypeMapping'; -export * from './projectIssueTypeMappings'; -export * from './projectIssueTypes'; -export * from './projectIssueTypesHierarchyLevel'; -export * from './projectLandingPageInfo'; -export * from './projectPermissions'; -export * from './projectRole'; -export * from './projectRoleActorsUpdate'; -export * from './projectRoleDetails'; -export * from './projectRoleGroup'; -export * from './projectRoleUser'; -export * from './projectScope'; -export * from './projectType'; -export * from './propertyKey'; -export * from './propertyKeys'; -export * from './publishedWorkflowId'; -export * from './registeredWebhook'; -export * from './remoteIssueLink'; -export * from './remoteIssueLinkIdentifies'; -export * from './remoteIssueLinkRequest'; -export * from './remoteObject'; -export * from './reorderIssuePriorities'; -export * from './reorderIssueResolutionsRequest'; -export * from './resolution'; -export * from './resolutionId'; -export * from './restrictedPermission'; -export * from './richText'; -export * from './roleActor'; -export * from './ruleConfiguration'; -export * from './sanitizedJqlQueries'; -export * from './sanitizedJqlQuery'; -export * from './scope'; -export * from './screen'; -export * from './screenableField'; -export * from './screenableTab'; -export * from './screenDetails'; -export * from './screenScheme'; -export * from './screenSchemeDetails'; -export * from './screenSchemeId'; -export * from './screenTypes'; -export * from './screenWithTab'; -export * from './searchAutoComplete'; -export * from './searchRequest'; -export * from './searchResults'; -export * from './securityLevel'; -export * from './securityLevelMember'; -export * from './securityScheme'; -export * from './securitySchemeId'; -export * from './securitySchemeLevel'; -export * from './securitySchemeLevelMember'; -export * from './securitySchemeMembersRequest'; -export * from './securitySchemes'; -export * from './securitySchemeWithProjects'; -export * from './serverInformation'; -export * from './setDefaultLevelsRequest'; -export * from './setDefaultPriorityRequest'; -export * from './setDefaultResolutionRequest'; -export * from './sharePermission'; -export * from './sharePermissionInput'; -export * from './simpleApplicationProperty'; -export * from './simpleLink'; -export * from './simpleListWrapperApplicationRole'; -export * from './simpleListWrapperGroupName'; -export * from './status'; -export * from './statusCategory'; -export * from './statusCreate'; -export * from './statusCreateRequest'; -export * from './statusDetails'; -export * from './statusLayoutUpdate'; -export * from './statusMapping'; -export * from './statusMappingDTO'; -export * from './statusMigration'; -export * from './statusReferenceAndPort'; -export * from './statusScope'; -export * from './statusUpdate'; -export * from './statusUpdateRequest'; -export * from './suggestedIssue'; -export * from './systemAvatars'; -export * from './tabMetadata'; -export * from './taskProgressObject'; -export * from './timeTrackingConfiguration'; -export * from './timeTrackingDetails'; -export * from './timeTrackingProvider'; -export * from './transition'; -export * from './transitions'; -export * from './transitionScreenDetails'; -export * from './transitionUpdateDTO'; -export * from './uiModificationContextDetails'; -export * from './uiModificationDetails'; -export * from './uiModificationIdentifiers'; -export * from './unrestrictedUserEmail'; -export * from './updateCustomFieldDetails'; -export * from './updatedProjectCategory'; -export * from './updateFieldConfigurationSchemeDetails'; -export * from './updateIssueSecurityLevelDetails'; -export * from './updateIssueSecuritySchemeRequest'; -export * from './updateNotificationSchemeDetails'; -export * from './updatePriorityDetails'; -export * from './updateProjectDetails'; -export * from './updateResolutionDetails'; -export * from './updateScreenDetails'; -export * from './updateScreenSchemeDetails'; -export * from './updateScreenTypes'; -export * from './updateUiModificationDetails'; -export * from './updateUserToGroup'; -export * from './user'; -export * from './userAvatarUrls'; -export * from './userDetails'; -export * from './userKey'; -export * from './userList'; -export * from './userMigration'; -export * from './userPickerUser'; -export * from './validationOptionsForCreate'; -export * from './validationOptionsForUpdate'; -export * from './version'; -export * from './versionIssueCounts'; -export * from './versionIssuesStatus'; -export * from './versionMove'; -export * from './versionUnresolvedIssuesCount'; -export * from './versionUsageInCustomField'; -export * from './visibility'; -export * from './votes'; -export * from './warningCollection'; -export * from './watchers'; -export * from './webhook'; -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 './workflowCreateResponse'; -export * from './workflowElementReference'; -export * from './workflowId'; -export * from './workflowLayout'; -export * from './workflowOperations'; -export * from './workflowRead'; -export * from './workflowReferenceStatus'; -export * from './workflowRuleConfiguration'; -export * from './workflowRules'; -export * from './workflowRulesSearch'; -export * from './workflowRulesSearchDetails'; -export * from './workflowScheme'; -export * from './workflowSchemeAssociations'; -export * from './workflowSchemeIdName'; -export * from './workflowSchemeProjectAssociation'; -export * from './workflowScope'; -export * from './workflowStatus'; -export * from './workflowStatusAndPort'; -export * from './workflowStatusLayout'; -export * from './workflowStatusProperties'; -export * from './workflowStatusUpdate'; -export * from './workflowsWithTransitionRulesDetails'; -export * from './workflowTransition'; -export * from './workflowTransitionProperty'; -export * from './workflowTransitionRule'; -export * from './workflowTransitionRules'; -export * from './workflowTransitionRulesDetails'; -export * from './workflowTransitionRulesUpdate'; -export * from './workflowTransitionRulesUpdateErrorDetails'; -export * from './workflowTransitionRulesUpdateErrors'; -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'; diff --git a/src/version2/models/issue.mts b/src/version2/models/issue.mts new file mode 100644 index 0000000000..1cf3fb1b1e --- /dev/null +++ b/src/version2/models/issue.mts @@ -0,0 +1,35 @@ +import { Fields } from './fields.mjs'; +import { IncludedFields } from './includedFields.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; +import { IssueUpdateMetadata } from './issueUpdateMetadata.mjs'; +import { Operations } from './operations.mjs'; +import { PageOfChangelogs } from './pageOfChangelogs.mjs'; + +/** Details about an issue. */ +export interface Issue { + /** Expand options that include additional issue details in the response. */ + expand?: string; + /** The ID of the issue. */ + id: string; + /** The URL of the issue details. */ + self?: string; + /** The key of the issue. */ + key: string; + /** The rendered value of each field present on the issue. */ + renderedFields?: Fields; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The ID and name of each field present on the issue. */ + names?: Record; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The transitions that can be performed on the issue. */ + transitions?: IssueTransition[]; + operations?: Operations; + editmeta?: IssueUpdateMetadata; + changelog?: PageOfChangelogs; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; + fieldsToInclude?: IncludedFields; + fields: Fields; +} diff --git a/src/version2/models/issue.ts b/src/version2/models/issue.ts deleted file mode 100644 index 0841e19347..0000000000 --- a/src/version2/models/issue.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Fields } from './fields'; -import { IncludedFields } from './includedFields'; -import { IssueTransition } from './issueTransition'; -import { IssueUpdateMetadata } from './issueUpdateMetadata'; -import { Operations } from './operations'; -import { PageOfChangelogs } from './pageOfChangelogs'; - -/** Details about an issue. */ -export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: Fields; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The ID and name of each field present on the issue. */ - names?: Record; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The transitions that can be performed on the issue. */ - transitions?: IssueTransition[]; - operations?: Operations; - editmeta?: IssueUpdateMetadata; - changelog?: PageOfChangelogs; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; - fieldsToInclude?: IncludedFields; - fields: Fields; -} diff --git a/src/version2/models/issueArchivalSync.mts b/src/version2/models/issueArchivalSync.mts new file mode 100644 index 0000000000..f9277fa1ff --- /dev/null +++ b/src/version2/models/issueArchivalSync.mts @@ -0,0 +1,7 @@ +import { Errors } from './errors.mjs'; + +/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ +export interface IssueArchivalSync { + errors?: Errors; + numberOfIssuesUpdated?: number; +} diff --git a/src/version2/models/issueArchivalSync.ts b/src/version2/models/issueArchivalSync.ts deleted file mode 100644 index 8145c2a246..0000000000 --- a/src/version2/models/issueArchivalSync.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Errors } from './errors'; - -/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ -export interface IssueArchivalSync { - errors?: Errors; - numberOfIssuesUpdated?: number; -} diff --git a/src/version2/models/issueChangelogIds.ts b/src/version2/models/issueChangelogIds.mts similarity index 100% rename from src/version2/models/issueChangelogIds.ts rename to src/version2/models/issueChangelogIds.mts diff --git a/src/version2/models/issueCommentListRequest.ts b/src/version2/models/issueCommentListRequest.mts similarity index 100% rename from src/version2/models/issueCommentListRequest.ts rename to src/version2/models/issueCommentListRequest.mts diff --git a/src/version2/models/issueCreateMetadata.mts b/src/version2/models/issueCreateMetadata.mts new file mode 100644 index 0000000000..38cebd5da8 --- /dev/null +++ b/src/version2/models/issueCreateMetadata.mts @@ -0,0 +1,9 @@ +import { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata.mjs'; + +/** The wrapper for the issue creation metadata for a list of projects. */ +export interface IssueCreateMetadata { + /** Expand options that include additional project details in the response. */ + expand?: string; + /** List of projects and their issue creation metadata. */ + projects?: ProjectIssueCreateMetadata[]; +} diff --git a/src/version2/models/issueCreateMetadata.ts b/src/version2/models/issueCreateMetadata.ts deleted file mode 100644 index 79f5ea1286..0000000000 --- a/src/version2/models/issueCreateMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata'; - -/** The wrapper for the issue creation metadata for a list of projects. */ -export interface IssueCreateMetadata { - /** Expand options that include additional project details in the response. */ - expand?: string; - /** List of projects and their issue creation metadata. */ - projects?: ProjectIssueCreateMetadata[]; -} diff --git a/src/version2/models/issueEntityProperties.ts b/src/version2/models/issueEntityProperties.mts similarity index 100% rename from src/version2/models/issueEntityProperties.ts rename to src/version2/models/issueEntityProperties.mts diff --git a/src/version2/models/issueEntityPropertiesForMultiUpdate.ts b/src/version2/models/issueEntityPropertiesForMultiUpdate.mts similarity index 100% rename from src/version2/models/issueEntityPropertiesForMultiUpdate.ts rename to src/version2/models/issueEntityPropertiesForMultiUpdate.mts diff --git a/src/version2/models/issueEvent.ts b/src/version2/models/issueEvent.mts similarity index 100% rename from src/version2/models/issueEvent.ts rename to src/version2/models/issueEvent.mts diff --git a/src/version2/models/issueFieldOption.mts b/src/version2/models/issueFieldOption.mts new file mode 100644 index 0000000000..0a9d03e2c0 --- /dev/null +++ b/src/version2/models/issueFieldOption.mts @@ -0,0 +1,17 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +/** Details of the options for a select list issue field. */ +export interface IssueFieldOption { + config?: IssueFieldOptionConfiguration; + /** The unique identifier for the option. This is only unique within the select field's set of options. */ + id: number; + /** + * The properties of the object, as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see [Issue Field Option Property + * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined + * in the descriptor for the issue field module. + */ + properties?: Record; + /** The option's name, which is displayed in Jira. */ + value: string; +} diff --git a/src/version2/models/issueFieldOption.ts b/src/version2/models/issueFieldOption.ts deleted file mode 100644 index 1e84f48560..0000000000 --- a/src/version2/models/issueFieldOption.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration'; - -/** Details of the options for a select list issue field. */ -export interface IssueFieldOption { - config?: IssueFieldOptionConfiguration; - /** The unique identifier for the option. This is only unique within the select field's set of options. */ - id: number; - /** - * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see [Issue Field Option Property - * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined - * in the descriptor for the issue field module. - */ - properties?: Record; - /** The option's name, which is displayed in Jira. */ - value: string; -} diff --git a/src/version2/models/issueFieldOptionConfiguration.mts b/src/version2/models/issueFieldOptionConfiguration.mts new file mode 100644 index 0000000000..0b49ac3e4d --- /dev/null +++ b/src/version2/models/issueFieldOptionConfiguration.mts @@ -0,0 +1,6 @@ +import { IssueFieldOptionScope } from './issueFieldOptionScope.mjs'; + +/** Details of the projects the option is available in. */ +export interface IssueFieldOptionConfiguration { + scope?: IssueFieldOptionScope; +} diff --git a/src/version2/models/issueFieldOptionConfiguration.ts b/src/version2/models/issueFieldOptionConfiguration.ts deleted file mode 100644 index c1c8dfbbb6..0000000000 --- a/src/version2/models/issueFieldOptionConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueFieldOptionScope } from './issueFieldOptionScope'; - -/** Details of the projects the option is available in. */ -export interface IssueFieldOptionConfiguration { - scope?: IssueFieldOptionScope; -} diff --git a/src/version2/models/issueFieldOptionCreate.mts b/src/version2/models/issueFieldOptionCreate.mts new file mode 100644 index 0000000000..4a98a900a3 --- /dev/null +++ b/src/version2/models/issueFieldOptionCreate.mts @@ -0,0 +1,13 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +export interface IssueFieldOptionCreate { + config?: IssueFieldOptionConfiguration; + /** + * The properties of the option as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) + * are defined in the descriptor for the issue field module. + */ + properties?: {}; + /** The option's name, which is displayed in Jira. */ + value: string; +} diff --git a/src/version2/models/issueFieldOptionCreate.ts b/src/version2/models/issueFieldOptionCreate.ts deleted file mode 100644 index 3bbcfb9f90..0000000000 --- a/src/version2/models/issueFieldOptionCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration'; - -export interface IssueFieldOptionCreate { - config?: IssueFieldOptionConfiguration; - /** - * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) - * are defined in the descriptor for the issue field module. - */ - properties?: {}; - /** The option's name, which is displayed in Jira. */ - value: string; -} diff --git a/src/version2/models/issueFieldOptionScope.mts b/src/version2/models/issueFieldOptionScope.mts new file mode 100644 index 0000000000..2b332203c6 --- /dev/null +++ b/src/version2/models/issueFieldOptionScope.mts @@ -0,0 +1,12 @@ +import { GlobalScope } from './globalScope.mjs'; +import { ProjectScope } from './projectScope.mjs'; + +export interface IssueFieldOptionScope { + global?: GlobalScope; + /** + * Defines the projects in which the option is available and the behavior of the option within each project. Specify + * one object per project. The behavior of the option in a project context overrides the behavior in the global + * context. + */ + projects2?: ProjectScope[]; +} diff --git a/src/version2/models/issueFieldOptionScope.ts b/src/version2/models/issueFieldOptionScope.ts deleted file mode 100644 index 176147201c..0000000000 --- a/src/version2/models/issueFieldOptionScope.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { GlobalScope } from './globalScope'; -import { ProjectScope } from './projectScope'; - -export interface IssueFieldOptionScope { - global?: GlobalScope; - /** - * Defines the projects in which the option is available and the behavior of the option within each project. Specify - * one object per project. The behavior of the option in a project context overrides the behavior in the global - * context. - */ - projects2?: ProjectScope[]; -} diff --git a/src/version2/models/issueFilterForBulkPropertyDelete.ts b/src/version2/models/issueFilterForBulkPropertyDelete.mts similarity index 100% rename from src/version2/models/issueFilterForBulkPropertyDelete.ts rename to src/version2/models/issueFilterForBulkPropertyDelete.mts diff --git a/src/version2/models/issueFilterForBulkPropertySet.ts b/src/version2/models/issueFilterForBulkPropertySet.mts similarity index 100% rename from src/version2/models/issueFilterForBulkPropertySet.ts rename to src/version2/models/issueFilterForBulkPropertySet.mts diff --git a/src/version2/models/issueLink.mts b/src/version2/models/issueLink.mts new file mode 100644 index 0000000000..cf861979e0 --- /dev/null +++ b/src/version2/models/issueLink.mts @@ -0,0 +1,13 @@ +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +/** Details of a link between issues. */ +export interface IssueLink { + /** The ID of the issue link. */ + id?: string; + inwardIssue?: LinkedIssue; + outwardIssue?: LinkedIssue; + /** The URL of the issue link. */ + self?: string; + type?: IssueLinkType; +} diff --git a/src/version2/models/issueLink.ts b/src/version2/models/issueLink.ts deleted file mode 100644 index d941b802bc..0000000000 --- a/src/version2/models/issueLink.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IssueLinkType } from './issueLinkType'; -import { LinkedIssue } from './linkedIssue'; - -/** Details of a link between issues. */ -export interface IssueLink { - /** The ID of the issue link. */ - id?: string; - inwardIssue?: LinkedIssue; - outwardIssue?: LinkedIssue; - /** The URL of the issue link. */ - self?: string; - type?: IssueLinkType; -} diff --git a/src/version2/models/issueLinkType.ts b/src/version2/models/issueLinkType.mts similarity index 100% rename from src/version2/models/issueLinkType.ts rename to src/version2/models/issueLinkType.mts diff --git a/src/version2/models/issueLinkTypes.mts b/src/version2/models/issueLinkTypes.mts new file mode 100644 index 0000000000..696252c572 --- /dev/null +++ b/src/version2/models/issueLinkTypes.mts @@ -0,0 +1,7 @@ +import { IssueLinkType } from './issueLinkType.mjs'; + +/** A list of issue link type beans. */ +export interface IssueLinkTypes { + /** The issue link type bean. */ + issueLinkTypes?: IssueLinkType[]; +} diff --git a/src/version2/models/issueLinkTypes.ts b/src/version2/models/issueLinkTypes.ts deleted file mode 100644 index f630dc11a8..0000000000 --- a/src/version2/models/issueLinkTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IssueLinkType } from './issueLinkType'; - -/** A list of issue link type beans. */ -export interface IssueLinkTypes { - /** The issue link type bean. */ - issueLinkTypes?: IssueLinkType[]; -} diff --git a/src/version2/models/issueList.ts b/src/version2/models/issueList.mts similarity index 100% rename from src/version2/models/issueList.ts rename to src/version2/models/issueList.mts diff --git a/src/version2/models/issueMatches.mts b/src/version2/models/issueMatches.mts new file mode 100644 index 0000000000..2dea52f985 --- /dev/null +++ b/src/version2/models/issueMatches.mts @@ -0,0 +1,6 @@ +import { IssueMatchesForJQL } from './issueMatchesForJQL.mjs'; + +/** A list of matched issues or errors for each Jql query, in the order the Jql queries were passed. */ +export interface IssueMatches { + matches: IssueMatchesForJQL[]; +} diff --git a/src/version2/models/issueMatches.ts b/src/version2/models/issueMatches.ts deleted file mode 100644 index 63c11b61ce..0000000000 --- a/src/version2/models/issueMatches.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueMatchesForJQL } from './issueMatchesForJQL'; - -/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ -export interface IssueMatches { - matches: IssueMatchesForJQL[]; -} diff --git a/src/version2/models/issueMatchesForJQL.mts b/src/version2/models/issueMatchesForJQL.mts new file mode 100644 index 0000000000..7c6202dd22 --- /dev/null +++ b/src/version2/models/issueMatchesForJQL.mts @@ -0,0 +1,7 @@ +/** A list of the issues matched to a Jql query or details of errors encountered during matching. */ +export interface IssueMatchesForJQL { + /** A list of errors. */ + errors: string[]; + /** A list of issue IDs. */ + matchedIssues: number[]; +} diff --git a/src/version2/models/issueMatchesForJQL.ts b/src/version2/models/issueMatchesForJQL.ts deleted file mode 100644 index 3e641200c8..0000000000 --- a/src/version2/models/issueMatchesForJQL.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ -export interface IssueMatchesForJQL { - /** A list of errors. */ - errors: string[]; - /** A list of issue IDs. */ - matchedIssues: number[]; -} diff --git a/src/version2/models/issuePickerSuggestions.mts b/src/version2/models/issuePickerSuggestions.mts new file mode 100644 index 0000000000..3c49bbd5f9 --- /dev/null +++ b/src/version2/models/issuePickerSuggestions.mts @@ -0,0 +1,7 @@ +import { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType.mjs'; + +/** A list of issues suggested for use in auto-completion. */ +export interface IssuePickerSuggestions { + /** A list of issues for an issue type suggested for use in auto-completion. */ + sections?: IssuePickerSuggestionsIssueType[]; +} diff --git a/src/version2/models/issuePickerSuggestions.ts b/src/version2/models/issuePickerSuggestions.ts deleted file mode 100644 index 5f9628f291..0000000000 --- a/src/version2/models/issuePickerSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType'; - -/** A list of issues suggested for use in auto-completion. */ -export interface IssuePickerSuggestions { - /** A list of issues for an issue type suggested for use in auto-completion. */ - sections?: IssuePickerSuggestionsIssueType[]; -} diff --git a/src/version2/models/issuePickerSuggestionsIssueType.mts b/src/version2/models/issuePickerSuggestionsIssueType.mts new file mode 100644 index 0000000000..1b2af50903 --- /dev/null +++ b/src/version2/models/issuePickerSuggestionsIssueType.mts @@ -0,0 +1,15 @@ +import { SuggestedIssue } from './suggestedIssue.mjs'; + +/** A type of issue suggested for use in auto-completion. */ +export interface IssuePickerSuggestionsIssueType { + /** The ID of the type of issues suggested for use in auto-completion. */ + id?: string; + /** A list of issues suggested for use in auto-completion. */ + issues?: SuggestedIssue[]; + /** The label of the type of issues suggested for use in auto-completion. */ + label?: string; + /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ + msg?: string; + /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ + sub?: string; +} diff --git a/src/version2/models/issuePickerSuggestionsIssueType.ts b/src/version2/models/issuePickerSuggestionsIssueType.ts deleted file mode 100644 index 7059b446d2..0000000000 --- a/src/version2/models/issuePickerSuggestionsIssueType.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SuggestedIssue } from './suggestedIssue'; - -/** A type of issue suggested for use in auto-completion. */ -export interface IssuePickerSuggestionsIssueType { - /** The ID of the type of issues suggested for use in auto-completion. */ - id?: string; - /** A list of issues suggested for use in auto-completion. */ - issues?: SuggestedIssue[]; - /** The label of the type of issues suggested for use in auto-completion. */ - label?: string; - /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ - msg?: string; - /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ - sub?: string; -} diff --git a/src/version2/models/issueSecurityLevelMember.mts b/src/version2/models/issueSecurityLevelMember.mts new file mode 100644 index 0000000000..55dd86d70f --- /dev/null +++ b/src/version2/models/issueSecurityLevelMember.mts @@ -0,0 +1,10 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface IssueSecurityLevelMember { + holder?: PermissionHolder; + /** The ID of the issue security level member. */ + id: number; + /** The ID of the issue security level. */ + issueSecurityLevelId: number; +} diff --git a/src/version2/models/issueSecurityLevelMember.ts b/src/version2/models/issueSecurityLevelMember.ts deleted file mode 100644 index de2484348a..0000000000 --- a/src/version2/models/issueSecurityLevelMember.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PermissionHolder } from './permissionHolder'; - -/** Issue security level member. */ -export interface IssueSecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: number; - /** The ID of the issue security level. */ - issueSecurityLevelId: number; -} diff --git a/src/version2/models/issueSecuritySchemeToProjectMapping.ts b/src/version2/models/issueSecuritySchemeToProjectMapping.mts similarity index 100% rename from src/version2/models/issueSecuritySchemeToProjectMapping.ts rename to src/version2/models/issueSecuritySchemeToProjectMapping.mts diff --git a/src/version2/models/issueTransition.mts b/src/version2/models/issueTransition.mts new file mode 100644 index 0000000000..b9950dc2b2 --- /dev/null +++ b/src/version2/models/issueTransition.mts @@ -0,0 +1,31 @@ +import type { StatusDetails } from './statusDetails.mjs'; +import { TabMetadata } from './tabMetadata.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** The name of the issue transition. */ + name?: string; + to?: StatusDetails; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Details of the tabs associated with the issue transition screen and the fields within these tabs. */ + tabs?: TabMetadata[]; + /** Expand options that include additional transition details in the response. */ + expand?: string; + looped?: boolean; +} diff --git a/src/version2/models/issueTransition.ts b/src/version2/models/issueTransition.ts deleted file mode 100644 index ae99f4a4b8..0000000000 --- a/src/version2/models/issueTransition.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { StatusDetails } from './statusDetails'; -import { TabMetadata } from './tabMetadata'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Details of the tabs associated with the issue transition screen and the fields within these tabs. */ - tabs?: TabMetadata[]; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/version2/models/issueTypeCreate.ts b/src/version2/models/issueTypeCreate.mts similarity index 100% rename from src/version2/models/issueTypeCreate.ts rename to src/version2/models/issueTypeCreate.mts diff --git a/src/version2/models/issueTypeDetails.mts b/src/version2/models/issueTypeDetails.mts new file mode 100644 index 0000000000..79531408f1 --- /dev/null +++ b/src/version2/models/issueTypeDetails.mts @@ -0,0 +1,24 @@ +import type { Scope } from './scope.mjs'; + +/** Details about an issue type. */ +export interface IssueTypeDetails { + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The ID of the issue type. */ + id?: string; + /** The name of the issue type. */ + name?: string; + scope?: Scope; + /** The URL of these issue type details. */ + self?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; +} diff --git a/src/version2/models/issueTypeDetails.ts b/src/version2/models/issueTypeDetails.ts deleted file mode 100644 index eec638a08e..0000000000 --- a/src/version2/models/issueTypeDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Scope } from './scope'; - -/** Details about an issue type. */ -export interface IssueTypeDetails { - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The ID of the issue type. */ - id?: string; - /** The name of the issue type. */ - name?: string; - scope?: Scope; - /** The URL of these issue type details. */ - self?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; -} diff --git a/src/version2/models/issueTypeIds.ts b/src/version2/models/issueTypeIds.mts similarity index 100% rename from src/version2/models/issueTypeIds.ts rename to src/version2/models/issueTypeIds.mts diff --git a/src/version2/models/issueTypeIdsToRemove.ts b/src/version2/models/issueTypeIdsToRemove.mts similarity index 100% rename from src/version2/models/issueTypeIdsToRemove.ts rename to src/version2/models/issueTypeIdsToRemove.mts diff --git a/src/version2/models/issueTypeInfo.ts b/src/version2/models/issueTypeInfo.mts similarity index 100% rename from src/version2/models/issueTypeInfo.ts rename to src/version2/models/issueTypeInfo.mts diff --git a/src/version2/models/issueTypeIssueCreateMetadata.mts b/src/version2/models/issueTypeIssueCreateMetadata.mts new file mode 100644 index 0000000000..04ba5df636 --- /dev/null +++ b/src/version2/models/issueTypeIssueCreateMetadata.mts @@ -0,0 +1,28 @@ +import type { Scope } from './scope.mjs'; + +/** Details of the issue creation metadata for an issue type. */ +export interface IssueTypeIssueCreateMetadata { + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Expand options that include additional issue type metadata details in the response. */ + expand?: string; + /** List of the fields available when creating an issue for the issue type. */ + fields?: {}; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The ID of the issue type. */ + id?: string; + /** The name of the issue type. */ + name?: string; + scope?: Scope; + /** The URL of these issue type details. */ + self?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; +} diff --git a/src/version2/models/issueTypeIssueCreateMetadata.ts b/src/version2/models/issueTypeIssueCreateMetadata.ts deleted file mode 100644 index 6cd2a7c84e..0000000000 --- a/src/version2/models/issueTypeIssueCreateMetadata.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Scope } from './scope'; - -/** Details of the issue creation metadata for an issue type. */ -export interface IssueTypeIssueCreateMetadata { - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** The description of the issue type. */ - description?: string; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Expand options that include additional issue type metadata details in the response. */ - expand?: string; - /** List of the fields available when creating an issue for the issue type. */ - fields?: {}; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The ID of the issue type. */ - id?: string; - /** The name of the issue type. */ - name?: string; - scope?: Scope; - /** The URL of these issue type details. */ - self?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; -} diff --git a/src/version2/models/issueTypeScheme.ts b/src/version2/models/issueTypeScheme.mts similarity index 100% rename from src/version2/models/issueTypeScheme.ts rename to src/version2/models/issueTypeScheme.mts diff --git a/src/version2/models/issueTypeSchemeDetails.ts b/src/version2/models/issueTypeSchemeDetails.mts similarity index 100% rename from src/version2/models/issueTypeSchemeDetails.ts rename to src/version2/models/issueTypeSchemeDetails.mts diff --git a/src/version2/models/issueTypeSchemeID.ts b/src/version2/models/issueTypeSchemeID.mts similarity index 100% rename from src/version2/models/issueTypeSchemeID.ts rename to src/version2/models/issueTypeSchemeID.mts diff --git a/src/version2/models/issueTypeSchemeMapping.ts b/src/version2/models/issueTypeSchemeMapping.mts similarity index 100% rename from src/version2/models/issueTypeSchemeMapping.ts rename to src/version2/models/issueTypeSchemeMapping.mts diff --git a/src/version2/models/issueTypeSchemeProjectAssociation.ts b/src/version2/models/issueTypeSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/issueTypeSchemeProjectAssociation.ts rename to src/version2/models/issueTypeSchemeProjectAssociation.mts diff --git a/src/version2/models/issueTypeSchemeProjects.mts b/src/version2/models/issueTypeSchemeProjects.mts new file mode 100644 index 0000000000..b975f1026d --- /dev/null +++ b/src/version2/models/issueTypeSchemeProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** Issue type scheme with a list of the projects that use it. */ +export interface IssueTypeSchemeProjects { + issueTypeScheme?: IssueTypeScheme; + /** The IDs of the projects using the issue type scheme. */ + projectIds: string[]; +} diff --git a/src/version2/models/issueTypeSchemeProjects.ts b/src/version2/models/issueTypeSchemeProjects.ts deleted file mode 100644 index 0efc988728..0000000000 --- a/src/version2/models/issueTypeSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeScheme } from './issueTypeScheme'; - -/** Issue type scheme with a list of the projects that use it. */ -export interface IssueTypeSchemeProjects { - issueTypeScheme?: IssueTypeScheme; - /** The IDs of the projects using the issue type scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/issueTypeSchemeUpdateDetails.ts b/src/version2/models/issueTypeSchemeUpdateDetails.mts similarity index 100% rename from src/version2/models/issueTypeSchemeUpdateDetails.ts rename to src/version2/models/issueTypeSchemeUpdateDetails.mts diff --git a/src/version2/models/issueTypeScreenScheme.ts b/src/version2/models/issueTypeScreenScheme.mts similarity index 100% rename from src/version2/models/issueTypeScreenScheme.ts rename to src/version2/models/issueTypeScreenScheme.mts diff --git a/src/version2/models/issueTypeScreenSchemeDetails.mts b/src/version2/models/issueTypeScreenSchemeDetails.mts new file mode 100644 index 0000000000..5ac0de4fef --- /dev/null +++ b/src/version2/models/issueTypeScreenSchemeDetails.mts @@ -0,0 +1,14 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** The details of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeDetails { + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description?: string; + /** + * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an + * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; +} diff --git a/src/version2/models/issueTypeScreenSchemeDetails.ts b/src/version2/models/issueTypeScreenSchemeDetails.ts deleted file mode 100644 index 370558f9e6..0000000000 --- a/src/version2/models/issueTypeScreenSchemeDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping'; - -/** The details of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeDetails { - /** The description of the issue type screen scheme. The maximum length is 255 characters. */ - description?: string; - /** - * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an - * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; - /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; -} diff --git a/src/version2/models/issueTypeScreenSchemeId.ts b/src/version2/models/issueTypeScreenSchemeId.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeId.ts rename to src/version2/models/issueTypeScreenSchemeId.mts diff --git a/src/version2/models/issueTypeScreenSchemeItem.ts b/src/version2/models/issueTypeScreenSchemeItem.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeItem.ts rename to src/version2/models/issueTypeScreenSchemeItem.mts diff --git a/src/version2/models/issueTypeScreenSchemeMapping.ts b/src/version2/models/issueTypeScreenSchemeMapping.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeMapping.ts rename to src/version2/models/issueTypeScreenSchemeMapping.mts diff --git a/src/version2/models/issueTypeScreenSchemeMappingDetails.mts b/src/version2/models/issueTypeScreenSchemeMappingDetails.mts new file mode 100644 index 0000000000..b8d7f4d5fa --- /dev/null +++ b/src/version2/models/issueTypeScreenSchemeMappingDetails.mts @@ -0,0 +1,10 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** A list of issue type screen scheme mappings. */ +export interface IssueTypeScreenSchemeMappingDetails { + /** + * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is + * added when an issue type screen scheme is created. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} diff --git a/src/version2/models/issueTypeScreenSchemeMappingDetails.ts b/src/version2/models/issueTypeScreenSchemeMappingDetails.ts deleted file mode 100644 index 6fce54e81a..0000000000 --- a/src/version2/models/issueTypeScreenSchemeMappingDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping'; - -/** A list of issue type screen scheme mappings. */ -export interface IssueTypeScreenSchemeMappingDetails { - /** - * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is - * added when an issue type screen scheme is created. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version2/models/issueTypeScreenSchemeProjectAssociation.ts b/src/version2/models/issueTypeScreenSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeProjectAssociation.ts rename to src/version2/models/issueTypeScreenSchemeProjectAssociation.mts diff --git a/src/version2/models/issueTypeScreenSchemeUpdateDetails.ts b/src/version2/models/issueTypeScreenSchemeUpdateDetails.mts similarity index 100% rename from src/version2/models/issueTypeScreenSchemeUpdateDetails.ts rename to src/version2/models/issueTypeScreenSchemeUpdateDetails.mts diff --git a/src/version2/models/issueTypeScreenSchemesProjects.mts b/src/version2/models/issueTypeScreenSchemesProjects.mts new file mode 100644 index 0000000000..896e054ad3 --- /dev/null +++ b/src/version2/models/issueTypeScreenSchemesProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** Issue type screen scheme with a list of the projects that use it. */ +export interface IssueTypeScreenSchemesProjects { + issueTypeScreenScheme?: IssueTypeScreenScheme; + /** The IDs of the projects using the issue type screen scheme. */ + projectIds: string[]; +} diff --git a/src/version2/models/issueTypeScreenSchemesProjects.ts b/src/version2/models/issueTypeScreenSchemesProjects.ts deleted file mode 100644 index 56a4c64482..0000000000 --- a/src/version2/models/issueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeScreenScheme } from './issueTypeScreenScheme'; - -/** Issue type screen scheme with a list of the projects that use it. */ -export interface IssueTypeScreenSchemesProjects { - issueTypeScreenScheme?: IssueTypeScreenScheme; - /** The IDs of the projects using the issue type screen scheme. */ - projectIds: string[]; -} diff --git a/src/version2/models/issueTypeToContextMapping.ts b/src/version2/models/issueTypeToContextMapping.mts similarity index 100% rename from src/version2/models/issueTypeToContextMapping.ts rename to src/version2/models/issueTypeToContextMapping.mts diff --git a/src/version2/models/issueTypeUpdate.ts b/src/version2/models/issueTypeUpdate.mts similarity index 100% rename from src/version2/models/issueTypeUpdate.ts rename to src/version2/models/issueTypeUpdate.mts diff --git a/src/version2/models/issueTypeWithStatus.mts b/src/version2/models/issueTypeWithStatus.mts new file mode 100644 index 0000000000..178f6ac066 --- /dev/null +++ b/src/version2/models/issueTypeWithStatus.mts @@ -0,0 +1,15 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Status details for an issue type. */ +export interface IssueTypeWithStatus { + /** The ID of the issue type. */ + id: string; + /** The name of the issue type. */ + name: string; + /** The URL of the issue type's status details. */ + self: string; + /** List of status details for the issue type. */ + statuses: StatusDetails[]; + /** Whether this issue type represents subtasks. */ + subtask: boolean; +} diff --git a/src/version2/models/issueTypeWithStatus.ts b/src/version2/models/issueTypeWithStatus.ts deleted file mode 100644 index 7c04fbe296..0000000000 --- a/src/version2/models/issueTypeWithStatus.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { StatusDetails } from './statusDetails'; - -/** Status details for an issue type. */ -export interface IssueTypeWithStatus { - /** The ID of the issue type. */ - id: string; - /** The name of the issue type. */ - name: string; - /** The URL of the issue type's status details. */ - self: string; - /** List of status details for the issue type. */ - statuses: StatusDetails[]; - /** Whether this issue type represents subtasks. */ - subtask: boolean; -} diff --git a/src/version2/models/issueTypeWorkflowMapping.ts b/src/version2/models/issueTypeWorkflowMapping.mts similarity index 100% rename from src/version2/models/issueTypeWorkflowMapping.ts rename to src/version2/models/issueTypeWorkflowMapping.mts diff --git a/src/version2/models/issueTypesWorkflowMapping.ts b/src/version2/models/issueTypesWorkflowMapping.mts similarity index 100% rename from src/version2/models/issueTypesWorkflowMapping.ts rename to src/version2/models/issueTypesWorkflowMapping.mts diff --git a/src/version2/models/issueUpdateDetails.mts b/src/version2/models/issueUpdateDetails.mts new file mode 100644 index 0000000000..6510f4f59b --- /dev/null +++ b/src/version2/models/issueUpdateDetails.mts @@ -0,0 +1,23 @@ +import { EntityProperty } from './entityProperty.mjs'; +import { Fields } from './fields.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; + +/** Details of an issue update request. */ +export interface IssueUpdateDetails { + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields?: Partial | any; + historyMetadata?: HistoryMetadata; + /** Details of issue properties to be added or update. */ + properties?: EntityProperty[]; + transition?: IssueTransition; + /** + * A Map containing the field name and a list of operations to perform on the issue screen field. Note that fields + * included in here cannot be included in `fields`. + */ + update?: {}; +} diff --git a/src/version2/models/issueUpdateDetails.ts b/src/version2/models/issueUpdateDetails.ts deleted file mode 100644 index 516cccab9c..0000000000 --- a/src/version2/models/issueUpdateDetails.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { EntityProperty } from './entityProperty'; -import { Fields } from './fields'; -import { HistoryMetadata } from './historyMetadata'; -import { IssueTransition } from './issueTransition'; - -/** Details of an issue update request. */ -export interface IssueUpdateDetails { - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields?: Partial | any; - historyMetadata?: HistoryMetadata; - /** Details of issue properties to be added or update. */ - properties?: EntityProperty[]; - transition?: IssueTransition; - /** - * A Map containing the field name and a list of operations to perform on the issue screen field. Note that fields - * included in here cannot be included in `fields`. - */ - update?: {}; -} diff --git a/src/version2/models/issueUpdateMetadata.mts b/src/version2/models/issueUpdateMetadata.mts new file mode 100644 index 0000000000..f58ace871f --- /dev/null +++ b/src/version2/models/issueUpdateMetadata.mts @@ -0,0 +1,7 @@ +import { Fields } from './fields.mjs'; + +/** A list of editable field details. */ +export interface IssueUpdateMetadata { + /** A list of editable field details. */ + fields?: Fields; +} diff --git a/src/version2/models/issueUpdateMetadata.ts b/src/version2/models/issueUpdateMetadata.ts deleted file mode 100644 index 27c36315e6..0000000000 --- a/src/version2/models/issueUpdateMetadata.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Fields } from './fields'; - -/** A list of editable field details. */ -export interface IssueUpdateMetadata { - /** A list of editable field details. */ - fields?: Fields; -} diff --git a/src/version2/models/issuesAndJQLQueries.mts b/src/version2/models/issuesAndJQLQueries.mts new file mode 100644 index 0000000000..d774f31e3e --- /dev/null +++ b/src/version2/models/issuesAndJQLQueries.mts @@ -0,0 +1,7 @@ +/** List of issues and Jql queries. */ +export interface IssuesAndJQLQueries { + /** A list of issue IDs. */ + issueIds: number[]; + /** A list of Jql queries. */ + jqls: string[]; +} diff --git a/src/version2/models/issuesAndJQLQueries.ts b/src/version2/models/issuesAndJQLQueries.ts deleted file mode 100644 index 4a036ad0ea..0000000000 --- a/src/version2/models/issuesAndJQLQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** List of issues and JQL queries. */ -export interface IssuesAndJQLQueries { - /** A list of issue IDs. */ - issueIds: number[]; - /** A list of JQL queries. */ - jqls: string[]; -} diff --git a/src/version2/models/issuesJqlMetaData.mts b/src/version2/models/issuesJqlMetaData.mts new file mode 100644 index 0000000000..44dc0191ca --- /dev/null +++ b/src/version2/models/issuesJqlMetaData.mts @@ -0,0 +1,13 @@ +/** The description of the page of issues loaded by the provided Jql query. */ +export interface IssuesJqlMetaData { + /** The number of issues that were loaded in this evaluation. */ + count: number; + /** The maximum number of issues that could be loaded in this evaluation. */ + maxResults: number; + /** The index of the first issue. */ + startAt: number; + /** The total number of issues the Jql returned. */ + totalCount: number; + /** Any warnings related to the Jql query. Present only if the validation mode was set to `warn`. */ + validationWarnings?: string[]; +} diff --git a/src/version2/models/issuesJqlMetaData.ts b/src/version2/models/issuesJqlMetaData.ts deleted file mode 100644 index 35e4987b75..0000000000 --- a/src/version2/models/issuesJqlMetaData.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The description of the page of issues loaded by the provided JQL query. */ -export interface IssuesJqlMetaData { - /** The number of issues that were loaded in this evaluation. */ - count: number; - /** The maximum number of issues that could be loaded in this evaluation. */ - maxResults: number; - /** The index of the first issue. */ - startAt: number; - /** The total number of issues the JQL returned. */ - totalCount: number; - /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ - validationWarnings?: string[]; -} diff --git a/src/version2/models/issuesMeta.mts b/src/version2/models/issuesMeta.mts new file mode 100644 index 0000000000..569f4bf2a8 --- /dev/null +++ b/src/version2/models/issuesMeta.mts @@ -0,0 +1,6 @@ +import { IssuesJqlMetaData } from './issuesJqlMetaData.mjs'; + +/** Meta data describing the `issues` context variable. */ +export interface IssuesMeta { + jql?: IssuesJqlMetaData; +} diff --git a/src/version2/models/issuesMeta.ts b/src/version2/models/issuesMeta.ts deleted file mode 100644 index 6158728196..0000000000 --- a/src/version2/models/issuesMeta.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssuesJqlMetaData } from './issuesJqlMetaData'; - -/** Meta data describing the `issues` context variable. */ -export interface IssuesMeta { - jql?: IssuesJqlMetaData; -} diff --git a/src/version2/models/issuesUpdate.mts b/src/version2/models/issuesUpdate.mts new file mode 100644 index 0000000000..3c850d1da5 --- /dev/null +++ b/src/version2/models/issuesUpdate.mts @@ -0,0 +1,5 @@ +import { IssueUpdateDetails } from './issueUpdateDetails.mjs'; + +export interface IssuesUpdate { + issueUpdates?: IssueUpdateDetails[]; +} diff --git a/src/version2/models/issuesUpdate.ts b/src/version2/models/issuesUpdate.ts deleted file mode 100644 index 57cb9b2bf8..0000000000 --- a/src/version2/models/issuesUpdate.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IssueUpdateDetails } from './issueUpdateDetails'; - -export interface IssuesUpdate { - issueUpdates?: IssueUpdateDetails[]; -} diff --git a/src/version2/models/jQLPersonalDataMigrationRequest.mts b/src/version2/models/jQLPersonalDataMigrationRequest.mts new file mode 100644 index 0000000000..793136c7cd --- /dev/null +++ b/src/version2/models/jQLPersonalDataMigrationRequest.mts @@ -0,0 +1,5 @@ +/** The Jql queries to be converted. */ +export interface JQLPersonalDataMigrationRequest { + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings?: string[]; +} diff --git a/src/version2/models/jQLPersonalDataMigrationRequest.ts b/src/version2/models/jQLPersonalDataMigrationRequest.ts deleted file mode 100644 index 0a07308173..0000000000 --- a/src/version2/models/jQLPersonalDataMigrationRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The JQL queries to be converted. */ -export interface JQLPersonalDataMigrationRequest { - /** A list of queries with user identifiers. Maximum of 100 queries. */ - queryStrings?: string[]; -} diff --git a/src/version2/models/jQLQueryWithUnknownUsers.mts b/src/version2/models/jQLQueryWithUnknownUsers.mts new file mode 100644 index 0000000000..ecdb0be81a --- /dev/null +++ b/src/version2/models/jQLQueryWithUnknownUsers.mts @@ -0,0 +1,7 @@ +/** Jql queries that contained users that could not be found */ +export interface JQLQueryWithUnknownUsers { + /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ + convertedQuery?: string; + /** The original query, for reference */ + originalQuery?: string; +} diff --git a/src/version2/models/jQLQueryWithUnknownUsers.ts b/src/version2/models/jQLQueryWithUnknownUsers.ts deleted file mode 100644 index 81661d53e3..0000000000 --- a/src/version2/models/jQLQueryWithUnknownUsers.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** JQL queries that contained users that could not be found */ -export interface JQLQueryWithUnknownUsers { - /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ - convertedQuery?: string; - /** The original query, for reference */ - originalQuery?: string; -} diff --git a/src/version2/models/jQLReferenceData.mts b/src/version2/models/jQLReferenceData.mts new file mode 100644 index 0000000000..13e0e8fa47 --- /dev/null +++ b/src/version2/models/jQLReferenceData.mts @@ -0,0 +1,12 @@ +import { FieldReferenceData } from './fieldReferenceData.mjs'; +import { FunctionReferenceData } from './functionReferenceData.mjs'; + +/** Lists of Jql reference data. */ +export interface JQLReferenceData { + /** List of Jql query reserved words. */ + jqlReservedWords?: string[]; + /** List of fields usable in Jql queries. */ + visibleFieldNames?: FieldReferenceData[]; + /** List of functions usable in Jql queries. */ + visibleFunctionNames?: FunctionReferenceData[]; +} diff --git a/src/version2/models/jQLReferenceData.ts b/src/version2/models/jQLReferenceData.ts deleted file mode 100644 index 51b706e33a..0000000000 --- a/src/version2/models/jQLReferenceData.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { FieldReferenceData } from './fieldReferenceData'; -import { FunctionReferenceData } from './functionReferenceData'; - -/** Lists of JQL reference data. */ -export interface JQLReferenceData { - /** List of JQL query reserved words. */ - jqlReservedWords?: string[]; - /** List of fields usable in JQL queries. */ - visibleFieldNames?: FieldReferenceData[]; - /** List of functions usable in JQL queries. */ - visibleFunctionNames?: FunctionReferenceData[]; -} diff --git a/src/version2/models/jexpIssues.mts b/src/version2/models/jexpIssues.mts new file mode 100644 index 0000000000..1b6e22b862 --- /dev/null +++ b/src/version2/models/jexpIssues.mts @@ -0,0 +1,6 @@ +import { JexpJqlIssues } from './jexpJqlIssues.mjs'; + +/** The Jql specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export interface JexpIssues { + jql?: JexpJqlIssues; +} diff --git a/src/version2/models/jexpIssues.ts b/src/version2/models/jexpIssues.ts deleted file mode 100644 index d2ece42457..0000000000 --- a/src/version2/models/jexpIssues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { JexpJqlIssues } from './jexpJqlIssues'; - -/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ -export interface JexpIssues { - jql?: JexpJqlIssues; -} diff --git a/src/version2/models/jexpJqlIssues.mts b/src/version2/models/jexpJqlIssues.mts new file mode 100644 index 0000000000..c0de2c4041 --- /dev/null +++ b/src/version2/models/jexpJqlIssues.mts @@ -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 `startAt` and `maxResults` properties. To + * determine whether it is necessary to iterate to ensure all the issues returned by the Jql query are evaluated, + * inspect `meta.issues.jql.count` in the response. + */ +export interface JexpJqlIssues { + /** + * 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 Jql query. */ + query?: string; + /** The index of the first issue to return from the Jql query. */ + startAt?: number; + /** Determines how to validate the Jql query and treat the validation results. */ + validation?: string; +} diff --git a/src/version2/models/jexpJqlIssues.ts b/src/version2/models/jexpJqlIssues.ts deleted file mode 100644 index aeb69f78a3..0000000000 --- a/src/version2/models/jexpJqlIssues.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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 `startAt` and `maxResults` properties. To - * determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, - * inspect `meta.issues.jql.count` in the response. - */ -export interface JexpJqlIssues { - /** - * 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 JQL query. */ - query?: string; - /** The index of the first issue to return from the JQL query. */ - startAt?: number; - /** Determines how to validate the JQL query and treat the validation results. */ - validation?: string; -} diff --git a/src/version2/models/jiraExpressionAnalysis.mts b/src/version2/models/jiraExpressionAnalysis.mts new file mode 100644 index 0000000000..c0a323218c --- /dev/null +++ b/src/version2/models/jiraExpressionAnalysis.mts @@ -0,0 +1,18 @@ +import { JiraExpressionComplexity } from './jiraExpressionComplexity.mjs'; +import { JiraExpressionValidationError } from './jiraExpressionValidationError.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionAnalysis { + complexity?: JiraExpressionComplexity; + /** A list of validation errors. Not included if the expression is valid. */ + errors?: JiraExpressionValidationError[]; + /** The analysed expression. */ + expression: string; + /** EXPERIMENTAL. The inferred type of the expression. */ + type?: string; + /** + * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime + * (for example, if it executes too many expensive operations). + */ + valid: boolean; +} diff --git a/src/version2/models/jiraExpressionAnalysis.ts b/src/version2/models/jiraExpressionAnalysis.ts deleted file mode 100644 index 0740692e79..0000000000 --- a/src/version2/models/jiraExpressionAnalysis.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { JiraExpressionComplexity } from './jiraExpressionComplexity'; -import { JiraExpressionValidationError } from './jiraExpressionValidationError'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionAnalysis { - complexity?: JiraExpressionComplexity; - /** A list of validation errors. Not included if the expression is valid. */ - errors?: JiraExpressionValidationError[]; - /** The analysed expression. */ - expression: string; - /** EXPERIMENTAL. The inferred type of the expression. */ - type?: string; - /** - * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime - * (for example, if it executes too many expensive operations). - */ - valid: boolean; -} diff --git a/src/version2/models/jiraExpressionComplexity.ts b/src/version2/models/jiraExpressionComplexity.mts similarity index 100% rename from src/version2/models/jiraExpressionComplexity.ts rename to src/version2/models/jiraExpressionComplexity.mts diff --git a/src/version2/models/jiraExpressionEvalContext.mts b/src/version2/models/jiraExpressionEvalContext.mts new file mode 100644 index 0000000000..8210f1ea08 --- /dev/null +++ b/src/version2/models/jiraExpressionEvalContext.mts @@ -0,0 +1,32 @@ +import { CustomContextVariable } from './customContextVariable.mjs'; +import { IdOrKey } from './idOrKey.mjs'; +import { JexpIssues } from './jexpIssues.mjs'; + +export interface JiraExpressionEvalContext { + /** 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?: JexpIssues; + 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; +} diff --git a/src/version2/models/jiraExpressionEvalContext.ts b/src/version2/models/jiraExpressionEvalContext.ts deleted file mode 100644 index 8d044506c0..0000000000 --- a/src/version2/models/jiraExpressionEvalContext.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CustomContextVariable } from './customContextVariable'; -import { IdOrKey } from './idOrKey'; -import { JexpIssues } from './jexpIssues'; - -export interface JiraExpressionEvalContext { - /** 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?: JexpIssues; - 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; -} diff --git a/src/version2/models/jiraExpressionEvalRequest.mts b/src/version2/models/jiraExpressionEvalRequest.mts new file mode 100644 index 0000000000..2b047d50f2 --- /dev/null +++ b/src/version2/models/jiraExpressionEvalRequest.mts @@ -0,0 +1,7 @@ +import { JiraExpressionEvalContext } from './jiraExpressionEvalContext.mjs'; + +export interface JiraExpressionEvalRequest { + context?: JiraExpressionEvalContext; + /** The Jira expression to evaluate. */ + expression: string; +} diff --git a/src/version2/models/jiraExpressionEvalRequest.ts b/src/version2/models/jiraExpressionEvalRequest.ts deleted file mode 100644 index b6aedff147..0000000000 --- a/src/version2/models/jiraExpressionEvalRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JiraExpressionEvalContext } from './jiraExpressionEvalContext'; - -export interface JiraExpressionEvalRequest { - context?: JiraExpressionEvalContext; - /** The Jira expression to evaluate. */ - expression: string; -} diff --git a/src/version2/models/jiraExpressionEvaluationMetaData.mts b/src/version2/models/jiraExpressionEvaluationMetaData.mts new file mode 100644 index 0000000000..4cb3c424d4 --- /dev/null +++ b/src/version2/models/jiraExpressionEvaluationMetaData.mts @@ -0,0 +1,7 @@ +import { IssuesMeta } from './issuesMeta.mjs'; +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity.mjs'; + +export interface JiraExpressionEvaluationMetaData { + complexity?: JiraExpressionsComplexity; + issues?: IssuesMeta; +} diff --git a/src/version2/models/jiraExpressionEvaluationMetaData.ts b/src/version2/models/jiraExpressionEvaluationMetaData.ts deleted file mode 100644 index aba849f5d7..0000000000 --- a/src/version2/models/jiraExpressionEvaluationMetaData.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IssuesMeta } from './issuesMeta'; -import { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; - -export interface JiraExpressionEvaluationMetaData { - complexity?: JiraExpressionsComplexity; - issues?: IssuesMeta; -} diff --git a/src/version2/models/jiraExpressionForAnalysis.ts b/src/version2/models/jiraExpressionForAnalysis.mts similarity index 100% rename from src/version2/models/jiraExpressionForAnalysis.ts rename to src/version2/models/jiraExpressionForAnalysis.mts diff --git a/src/version2/models/jiraExpressionResult.mts b/src/version2/models/jiraExpressionResult.mts new file mode 100644 index 0000000000..1f26c58696 --- /dev/null +++ b/src/version2/models/jiraExpressionResult.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData.mjs'; + +/** The result of evaluating a Jira expression. */ +export interface JiraExpressionResult { + meta?: JiraExpressionEvaluationMetaData; + /** + * 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: any; +} diff --git a/src/version2/models/jiraExpressionResult.ts b/src/version2/models/jiraExpressionResult.ts deleted file mode 100644 index f3010d988a..0000000000 --- a/src/version2/models/jiraExpressionResult.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData'; - -/** The result of evaluating a Jira expression. */ -export interface JiraExpressionResult { - meta?: JiraExpressionEvaluationMetaData; - /** - * 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: any; -} diff --git a/src/version2/models/jiraExpressionValidationError.ts b/src/version2/models/jiraExpressionValidationError.mts similarity index 100% rename from src/version2/models/jiraExpressionValidationError.ts rename to src/version2/models/jiraExpressionValidationError.mts diff --git a/src/version2/models/jiraExpressionsAnalysis.mts b/src/version2/models/jiraExpressionsAnalysis.mts new file mode 100644 index 0000000000..2cd80ae444 --- /dev/null +++ b/src/version2/models/jiraExpressionsAnalysis.mts @@ -0,0 +1,7 @@ +import { JiraExpressionAnalysis } from './jiraExpressionAnalysis.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionsAnalysis { + /** The results of Jira expressions analysis. */ + results: JiraExpressionAnalysis[]; +} diff --git a/src/version2/models/jiraExpressionsAnalysis.ts b/src/version2/models/jiraExpressionsAnalysis.ts deleted file mode 100644 index 36e3231b87..0000000000 --- a/src/version2/models/jiraExpressionsAnalysis.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JiraExpressionAnalysis } from './jiraExpressionAnalysis'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionsAnalysis { - /** The results of Jira expressions analysis. */ - results: JiraExpressionAnalysis[]; -} diff --git a/src/version2/models/jiraExpressionsComplexity.mts b/src/version2/models/jiraExpressionsComplexity.mts new file mode 100644 index 0000000000..cf53e8b697 --- /dev/null +++ b/src/version2/models/jiraExpressionsComplexity.mts @@ -0,0 +1,8 @@ +import { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue.mjs'; + +export interface JiraExpressionsComplexity { + steps?: JiraExpressionsComplexityValue; + expensiveOperations?: JiraExpressionsComplexityValue; + beans?: JiraExpressionsComplexityValue; + primitiveValues?: JiraExpressionsComplexityValue; +} diff --git a/src/version2/models/jiraExpressionsComplexity.ts b/src/version2/models/jiraExpressionsComplexity.ts deleted file mode 100644 index 3dfc524719..0000000000 --- a/src/version2/models/jiraExpressionsComplexity.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue'; - -export interface JiraExpressionsComplexity { - steps?: JiraExpressionsComplexityValue; - expensiveOperations?: JiraExpressionsComplexityValue; - beans?: JiraExpressionsComplexityValue; - primitiveValues?: JiraExpressionsComplexityValue; -} diff --git a/src/version2/models/jiraExpressionsComplexityValue.ts b/src/version2/models/jiraExpressionsComplexityValue.mts similarity index 100% rename from src/version2/models/jiraExpressionsComplexityValue.ts rename to src/version2/models/jiraExpressionsComplexityValue.mts diff --git a/src/version2/models/jiraStatus.mts b/src/version2/models/jiraStatus.mts new file mode 100644 index 0000000000..51f5e6e925 --- /dev/null +++ b/src/version2/models/jiraStatus.mts @@ -0,0 +1,17 @@ +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** 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; + scope?: StatusScope; + /** The category of the status. */ + statusCategory?: string; + /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ + usages?: ProjectIssueTypes[]; +} diff --git a/src/version2/models/jiraStatus.ts b/src/version2/models/jiraStatus.ts deleted file mode 100644 index 5166ae3115..0000000000 --- a/src/version2/models/jiraStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ProjectIssueTypes } from './projectIssueTypes'; -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; - scope?: StatusScope; - /** The category of the status. */ - statusCategory?: string; - /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version2/models/jiraWorkflow.mts b/src/version2/models/jiraWorkflow.mts new file mode 100644 index 0000000000..70cbc025ef --- /dev/null +++ b/src/version2/models/jiraWorkflow.mts @@ -0,0 +1,32 @@ +import { DocumentVersion } from './documentVersion.mjs'; +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import { WorkflowLayout } from './workflowLayout.mjs'; +import { WorkflowReferenceStatus } from './workflowReferenceStatus.mjs'; +import { WorkflowScope } from './workflowScope.mjs'; +import { WorkflowTransitions } from './workflowTransitions.mjs'; + +/** Details of a workflow. */ +export interface JiraWorkflow { + /** 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. */ + transitions?: WorkflowTransitions[]; + /** + * 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/version2/models/jiraWorkflow.ts b/src/version2/models/jiraWorkflow.ts deleted file mode 100644 index 1a846701e2..0000000000 --- a/src/version2/models/jiraWorkflow.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { DocumentVersion } from './documentVersion'; -import { ProjectIssueTypes } from './projectIssueTypes'; -import { WorkflowLayout } from './workflowLayout'; -import { WorkflowReferenceStatus } from './workflowReferenceStatus'; -import { WorkflowScope } from './workflowScope'; -import { WorkflowTransitions } from './workflowTransitions'; - -/** Details of a workflow. */ -export interface JiraWorkflow { - /** 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. */ - transitions?: WorkflowTransitions[]; - /** - * 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/version2/models/jiraWorkflowStatus.mts b/src/version2/models/jiraWorkflowStatus.mts new file mode 100644 index 0000000000..779cb3410e --- /dev/null +++ b/src/version2/models/jiraWorkflowStatus.mts @@ -0,0 +1,22 @@ +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import { WorkflowScope } from './workflowScope.mjs'; + +/** 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?: string; + /** The reference of the status. */ + statusReference?: string; + /** + * The `statuses.usages` expand is an optional parameter that can be used when reading and updating statuses in Jira. + * It provides additional information about the projects and issue types associated with the requested statuses. + */ + usages?: ProjectIssueTypes[]; +} diff --git a/src/version2/models/jiraWorkflowStatus.ts b/src/version2/models/jiraWorkflowStatus.ts deleted file mode 100644 index 10749ea0ab..0000000000 --- a/src/version2/models/jiraWorkflowStatus.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ProjectIssueTypes } from './projectIssueTypes'; -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?: string; - /** The reference of the status. */ - statusReference?: string; - /** - * The `statuses.usages` expand is an optional parameter that can be used when reading and updating statuses in Jira. - * It provides additional information about the projects and issue types associated with the requested statuses. - */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version2/models/jqlFunctionPrecomputation.ts b/src/version2/models/jqlFunctionPrecomputation.mts similarity index 100% rename from src/version2/models/jqlFunctionPrecomputation.ts rename to src/version2/models/jqlFunctionPrecomputation.mts diff --git a/src/version2/models/jqlFunctionPrecomputationUpdate.ts b/src/version2/models/jqlFunctionPrecomputationUpdate.mts similarity index 100% rename from src/version2/models/jqlFunctionPrecomputationUpdate.ts rename to src/version2/models/jqlFunctionPrecomputationUpdate.mts diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts new file mode 100644 index 0000000000..90b449b605 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.mts @@ -0,0 +1,6 @@ +import { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate.mjs'; + +/** List of pairs (id and value) for precomputation updates. */ +export interface JqlFunctionPrecomputationUpdateRequest { + values: JqlFunctionPrecomputationUpdate[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts b/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts deleted file mode 100644 index 5c3726ae66..0000000000 --- a/src/version2/models/jqlFunctionPrecomputationUpdateRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate'; - -/** List of pairs (id and value) for precomputation updates. */ -export interface JqlFunctionPrecomputationUpdateRequest { - values: JqlFunctionPrecomputationUpdate[]; -} diff --git a/src/version2/models/jqlQueriesToParse.mts b/src/version2/models/jqlQueriesToParse.mts new file mode 100644 index 0000000000..9bb4f6ad1a --- /dev/null +++ b/src/version2/models/jqlQueriesToParse.mts @@ -0,0 +1,5 @@ +/** A list of Jql queries to parse. */ +export interface JqlQueriesToParse { + /** A list of queries to parse. */ + queries: string[]; +} diff --git a/src/version2/models/jqlQueriesToParse.ts b/src/version2/models/jqlQueriesToParse.ts deleted file mode 100644 index 69990243f3..0000000000 --- a/src/version2/models/jqlQueriesToParse.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of JQL queries to parse. */ -export interface JqlQueriesToParse { - /** A list of queries to parse. */ - queries: string[]; -} diff --git a/src/version2/models/jqlQueriesToSanitize.mts b/src/version2/models/jqlQueriesToSanitize.mts new file mode 100644 index 0000000000..9200763ff7 --- /dev/null +++ b/src/version2/models/jqlQueriesToSanitize.mts @@ -0,0 +1,7 @@ +import { JqlQueryToSanitize } from './jqlQueryToSanitize.mjs'; + +/** The list of Jql queries to sanitize for the given account IDs. */ +export interface JqlQueriesToSanitize { + /** The list of Jql queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: JqlQueryToSanitize[]; +} diff --git a/src/version2/models/jqlQueriesToSanitize.ts b/src/version2/models/jqlQueriesToSanitize.ts deleted file mode 100644 index 01cc5f923a..0000000000 --- a/src/version2/models/jqlQueriesToSanitize.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JqlQueryToSanitize } from './jqlQueryToSanitize'; - -/** The list of JQL queries to sanitize for the given account IDs. */ -export interface JqlQueriesToSanitize { - /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ - queries: JqlQueryToSanitize[]; -} diff --git a/src/version2/models/jqlQuery.mts b/src/version2/models/jqlQuery.mts new file mode 100644 index 0000000000..3eabec5b51 --- /dev/null +++ b/src/version2/models/jqlQuery.mts @@ -0,0 +1,8 @@ +import { JqlQueryClause } from './jqlQueryClause.mjs'; +import { JqlQueryOrderByClause } from './jqlQueryOrderByClause.mjs'; + +/** A parsed Jql query. */ +export interface JqlQuery { + orderBy?: JqlQueryOrderByClause; + where?: JqlQueryClause; +} diff --git a/src/version2/models/jqlQuery.ts b/src/version2/models/jqlQuery.ts deleted file mode 100644 index 0deb348335..0000000000 --- a/src/version2/models/jqlQuery.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JqlQueryClause } from './jqlQueryClause'; -import { JqlQueryOrderByClause } from './jqlQueryOrderByClause'; - -/** A parsed JQL query. */ -export interface JqlQuery { - orderBy?: JqlQueryOrderByClause; - where?: JqlQueryClause; -} diff --git a/src/version2/models/jqlQueryClause.mts b/src/version2/models/jqlQueryClause.mts new file mode 100644 index 0000000000..359f6a2af3 --- /dev/null +++ b/src/version2/models/jqlQueryClause.mts @@ -0,0 +1,2 @@ +/** A Jql query clause. */ +export interface JqlQueryClause {} diff --git a/src/version2/models/jqlQueryClause.ts b/src/version2/models/jqlQueryClause.ts deleted file mode 100644 index 15c1a05c57..0000000000 --- a/src/version2/models/jqlQueryClause.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** A JQL query clause. */ -export interface JqlQueryClause {} diff --git a/src/version2/models/jqlQueryField.mts b/src/version2/models/jqlQueryField.mts new file mode 100644 index 0000000000..1c45063824 --- /dev/null +++ b/src/version2/models/jqlQueryField.mts @@ -0,0 +1,14 @@ +import { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty.mjs'; + +/** + * A field used in a Jql query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) + * for more information about fields in Jql queries. + */ +export interface JqlQueryField { + /** The encoded name of the field, which can be used directly in a Jql query. */ + encodedName?: string; + /** The name of the field. */ + name: string; + /** When the field refers to a value in an entity property, details of the entity property value. */ + property?: JqlQueryFieldEntityProperty[]; +} diff --git a/src/version2/models/jqlQueryField.ts b/src/version2/models/jqlQueryField.ts deleted file mode 100644 index e6099458ec..0000000000 --- a/src/version2/models/jqlQueryField.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty'; - -/** - * A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) - * for more information about fields in JQL queries. - */ -export interface JqlQueryField { - /** The encoded name of the field, which can be used directly in a JQL query. */ - encodedName?: string; - /** The name of the field. */ - name: string; - /** When the field refers to a value in an entity property, details of the entity property value. */ - property?: JqlQueryFieldEntityProperty[]; -} diff --git a/src/version2/models/jqlQueryFieldEntityProperty.ts b/src/version2/models/jqlQueryFieldEntityProperty.mts similarity index 100% rename from src/version2/models/jqlQueryFieldEntityProperty.ts rename to src/version2/models/jqlQueryFieldEntityProperty.mts diff --git a/src/version2/models/jqlQueryOrderByClause.mts b/src/version2/models/jqlQueryOrderByClause.mts new file mode 100644 index 0000000000..dbf27a467d --- /dev/null +++ b/src/version2/models/jqlQueryOrderByClause.mts @@ -0,0 +1,7 @@ +import { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement.mjs'; + +/** Details of the order-by Jql clause. */ +export interface JqlQueryOrderByClause { + /** The list of order-by clause fields and their ordering directives. */ + fields: JqlQueryOrderByClauseElement[]; +} diff --git a/src/version2/models/jqlQueryOrderByClause.ts b/src/version2/models/jqlQueryOrderByClause.ts deleted file mode 100644 index ecd2773b65..0000000000 --- a/src/version2/models/jqlQueryOrderByClause.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement'; - -/** Details of the order-by JQL clause. */ -export interface JqlQueryOrderByClause { - /** The list of order-by clause fields and their ordering directives. */ - fields: JqlQueryOrderByClauseElement[]; -} diff --git a/src/version2/models/jqlQueryOrderByClauseElement.mts b/src/version2/models/jqlQueryOrderByClauseElement.mts new file mode 100644 index 0000000000..0c25af851e --- /dev/null +++ b/src/version2/models/jqlQueryOrderByClauseElement.mts @@ -0,0 +1,8 @@ +import { JqlQueryField } from './jqlQueryField.mjs'; + +/** An element of the order-by Jql clause. */ +export interface JqlQueryOrderByClauseElement { + /** The direction in which to order the results. */ + direction?: string; + field: JqlQueryField; +} diff --git a/src/version2/models/jqlQueryOrderByClauseElement.ts b/src/version2/models/jqlQueryOrderByClauseElement.ts deleted file mode 100644 index 22488e7c30..0000000000 --- a/src/version2/models/jqlQueryOrderByClauseElement.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JqlQueryField } from './jqlQueryField'; - -/** An element of the order-by JQL clause. */ -export interface JqlQueryOrderByClauseElement { - /** The direction in which to order the results. */ - direction?: string; - field: JqlQueryField; -} diff --git a/src/version2/models/jqlQueryToSanitize.mts b/src/version2/models/jqlQueryToSanitize.mts new file mode 100644 index 0000000000..93ae518e5b --- /dev/null +++ b/src/version2/models/jqlQueryToSanitize.mts @@ -0,0 +1,13 @@ +/** + * The Jql query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous + * user. + */ +export interface JqlQueryToSanitize { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The query to sanitize. */ + query: string; +} diff --git a/src/version2/models/jqlQueryToSanitize.ts b/src/version2/models/jqlQueryToSanitize.ts deleted file mode 100644 index e774eaf2af..0000000000 --- a/src/version2/models/jqlQueryToSanitize.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous - * user. - */ -export interface JqlQueryToSanitize { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The query to sanitize. */ - query: string; -} diff --git a/src/version2/models/jsonType.ts b/src/version2/models/jsonType.mts similarity index 100% rename from src/version2/models/jsonType.ts rename to src/version2/models/jsonType.mts diff --git a/src/version2/models/license.mts b/src/version2/models/license.mts new file mode 100644 index 0000000000..70db44801a --- /dev/null +++ b/src/version2/models/license.mts @@ -0,0 +1,7 @@ +import { LicensedApplication } from './licensedApplication.mjs'; + +/** Details about a license for the Jira instance. */ +export interface License { + /** The applications under this license. */ + applications: LicensedApplication[]; +} diff --git a/src/version2/models/license.ts b/src/version2/models/license.ts deleted file mode 100644 index bda74a19a9..0000000000 --- a/src/version2/models/license.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { LicensedApplication } from './licensedApplication'; - -/** Details about a license for the Jira instance. */ -export interface License { - /** The applications under this license. */ - applications: LicensedApplication[]; -} diff --git a/src/version2/models/licenseMetric.ts b/src/version2/models/licenseMetric.mts similarity index 100% rename from src/version2/models/licenseMetric.ts rename to src/version2/models/licenseMetric.mts diff --git a/src/version2/models/licensedApplication.ts b/src/version2/models/licensedApplication.mts similarity index 100% rename from src/version2/models/licensedApplication.ts rename to src/version2/models/licensedApplication.mts diff --git a/src/version2/models/linkGroup.mts b/src/version2/models/linkGroup.mts new file mode 100644 index 0000000000..159c851d52 --- /dev/null +++ b/src/version2/models/linkGroup.mts @@ -0,0 +1,11 @@ +import type { SimpleLink } from './simpleLink.mjs'; + +/** Details a link group, which defines issue operations. */ +export interface LinkGroup { + groups?: LinkGroup[]; + header?: SimpleLink; + id?: string; + links?: SimpleLink[]; + styleClass?: string; + weight?: number; +} diff --git a/src/version2/models/linkGroup.ts b/src/version2/models/linkGroup.ts deleted file mode 100644 index ac47687cb5..0000000000 --- a/src/version2/models/linkGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SimpleLink } from './simpleLink'; - -/** Details a link group, which defines issue operations. */ -export interface LinkGroup { - groups?: LinkGroup[]; - header?: SimpleLink; - id?: string; - links?: SimpleLink[]; - styleClass?: string; - weight?: number; -} diff --git a/src/version2/models/linkIssueRequestJson.mts b/src/version2/models/linkIssueRequestJson.mts new file mode 100644 index 0000000000..d4de9bb36b --- /dev/null +++ b/src/version2/models/linkIssueRequestJson.mts @@ -0,0 +1,10 @@ +import type { Comment } from './comment.mjs'; +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +export interface LinkIssueRequestJson { + comment?: Comment; + inwardIssue: LinkedIssue; + outwardIssue: LinkedIssue; + type: IssueLinkType; +} diff --git a/src/version2/models/linkIssueRequestJson.ts b/src/version2/models/linkIssueRequestJson.ts deleted file mode 100644 index d2f8c731e3..0000000000 --- a/src/version2/models/linkIssueRequestJson.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Comment } from './comment'; -import { IssueLinkType } from './issueLinkType'; -import { LinkedIssue } from './linkedIssue'; - -export interface LinkIssueRequestJson { - comment?: Comment; - inwardIssue: LinkedIssue; - outwardIssue: LinkedIssue; - type: IssueLinkType; -} diff --git a/src/version2/models/linkedIssue.mts b/src/version2/models/linkedIssue.mts new file mode 100644 index 0000000000..796a507289 --- /dev/null +++ b/src/version2/models/linkedIssue.mts @@ -0,0 +1,12 @@ +import { Fields } from './fields.mjs'; + +/** The ID or key of a linked issue. */ +export interface LinkedIssue { + fields?: Fields; + /** The ID of an issue. Required if `key` isn't provided. */ + id?: string; + /** The key of an issue. Required if `id` isn't provided. */ + key?: string; + /** The URL of the issue. */ + self?: string; +} diff --git a/src/version2/models/linkedIssue.ts b/src/version2/models/linkedIssue.ts deleted file mode 100644 index 9008ae3e63..0000000000 --- a/src/version2/models/linkedIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Fields } from './fields'; - -/** The ID or key of a linked issue. */ -export interface LinkedIssue { - fields?: Fields; - /** The ID of an issue. Required if `key` isn't provided. */ - id?: string; - /** The key of an issue. Required if `id` isn't provided. */ - key?: string; - /** The URL of the issue. */ - self?: string; -} diff --git a/src/version2/models/listWrapperCallbackApplicationRole.ts b/src/version2/models/listWrapperCallbackApplicationRole.mts similarity index 100% rename from src/version2/models/listWrapperCallbackApplicationRole.ts rename to src/version2/models/listWrapperCallbackApplicationRole.mts diff --git a/src/version2/models/listWrapperCallbackGroupName.ts b/src/version2/models/listWrapperCallbackGroupName.mts similarity index 100% rename from src/version2/models/listWrapperCallbackGroupName.ts rename to src/version2/models/listWrapperCallbackGroupName.mts diff --git a/src/version2/models/locale.ts b/src/version2/models/locale.mts similarity index 100% rename from src/version2/models/locale.ts rename to src/version2/models/locale.mts diff --git a/src/version2/models/moveField.ts b/src/version2/models/moveField.mts similarity index 100% rename from src/version2/models/moveField.ts rename to src/version2/models/moveField.mts diff --git a/src/version2/models/multiIssueEntityProperties.mts b/src/version2/models/multiIssueEntityProperties.mts new file mode 100644 index 0000000000..6b7c919a8c --- /dev/null +++ b/src/version2/models/multiIssueEntityProperties.mts @@ -0,0 +1,10 @@ +import { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate.mjs'; + +/** + * A list of issues and their respective properties to set or update. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export interface MultiIssueEntityProperties { + /** A list of issue IDs and their respective properties. */ + issues?: IssueEntityPropertiesForMultiUpdate[]; +} diff --git a/src/version2/models/multiIssueEntityProperties.ts b/src/version2/models/multiIssueEntityProperties.ts deleted file mode 100644 index 3e54265bc3..0000000000 --- a/src/version2/models/multiIssueEntityProperties.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate'; - -/** - * A list of issues and their respective properties to set or update. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface MultiIssueEntityProperties { - /** A list of issue IDs and their respective properties. */ - issues?: IssueEntityPropertiesForMultiUpdate[]; -} diff --git a/src/version2/models/multipleCustomFieldValuesUpdate.ts b/src/version2/models/multipleCustomFieldValuesUpdate.mts similarity index 100% rename from src/version2/models/multipleCustomFieldValuesUpdate.ts rename to src/version2/models/multipleCustomFieldValuesUpdate.mts diff --git a/src/version2/models/multipleCustomFieldValuesUpdateDetails.mts b/src/version2/models/multipleCustomFieldValuesUpdateDetails.mts new file mode 100644 index 0000000000..c15e9e08de --- /dev/null +++ b/src/version2/models/multipleCustomFieldValuesUpdateDetails.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate.mjs'; + +/** List of updates for a custom fields. */ +export interface MultipleCustomFieldValuesUpdateDetails { + updates?: MultipleCustomFieldValuesUpdate[]; +} diff --git a/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts b/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts deleted file mode 100644 index 8df22e82e4..0000000000 --- a/src/version2/models/multipleCustomFieldValuesUpdateDetails.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate'; - -/** List of updates for a custom fields. */ -export interface MultipleCustomFieldValuesUpdateDetails { - updates?: MultipleCustomFieldValuesUpdate[]; -} diff --git a/src/version2/models/nestedResponse.mts b/src/version2/models/nestedResponse.mts new file mode 100644 index 0000000000..8c6c1dcf9f --- /dev/null +++ b/src/version2/models/nestedResponse.mts @@ -0,0 +1,8 @@ +import type { ErrorCollection } from './errorCollection.mjs'; +import { WarningCollection } from './warningCollection.mjs'; + +export interface NestedResponse { + errorCollection?: ErrorCollection; + status?: number; + warningCollection?: WarningCollection; +} diff --git a/src/version2/models/nestedResponse.ts b/src/version2/models/nestedResponse.ts deleted file mode 100644 index c03a324001..0000000000 --- a/src/version2/models/nestedResponse.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ErrorCollection } from './errorCollection'; -import { WarningCollection } from './warningCollection'; - -export interface NestedResponse { - errorCollection?: ErrorCollection; - status?: number; - warningCollection?: WarningCollection; -} diff --git a/src/version2/models/newUserDetails.ts b/src/version2/models/newUserDetails.mts similarity index 100% rename from src/version2/models/newUserDetails.ts rename to src/version2/models/newUserDetails.mts diff --git a/src/version2/models/notification.mts b/src/version2/models/notification.mts new file mode 100644 index 0000000000..07e3e36166 --- /dev/null +++ b/src/version2/models/notification.mts @@ -0,0 +1,17 @@ +import { NotificationRecipients } from './notificationRecipients.mjs'; +import { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions.mjs'; + +/** Details about a notification. */ +export interface Notification { + /** The HTML body of the email notification for the issue. */ + htmlBody?: string; + restrict?: NotificationRecipientsRestrictions; + /** + * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue + * key and summary. + */ + subject?: string; + /** The plain text body of the email notification for the issue. */ + textBody?: string; + to?: NotificationRecipients; +} diff --git a/src/version2/models/notification.ts b/src/version2/models/notification.ts deleted file mode 100644 index 4be4478a74..0000000000 --- a/src/version2/models/notification.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NotificationRecipients } from './notificationRecipients'; -import { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions'; - -/** Details about a notification. */ -export interface Notification { - /** The HTML body of the email notification for the issue. */ - htmlBody?: string; - restrict?: NotificationRecipientsRestrictions; - /** - * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue - * key and summary. - */ - subject?: string; - /** The plain text body of the email notification for the issue. */ - textBody?: string; - to?: NotificationRecipients; -} diff --git a/src/version2/models/notificationEvent.ts b/src/version2/models/notificationEvent.mts similarity index 100% rename from src/version2/models/notificationEvent.ts rename to src/version2/models/notificationEvent.mts diff --git a/src/version2/models/notificationRecipients.mts b/src/version2/models/notificationRecipients.mts new file mode 100644 index 0000000000..b37f7f8342 --- /dev/null +++ b/src/version2/models/notificationRecipients.mts @@ -0,0 +1,20 @@ +import type { GroupName } from './groupName.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details of the users and groups to receive the notification. */ +export interface NotificationRecipients { + /** Whether the notification should be sent to the issue's assignees. */ + assignee?: boolean; + /** List of groupIds to receive the notification. */ + groupIds?: string[]; + /** List of groups to receive the notification. */ + groups?: GroupName[]; + /** Whether the notification should be sent to the issue's reporter. */ + reporter?: boolean; + /** List of users to receive the notification. */ + users?: UserDetails[]; + /** Whether the notification should be sent to the issue's voters. */ + voters?: boolean; + /** Whether the notification should be sent to the issue's watchers. */ + watchers?: boolean; +} diff --git a/src/version2/models/notificationRecipients.ts b/src/version2/models/notificationRecipients.ts deleted file mode 100644 index fd14683b1d..0000000000 --- a/src/version2/models/notificationRecipients.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { GroupName } from './groupName'; -import { UserDetails } from './userDetails'; - -/** Details of the users and groups to receive the notification. */ -export interface NotificationRecipients { - /** Whether the notification should be sent to the issue's assignees. */ - assignee?: boolean; - /** List of groupIds to receive the notification. */ - groupIds?: string[]; - /** List of groups to receive the notification. */ - groups?: GroupName[]; - /** Whether the notification should be sent to the issue's reporter. */ - reporter?: boolean; - /** List of users to receive the notification. */ - users?: UserDetails[]; - /** Whether the notification should be sent to the issue's voters. */ - voters?: boolean; - /** Whether the notification should be sent to the issue's watchers. */ - watchers?: boolean; -} diff --git a/src/version2/models/notificationRecipientsRestrictions.mts b/src/version2/models/notificationRecipientsRestrictions.mts new file mode 100644 index 0000000000..45ea8df392 --- /dev/null +++ b/src/version2/models/notificationRecipientsRestrictions.mts @@ -0,0 +1,12 @@ +import type { GroupName } from './groupName.mjs'; +import { RestrictedPermission } from './restrictedPermission.mjs'; + +/** Details of the group membership or permissions needed to receive the notification. */ +export interface NotificationRecipientsRestrictions { + /** List of groupId memberships required to receive the notification. */ + groupIds?: string[]; + /** List of group memberships required to receive the notification. */ + groups?: GroupName[]; + /** List of permissions required to receive the notification. */ + permissions?: RestrictedPermission[]; +} diff --git a/src/version2/models/notificationRecipientsRestrictions.ts b/src/version2/models/notificationRecipientsRestrictions.ts deleted file mode 100644 index f8c941a6ec..0000000000 --- a/src/version2/models/notificationRecipientsRestrictions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { GroupName } from './groupName'; -import { RestrictedPermission } from './restrictedPermission'; - -/** Details of the group membership or permissions needed to receive the notification. */ -export interface NotificationRecipientsRestrictions { - /** List of groupId memberships required to receive the notification. */ - groupIds?: string[]; - /** List of group memberships required to receive the notification. */ - groups?: GroupName[]; - /** List of permissions required to receive the notification. */ - permissions?: RestrictedPermission[]; -} diff --git a/src/version2/models/notificationScheme.mts b/src/version2/models/notificationScheme.mts new file mode 100644 index 0000000000..5667cf5be5 --- /dev/null +++ b/src/version2/models/notificationScheme.mts @@ -0,0 +1,20 @@ +import { NotificationSchemeEvent } from './notificationSchemeEvent.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a notification scheme. */ +export interface NotificationScheme { + /** The description of the notification scheme. */ + description?: string; + /** Expand options that include additional notification scheme details in the response. */ + expand?: string; + /** The ID of the notification scheme. */ + id?: number; + /** The name of the notification scheme. */ + name?: string; + /** The notification events and associated recipients. */ + notificationSchemeEvents?: NotificationSchemeEvent[]; + /** The list of project IDs associated with the notification scheme. */ + projects?: number[]; + scope?: Scope; + self?: string; +} diff --git a/src/version2/models/notificationScheme.ts b/src/version2/models/notificationScheme.ts deleted file mode 100644 index 9e507e03cc..0000000000 --- a/src/version2/models/notificationScheme.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NotificationSchemeEvent } from './notificationSchemeEvent'; -import { Scope } from './scope'; - -/** Details about a notification scheme. */ -export interface NotificationScheme { - /** The description of the notification scheme. */ - description?: string; - /** Expand options that include additional notification scheme details in the response. */ - expand?: string; - /** The ID of the notification scheme. */ - id?: number; - /** The name of the notification scheme. */ - name?: string; - /** The notification events and associated recipients. */ - notificationSchemeEvents?: NotificationSchemeEvent[]; - /** The list of project IDs associated with the notification scheme. */ - projects?: number[]; - scope?: Scope; - self?: string; -} diff --git a/src/version2/models/notificationSchemeAndProjectMapping.ts b/src/version2/models/notificationSchemeAndProjectMapping.mts similarity index 100% rename from src/version2/models/notificationSchemeAndProjectMapping.ts rename to src/version2/models/notificationSchemeAndProjectMapping.mts diff --git a/src/version2/models/notificationSchemeAndProjectMappingPage.mts b/src/version2/models/notificationSchemeAndProjectMappingPage.mts new file mode 100644 index 0000000000..c8278b5b3e --- /dev/null +++ b/src/version2/models/notificationSchemeAndProjectMappingPage.mts @@ -0,0 +1,19 @@ +import { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping.mjs'; + +/** A page of items. */ +export interface NotificationSchemeAndProjectMappingPage { + /** 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?: NotificationSchemeAndProjectMapping[]; +} diff --git a/src/version2/models/notificationSchemeAndProjectMappingPage.ts b/src/version2/models/notificationSchemeAndProjectMappingPage.ts deleted file mode 100644 index 21a77840dc..0000000000 --- a/src/version2/models/notificationSchemeAndProjectMappingPage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping'; - -/** A page of items. */ -export interface NotificationSchemeAndProjectMappingPage { - /** 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?: NotificationSchemeAndProjectMapping[]; -} diff --git a/src/version2/models/notificationSchemeEvent.mts b/src/version2/models/notificationSchemeEvent.mts new file mode 100644 index 0000000000..f135060a6d --- /dev/null +++ b/src/version2/models/notificationSchemeEvent.mts @@ -0,0 +1,8 @@ +import { EventNotification } from './eventNotification.mjs'; +import { NotificationEvent } from './notificationEvent.mjs'; + +/** Details about a notification scheme event. */ +export interface NotificationSchemeEvent { + event?: NotificationEvent; + notifications?: EventNotification[]; +} diff --git a/src/version2/models/notificationSchemeEvent.ts b/src/version2/models/notificationSchemeEvent.ts deleted file mode 100644 index 9f67d81317..0000000000 --- a/src/version2/models/notificationSchemeEvent.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { EventNotification } from './eventNotification'; -import { NotificationEvent } from './notificationEvent'; - -/** Details about a notification scheme event. */ -export interface NotificationSchemeEvent { - event?: NotificationEvent; - notifications?: EventNotification[]; -} diff --git a/src/version2/models/notificationSchemeEventDetails.mts b/src/version2/models/notificationSchemeEventDetails.mts new file mode 100644 index 0000000000..1bc5e86fb2 --- /dev/null +++ b/src/version2/models/notificationSchemeEventDetails.mts @@ -0,0 +1,9 @@ +import { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId.mjs'; +import { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails.mjs'; + +/** Details of a notification scheme event. */ +export interface NotificationSchemeEventDetails { + event?: NotificationSchemeEventTypeId; + /** The list of notifications mapped to a specified event. */ + notifications: NotificationSchemeNotificationDetails[]; +} diff --git a/src/version2/models/notificationSchemeEventDetails.ts b/src/version2/models/notificationSchemeEventDetails.ts deleted file mode 100644 index 254082cad8..0000000000 --- a/src/version2/models/notificationSchemeEventDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId'; -import { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails'; - -/** Details of a notification scheme event. */ -export interface NotificationSchemeEventDetails { - event?: NotificationSchemeEventTypeId; - /** The list of notifications mapped to a specified event. */ - notifications: NotificationSchemeNotificationDetails[]; -} diff --git a/src/version2/models/notificationSchemeEventTypeId.ts b/src/version2/models/notificationSchemeEventTypeId.mts similarity index 100% rename from src/version2/models/notificationSchemeEventTypeId.ts rename to src/version2/models/notificationSchemeEventTypeId.mts diff --git a/src/version2/models/notificationSchemeId.ts b/src/version2/models/notificationSchemeId.mts similarity index 100% rename from src/version2/models/notificationSchemeId.ts rename to src/version2/models/notificationSchemeId.mts diff --git a/src/version2/models/notificationSchemeNotificationDetails.ts b/src/version2/models/notificationSchemeNotificationDetails.mts similarity index 100% rename from src/version2/models/notificationSchemeNotificationDetails.ts rename to src/version2/models/notificationSchemeNotificationDetails.mts diff --git a/src/version2/models/oldToNewSecurityLevelMappings.ts b/src/version2/models/oldToNewSecurityLevelMappings.mts similarity index 100% rename from src/version2/models/oldToNewSecurityLevelMappings.ts rename to src/version2/models/oldToNewSecurityLevelMappings.mts diff --git a/src/version2/models/operationMessage.ts b/src/version2/models/operationMessage.mts similarity index 100% rename from src/version2/models/operationMessage.ts rename to src/version2/models/operationMessage.mts diff --git a/src/version2/models/operations.mts b/src/version2/models/operations.mts new file mode 100644 index 0000000000..abc4e9bf0e --- /dev/null +++ b/src/version2/models/operations.mts @@ -0,0 +1,7 @@ +import { LinkGroup } from './linkGroup.mjs'; + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; +} diff --git a/src/version2/models/operations.ts b/src/version2/models/operations.ts deleted file mode 100644 index 11702d0336..0000000000 --- a/src/version2/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { LinkGroup } from './linkGroup'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/version2/models/orderOfCustomFieldOptions.ts b/src/version2/models/orderOfCustomFieldOptions.mts similarity index 100% rename from src/version2/models/orderOfCustomFieldOptions.ts rename to src/version2/models/orderOfCustomFieldOptions.mts diff --git a/src/version2/models/orderOfIssueTypes.ts b/src/version2/models/orderOfIssueTypes.mts similarity index 100% rename from src/version2/models/orderOfIssueTypes.ts rename to src/version2/models/orderOfIssueTypes.mts diff --git a/src/version2/models/pageChangelog.mts b/src/version2/models/pageChangelog.mts new file mode 100644 index 0000000000..7f8aab8058 --- /dev/null +++ b/src/version2/models/pageChangelog.mts @@ -0,0 +1,19 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of items. */ +export interface PageChangelog { + /** 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?: Changelog[]; +} diff --git a/src/version2/models/pageChangelog.ts b/src/version2/models/pageChangelog.ts deleted file mode 100644 index a753d1a8af..0000000000 --- a/src/version2/models/pageChangelog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Changelog } from './changelog'; - -/** A page of items. */ -export interface PageChangelog { - /** 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?: Changelog[]; -} diff --git a/src/version2/models/pageComment.mts b/src/version2/models/pageComment.mts new file mode 100644 index 0000000000..7306adc31e --- /dev/null +++ b/src/version2/models/pageComment.mts @@ -0,0 +1,19 @@ +import type { Comment } from './comment.mjs'; + +/** A page of items. */ +export interface PageComment { + /** 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?: Comment[]; +} diff --git a/src/version2/models/pageComment.ts b/src/version2/models/pageComment.ts deleted file mode 100644 index 23f429ea60..0000000000 --- a/src/version2/models/pageComment.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Comment } from './comment'; - -/** A page of items. */ -export interface PageComment { - /** 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?: Comment[]; -} diff --git a/src/version2/models/pageComponentWithIssueCount.mts b/src/version2/models/pageComponentWithIssueCount.mts new file mode 100644 index 0000000000..b8ca11611e --- /dev/null +++ b/src/version2/models/pageComponentWithIssueCount.mts @@ -0,0 +1,19 @@ +import { ComponentWithIssueCount } from './componentWithIssueCount.mjs'; + +/** A page of items. */ +export interface PageComponentWithIssueCount { + /** 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?: ComponentWithIssueCount[]; +} diff --git a/src/version2/models/pageComponentWithIssueCount.ts b/src/version2/models/pageComponentWithIssueCount.ts deleted file mode 100644 index ef5d0ac564..0000000000 --- a/src/version2/models/pageComponentWithIssueCount.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ComponentWithIssueCount } from './componentWithIssueCount'; - -/** A page of items. */ -export interface PageComponentWithIssueCount { - /** 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?: ComponentWithIssueCount[]; -} diff --git a/src/version2/models/pageContextForProjectAndIssueType.mts b/src/version2/models/pageContextForProjectAndIssueType.mts new file mode 100644 index 0000000000..04b0f02fe6 --- /dev/null +++ b/src/version2/models/pageContextForProjectAndIssueType.mts @@ -0,0 +1,19 @@ +import { ContextForProjectAndIssueType } from './contextForProjectAndIssueType.mjs'; + +/** A page of items. */ +export interface PageContextForProjectAndIssueType { + /** 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?: ContextForProjectAndIssueType[]; +} diff --git a/src/version2/models/pageContextForProjectAndIssueType.ts b/src/version2/models/pageContextForProjectAndIssueType.ts deleted file mode 100644 index 055630fbac..0000000000 --- a/src/version2/models/pageContextForProjectAndIssueType.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ContextForProjectAndIssueType } from './contextForProjectAndIssueType'; - -/** A page of items. */ -export interface PageContextForProjectAndIssueType { - /** 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?: ContextForProjectAndIssueType[]; -} diff --git a/src/version2/models/pageContextualConfiguration.mts b/src/version2/models/pageContextualConfiguration.mts new file mode 100644 index 0000000000..40edfda5f7 --- /dev/null +++ b/src/version2/models/pageContextualConfiguration.mts @@ -0,0 +1,19 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** A page of items. */ +export interface PageContextualConfiguration { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ContextualConfiguration[]; +} diff --git a/src/version2/models/pageContextualConfiguration.ts b/src/version2/models/pageContextualConfiguration.ts deleted file mode 100644 index bdda760448..0000000000 --- a/src/version2/models/pageContextualConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ContextualConfiguration } from './contextualConfiguration'; - -/** A page of items. */ -export interface PageContextualConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ContextualConfiguration[]; -} diff --git a/src/version2/models/pageCustomFieldContext.mts b/src/version2/models/pageCustomFieldContext.mts new file mode 100644 index 0000000000..2edeafca15 --- /dev/null +++ b/src/version2/models/pageCustomFieldContext.mts @@ -0,0 +1,19 @@ +import { CustomFieldContext } from './customFieldContext.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContext { + /** 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?: CustomFieldContext[]; +} diff --git a/src/version2/models/pageCustomFieldContext.ts b/src/version2/models/pageCustomFieldContext.ts deleted file mode 100644 index e4499fb059..0000000000 --- a/src/version2/models/pageCustomFieldContext.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContext } from './customFieldContext'; - -/** A page of items. */ -export interface PageCustomFieldContext { - /** 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?: CustomFieldContext[]; -} diff --git a/src/version2/models/pageCustomFieldContextDefaultValue.mts b/src/version2/models/pageCustomFieldContextDefaultValue.mts new file mode 100644 index 0000000000..8042fb6280 --- /dev/null +++ b/src/version2/models/pageCustomFieldContextDefaultValue.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextDefaultValue { + /** 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?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version2/models/pageCustomFieldContextDefaultValue.ts b/src/version2/models/pageCustomFieldContextDefaultValue.ts deleted file mode 100644 index 86eb403dbb..0000000000 --- a/src/version2/models/pageCustomFieldContextDefaultValue.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue'; - -/** A page of items. */ -export interface PageCustomFieldContextDefaultValue { - /** 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?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version2/models/pageCustomFieldContextOption.mts b/src/version2/models/pageCustomFieldContextOption.mts new file mode 100644 index 0000000000..a8d74a1f9b --- /dev/null +++ b/src/version2/models/pageCustomFieldContextOption.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextOption { + /** 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?: CustomFieldContextOption[]; +} diff --git a/src/version2/models/pageCustomFieldContextOption.ts b/src/version2/models/pageCustomFieldContextOption.ts deleted file mode 100644 index ad5700b73b..0000000000 --- a/src/version2/models/pageCustomFieldContextOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContextOption } from './customFieldContextOption'; - -/** A page of items. */ -export interface PageCustomFieldContextOption { - /** 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?: CustomFieldContextOption[]; -} diff --git a/src/version2/models/pageCustomFieldContextProjectMapping.mts b/src/version2/models/pageCustomFieldContextProjectMapping.mts new file mode 100644 index 0000000000..7cc159b929 --- /dev/null +++ b/src/version2/models/pageCustomFieldContextProjectMapping.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextProjectMapping { + /** 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?: CustomFieldContextProjectMapping[]; +} diff --git a/src/version2/models/pageCustomFieldContextProjectMapping.ts b/src/version2/models/pageCustomFieldContextProjectMapping.ts deleted file mode 100644 index 2047e82c7d..0000000000 --- a/src/version2/models/pageCustomFieldContextProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping'; - -/** A page of items. */ -export interface PageCustomFieldContextProjectMapping { - /** 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?: CustomFieldContextProjectMapping[]; -} diff --git a/src/version2/models/pageDashboard.mts b/src/version2/models/pageDashboard.mts new file mode 100644 index 0000000000..2c68e4e7c3 --- /dev/null +++ b/src/version2/models/pageDashboard.mts @@ -0,0 +1,19 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page of items. */ +export interface PageDashboard { + /** 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?: Dashboard[]; +} diff --git a/src/version2/models/pageDashboard.ts b/src/version2/models/pageDashboard.ts deleted file mode 100644 index 29308bef79..0000000000 --- a/src/version2/models/pageDashboard.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Dashboard } from './dashboard'; - -/** A page of items. */ -export interface PageDashboard { - /** 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?: Dashboard[]; -} diff --git a/src/version2/models/pageField.mts b/src/version2/models/pageField.mts new file mode 100644 index 0000000000..85e2c28917 --- /dev/null +++ b/src/version2/models/pageField.mts @@ -0,0 +1,19 @@ +import { Field } from './field.mjs'; + +/** A page of items. */ +export interface PageField { + /** 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?: Field[]; +} diff --git a/src/version2/models/pageField.ts b/src/version2/models/pageField.ts deleted file mode 100644 index ef8afebc7a..0000000000 --- a/src/version2/models/pageField.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Field } from './field'; - -/** A page of items. */ -export interface PageField { - /** 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?: Field[]; -} diff --git a/src/version2/models/pageFieldConfiguration.mts b/src/version2/models/pageFieldConfiguration.mts new file mode 100644 index 0000000000..70bc30481d --- /dev/null +++ b/src/version2/models/pageFieldConfiguration.mts @@ -0,0 +1,19 @@ +import { FieldConfiguration } from './fieldConfiguration.mjs'; + +/** A page of items. */ +export interface PageFieldConfiguration { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: FieldConfiguration[]; +} diff --git a/src/version2/models/pageFieldConfiguration.ts b/src/version2/models/pageFieldConfiguration.ts deleted file mode 100644 index 4bac790f8e..0000000000 --- a/src/version2/models/pageFieldConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfiguration } from './fieldConfiguration'; - -/** A page of items. */ -export interface PageFieldConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: FieldConfiguration[]; -} diff --git a/src/version2/models/pageFieldConfigurationIssueTypeItem.mts b/src/version2/models/pageFieldConfigurationIssueTypeItem.mts new file mode 100644 index 0000000000..9be72fbebd --- /dev/null +++ b/src/version2/models/pageFieldConfigurationIssueTypeItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationIssueTypeItem { + /** 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?: FieldConfigurationIssueTypeItem[]; +} diff --git a/src/version2/models/pageFieldConfigurationIssueTypeItem.ts b/src/version2/models/pageFieldConfigurationIssueTypeItem.ts deleted file mode 100644 index 5ef3234475..0000000000 --- a/src/version2/models/pageFieldConfigurationIssueTypeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem'; - -/** A page of items. */ -export interface PageFieldConfigurationIssueTypeItem { - /** 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?: FieldConfigurationIssueTypeItem[]; -} diff --git a/src/version2/models/pageFieldConfigurationItem.mts b/src/version2/models/pageFieldConfigurationItem.mts new file mode 100644 index 0000000000..73b3ba2dd8 --- /dev/null +++ b/src/version2/models/pageFieldConfigurationItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationItem { + /** 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?: FieldConfigurationItem[]; +} diff --git a/src/version2/models/pageFieldConfigurationItem.ts b/src/version2/models/pageFieldConfigurationItem.ts deleted file mode 100644 index ab15f465c8..0000000000 --- a/src/version2/models/pageFieldConfigurationItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationItem } from './fieldConfigurationItem'; - -/** A page of items. */ -export interface PageFieldConfigurationItem { - /** 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?: FieldConfigurationItem[]; -} diff --git a/src/version2/models/pageFieldConfigurationScheme.mts b/src/version2/models/pageFieldConfigurationScheme.mts new file mode 100644 index 0000000000..55a235d77a --- /dev/null +++ b/src/version2/models/pageFieldConfigurationScheme.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationScheme { + /** 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?: FieldConfigurationScheme[]; +} diff --git a/src/version2/models/pageFieldConfigurationScheme.ts b/src/version2/models/pageFieldConfigurationScheme.ts deleted file mode 100644 index 6f102460d3..0000000000 --- a/src/version2/models/pageFieldConfigurationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationScheme } from './fieldConfigurationScheme'; - -/** A page of items. */ -export interface PageFieldConfigurationScheme { - /** 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?: FieldConfigurationScheme[]; -} diff --git a/src/version2/models/pageFieldConfigurationSchemeProjects.mts b/src/version2/models/pageFieldConfigurationSchemeProjects.mts new file mode 100644 index 0000000000..3289e4a24d --- /dev/null +++ b/src/version2/models/pageFieldConfigurationSchemeProjects.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationSchemeProjects { + /** 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?: FieldConfigurationSchemeProjects[]; +} diff --git a/src/version2/models/pageFieldConfigurationSchemeProjects.ts b/src/version2/models/pageFieldConfigurationSchemeProjects.ts deleted file mode 100644 index 689efe9304..0000000000 --- a/src/version2/models/pageFieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects'; - -/** A page of items. */ -export interface PageFieldConfigurationSchemeProjects { - /** 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?: FieldConfigurationSchemeProjects[]; -} diff --git a/src/version2/models/pageFilterDetails.mts b/src/version2/models/pageFilterDetails.mts new file mode 100644 index 0000000000..1a20cddad3 --- /dev/null +++ b/src/version2/models/pageFilterDetails.mts @@ -0,0 +1,19 @@ +import { FilterDetails } from './filterDetails.mjs'; + +/** A page of items. */ +export interface PageFilterDetails { + /** 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?: FilterDetails[]; +} diff --git a/src/version2/models/pageFilterDetails.ts b/src/version2/models/pageFilterDetails.ts deleted file mode 100644 index a076d86c88..0000000000 --- a/src/version2/models/pageFilterDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FilterDetails } from './filterDetails'; - -/** A page of items. */ -export interface PageFilterDetails { - /** 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?: FilterDetails[]; -} diff --git a/src/version2/models/pageGroupDetails.mts b/src/version2/models/pageGroupDetails.mts new file mode 100644 index 0000000000..4570bb7e3c --- /dev/null +++ b/src/version2/models/pageGroupDetails.mts @@ -0,0 +1,19 @@ +import { GroupDetails } from './groupDetails.mjs'; + +/** A page of items. */ +export interface PageGroupDetails { + /** 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?: GroupDetails[]; +} diff --git a/src/version2/models/pageGroupDetails.ts b/src/version2/models/pageGroupDetails.ts deleted file mode 100644 index 0acf0eca07..0000000000 --- a/src/version2/models/pageGroupDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { GroupDetails } from './groupDetails'; - -/** A page of items. */ -export interface PageGroupDetails { - /** 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?: GroupDetails[]; -} diff --git a/src/version2/models/pageIssueFieldOption.mts b/src/version2/models/pageIssueFieldOption.mts new file mode 100644 index 0000000000..9a41ac1e77 --- /dev/null +++ b/src/version2/models/pageIssueFieldOption.mts @@ -0,0 +1,19 @@ +import { IssueFieldOption } from './issueFieldOption.mjs'; + +/** A page of items. */ +export interface PageIssueFieldOption { + /** 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?: IssueFieldOption[]; +} diff --git a/src/version2/models/pageIssueFieldOption.ts b/src/version2/models/pageIssueFieldOption.ts deleted file mode 100644 index 21e3c95558..0000000000 --- a/src/version2/models/pageIssueFieldOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueFieldOption } from './issueFieldOption'; - -/** A page of items. */ -export interface PageIssueFieldOption { - /** 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?: IssueFieldOption[]; -} diff --git a/src/version2/models/pageIssueSecurityLevelMember.mts b/src/version2/models/pageIssueSecurityLevelMember.mts new file mode 100644 index 0000000000..3278466562 --- /dev/null +++ b/src/version2/models/pageIssueSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import { IssueSecurityLevelMember } from './issueSecurityLevelMember.mjs'; + +/** A page of items. */ +export interface PageIssueSecurityLevelMember { + /** 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?: IssueSecurityLevelMember[]; +} diff --git a/src/version2/models/pageIssueSecurityLevelMember.ts b/src/version2/models/pageIssueSecurityLevelMember.ts deleted file mode 100644 index 5c4bcae18e..0000000000 --- a/src/version2/models/pageIssueSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueSecurityLevelMember } from './issueSecurityLevelMember'; - -/** A page of items. */ -export interface PageIssueSecurityLevelMember { - /** 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?: IssueSecurityLevelMember[]; -} diff --git a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts new file mode 100644 index 0000000000..70819c8f53 --- /dev/null +++ b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.mts @@ -0,0 +1,19 @@ +import { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping.mjs'; + +/** A page of items. */ +export interface PageIssueSecuritySchemeToProjectMapping { + /** 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: IssueSecuritySchemeToProjectMapping[]; +} diff --git a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts b/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts deleted file mode 100644 index a2c49e6554..0000000000 --- a/src/version2/models/pageIssueSecuritySchemeToProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping'; - -/** A page of items. */ -export interface PageIssueSecuritySchemeToProjectMapping { - /** 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: IssueSecuritySchemeToProjectMapping[]; -} diff --git a/src/version2/models/pageIssueTypeScheme.mts b/src/version2/models/pageIssueTypeScheme.mts new file mode 100644 index 0000000000..b4b2954f37 --- /dev/null +++ b/src/version2/models/pageIssueTypeScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScheme { + /** 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?: IssueTypeScheme[]; +} diff --git a/src/version2/models/pageIssueTypeScheme.ts b/src/version2/models/pageIssueTypeScheme.ts deleted file mode 100644 index c5278a5d8c..0000000000 --- a/src/version2/models/pageIssueTypeScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScheme } from './issueTypeScheme'; - -/** A page of items. */ -export interface PageIssueTypeScheme { - /** 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?: IssueTypeScheme[]; -} diff --git a/src/version2/models/pageIssueTypeSchemeMapping.mts b/src/version2/models/pageIssueTypeSchemeMapping.mts new file mode 100644 index 0000000000..7efa7541d3 --- /dev/null +++ b/src/version2/models/pageIssueTypeSchemeMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeMapping } from './issueTypeSchemeMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeMapping { + /** 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?: IssueTypeSchemeMapping[]; +} diff --git a/src/version2/models/pageIssueTypeSchemeMapping.ts b/src/version2/models/pageIssueTypeSchemeMapping.ts deleted file mode 100644 index 98bd0b065f..0000000000 --- a/src/version2/models/pageIssueTypeSchemeMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeSchemeMapping } from './issueTypeSchemeMapping'; - -/** A page of items. */ -export interface PageIssueTypeSchemeMapping { - /** 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?: IssueTypeSchemeMapping[]; -} diff --git a/src/version2/models/pageIssueTypeSchemeProjects.mts b/src/version2/models/pageIssueTypeSchemeProjects.mts new file mode 100644 index 0000000000..11be816b1c --- /dev/null +++ b/src/version2/models/pageIssueTypeSchemeProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeProjects } from './issueTypeSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeProjects { + /** 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?: IssueTypeSchemeProjects[]; +} diff --git a/src/version2/models/pageIssueTypeSchemeProjects.ts b/src/version2/models/pageIssueTypeSchemeProjects.ts deleted file mode 100644 index 04193eb916..0000000000 --- a/src/version2/models/pageIssueTypeSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeSchemeProjects } from './issueTypeSchemeProjects'; - -/** A page of items. */ -export interface PageIssueTypeSchemeProjects { - /** 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?: IssueTypeSchemeProjects[]; -} diff --git a/src/version2/models/pageIssueTypeScreenScheme.mts b/src/version2/models/pageIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..1a13ac3f3a --- /dev/null +++ b/src/version2/models/pageIssueTypeScreenScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenScheme { + /** 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?: IssueTypeScreenScheme[]; +} diff --git a/src/version2/models/pageIssueTypeScreenScheme.ts b/src/version2/models/pageIssueTypeScreenScheme.ts deleted file mode 100644 index efceb76530..0000000000 --- a/src/version2/models/pageIssueTypeScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScreenScheme } from './issueTypeScreenScheme'; - -/** A page of items. */ -export interface PageIssueTypeScreenScheme { - /** 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?: IssueTypeScreenScheme[]; -} diff --git a/src/version2/models/pageIssueTypeScreenSchemeItem.mts b/src/version2/models/pageIssueTypeScreenSchemeItem.mts new file mode 100644 index 0000000000..7eac1170fd --- /dev/null +++ b/src/version2/models/pageIssueTypeScreenSchemeItem.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemeItem { + /** 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?: IssueTypeScreenSchemeItem[]; +} diff --git a/src/version2/models/pageIssueTypeScreenSchemeItem.ts b/src/version2/models/pageIssueTypeScreenSchemeItem.ts deleted file mode 100644 index bca94e0421..0000000000 --- a/src/version2/models/pageIssueTypeScreenSchemeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemeItem { - /** 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?: IssueTypeScreenSchemeItem[]; -} diff --git a/src/version2/models/pageIssueTypeScreenSchemesProjects.mts b/src/version2/models/pageIssueTypeScreenSchemesProjects.mts new file mode 100644 index 0000000000..6efd944862 --- /dev/null +++ b/src/version2/models/pageIssueTypeScreenSchemesProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemesProjects { + /** 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?: IssueTypeScreenSchemesProjects[]; +} diff --git a/src/version2/models/pageIssueTypeScreenSchemesProjects.ts b/src/version2/models/pageIssueTypeScreenSchemesProjects.ts deleted file mode 100644 index b610f12b7f..0000000000 --- a/src/version2/models/pageIssueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemesProjects { - /** 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?: IssueTypeScreenSchemesProjects[]; -} diff --git a/src/version2/models/pageIssueTypeToContextMapping.mts b/src/version2/models/pageIssueTypeToContextMapping.mts new file mode 100644 index 0000000000..d0127eca88 --- /dev/null +++ b/src/version2/models/pageIssueTypeToContextMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeToContextMapping } from './issueTypeToContextMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeToContextMapping { + /** 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?: IssueTypeToContextMapping[]; +} diff --git a/src/version2/models/pageIssueTypeToContextMapping.ts b/src/version2/models/pageIssueTypeToContextMapping.ts deleted file mode 100644 index dba1d84f5a..0000000000 --- a/src/version2/models/pageIssueTypeToContextMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeToContextMapping } from './issueTypeToContextMapping'; - -/** A page of items. */ -export interface PageIssueTypeToContextMapping { - /** 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?: IssueTypeToContextMapping[]; -} diff --git a/src/version2/models/pageJqlFunctionPrecomputation.mts b/src/version2/models/pageJqlFunctionPrecomputation.mts new file mode 100644 index 0000000000..3e2c315a4f --- /dev/null +++ b/src/version2/models/pageJqlFunctionPrecomputation.mts @@ -0,0 +1,19 @@ +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation.mjs'; + +/** A page of items. */ +export interface PageJqlFunctionPrecomputation { + /** 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?: JqlFunctionPrecomputation[]; +} diff --git a/src/version2/models/pageJqlFunctionPrecomputation.ts b/src/version2/models/pageJqlFunctionPrecomputation.ts deleted file mode 100644 index 3104ea5653..0000000000 --- a/src/version2/models/pageJqlFunctionPrecomputation.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; - -/** A page of items. */ -export interface PageJqlFunctionPrecomputation { - /** 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?: JqlFunctionPrecomputation[]; -} diff --git a/src/version2/models/pageNotificationScheme.mts b/src/version2/models/pageNotificationScheme.mts new file mode 100644 index 0000000000..266c800824 --- /dev/null +++ b/src/version2/models/pageNotificationScheme.mts @@ -0,0 +1,19 @@ +import { NotificationScheme } from './notificationScheme.mjs'; + +/** A page of items. */ +export interface PageNotificationScheme { + /** 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?: NotificationScheme[]; +} diff --git a/src/version2/models/pageNotificationScheme.ts b/src/version2/models/pageNotificationScheme.ts deleted file mode 100644 index e8cbb5c1e5..0000000000 --- a/src/version2/models/pageNotificationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NotificationScheme } from './notificationScheme'; - -/** A page of items. */ -export interface PageNotificationScheme { - /** 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?: NotificationScheme[]; -} diff --git a/src/version2/models/pageOfChangelogs.mts b/src/version2/models/pageOfChangelogs.mts new file mode 100644 index 0000000000..8e78bc40ef --- /dev/null +++ b/src/version2/models/pageOfChangelogs.mts @@ -0,0 +1,13 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of changelogs. */ +export interface PageOfChangelogs { + /** The list of changelogs. */ + histories?: Changelog[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; +} diff --git a/src/version2/models/pageOfChangelogs.ts b/src/version2/models/pageOfChangelogs.ts deleted file mode 100644 index da5aa695cc..0000000000 --- a/src/version2/models/pageOfChangelogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Changelog } from './changelog'; - -/** A page of changelogs. */ -export interface PageOfChangelogs { - /** The list of changelogs. */ - histories?: Changelog[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; -} diff --git a/src/version2/models/pageOfComments.mts b/src/version2/models/pageOfComments.mts new file mode 100644 index 0000000000..3db4529e71 --- /dev/null +++ b/src/version2/models/pageOfComments.mts @@ -0,0 +1,13 @@ +import type { Comment } from './comment.mjs'; + +/** A page of comments. */ +export interface PageOfComments { + /** The list of comments. */ + comments?: Comment[]; + /** 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; +} diff --git a/src/version2/models/pageOfComments.ts b/src/version2/models/pageOfComments.ts deleted file mode 100644 index 8c681c1dbd..0000000000 --- a/src/version2/models/pageOfComments.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Comment } from './comment'; - -/** A page of comments. */ -export interface PageOfComments { - /** The list of comments. */ - comments?: Comment[]; - /** 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; -} diff --git a/src/version2/models/pageOfDashboards.mts b/src/version2/models/pageOfDashboards.mts new file mode 100644 index 0000000000..fb117b1953 --- /dev/null +++ b/src/version2/models/pageOfDashboards.mts @@ -0,0 +1,17 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page containing dashboard details. */ +export interface PageOfDashboards { + /** List of dashboards. */ + dashboards?: Dashboard[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The URL of the next page of results, if any. */ + next?: string; + /** The URL of the previous page of results, if any. */ + prev?: string; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; +} diff --git a/src/version2/models/pageOfDashboards.ts b/src/version2/models/pageOfDashboards.ts deleted file mode 100644 index 65f9386373..0000000000 --- a/src/version2/models/pageOfDashboards.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Dashboard } from './dashboard'; - -/** A page containing dashboard details. */ -export interface PageOfDashboards { - /** List of dashboards. */ - dashboards?: Dashboard[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The URL of the next page of results, if any. */ - next?: string; - /** The URL of the previous page of results, if any. */ - prev?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; -} diff --git a/src/version2/models/pageOfStatuses.mts b/src/version2/models/pageOfStatuses.mts new file mode 100644 index 0000000000..fd73d1105e --- /dev/null +++ b/src/version2/models/pageOfStatuses.mts @@ -0,0 +1,18 @@ +import type { JiraStatus } from './jiraStatus.mjs'; + +export interface PageOfStatuses { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The URL of the next page of results, if any. */ + nextPage?: string; + /** The URL of this page. */ + self?: string; + /** The index of the first item returned on the page. */ + startAt?: number; + /** Number of items that satisfy the search. */ + total?: number; + /** The list of items. */ + values?: JiraStatus[]; +} diff --git a/src/version2/models/pageOfStatuses.ts b/src/version2/models/pageOfStatuses.ts deleted file mode 100644 index c31aa61007..0000000000 --- a/src/version2/models/pageOfStatuses.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { JiraStatus } from './jiraStatus'; - -export interface PageOfStatuses { - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The URL of the next page of results, if any. */ - nextPage?: string; - /** The URL of this page. */ - self?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** Number of items that satisfy the search. */ - total?: number; - /** The list of items. */ - values?: JiraStatus[]; -} diff --git a/src/version2/models/pageOfWorklogs.mts b/src/version2/models/pageOfWorklogs.mts new file mode 100644 index 0000000000..26de9ffa78 --- /dev/null +++ b/src/version2/models/pageOfWorklogs.mts @@ -0,0 +1,13 @@ +import type { Worklog } from './worklog.mjs'; + +/** Paginated list of worklog details */ +export interface PageOfWorklogs { + /** The maximum number of results that could be on the page. */ + maxResults: number; + /** The index of the first item returned on the page. */ + startAt: number; + /** The number of results on the page. */ + total: number; + /** List of worklogs. */ + worklogs: Worklog[]; +} diff --git a/src/version2/models/pageOfWorklogs.ts b/src/version2/models/pageOfWorklogs.ts deleted file mode 100644 index 2d131b35f5..0000000000 --- a/src/version2/models/pageOfWorklogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Worklog } from './worklog'; - -/** Paginated list of worklog details */ -export interface PageOfWorklogs { - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The index of the first item returned on the page. */ - startAt: number; - /** The number of results on the page. */ - total: number; - /** List of worklogs. */ - worklogs: Worklog[]; -} diff --git a/src/version2/models/pagePriority.mts b/src/version2/models/pagePriority.mts new file mode 100644 index 0000000000..bac0150bcd --- /dev/null +++ b/src/version2/models/pagePriority.mts @@ -0,0 +1,19 @@ +import type { Priority } from './priority.mjs'; + +/** A page of items. */ +export interface PagePriority { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Priority[]; +} diff --git a/src/version2/models/pagePriority.ts b/src/version2/models/pagePriority.ts deleted file mode 100644 index 4aa76c37cc..0000000000 --- a/src/version2/models/pagePriority.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Priority } from './priority'; - -/** A page of items. */ -export interface PagePriority { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Priority[]; -} diff --git a/src/version2/models/pageProject.mts b/src/version2/models/pageProject.mts new file mode 100644 index 0000000000..3f8670f7c0 --- /dev/null +++ b/src/version2/models/pageProject.mts @@ -0,0 +1,19 @@ +import type { Project } from './project.mjs'; + +/** A page of items. */ +export interface PageProject { + /** 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: Project[]; +} diff --git a/src/version2/models/pageProject.ts b/src/version2/models/pageProject.ts deleted file mode 100644 index e9327c76b2..0000000000 --- a/src/version2/models/pageProject.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Project } from './project'; - -/** A page of items. */ -export interface PageProject { - /** 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: Project[]; -} diff --git a/src/version2/models/pageProjectDetails.mts b/src/version2/models/pageProjectDetails.mts new file mode 100644 index 0000000000..bb6f771d7b --- /dev/null +++ b/src/version2/models/pageProjectDetails.mts @@ -0,0 +1,19 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** A page of items. */ +export interface PageProjectDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ProjectDetails[]; +} diff --git a/src/version2/models/pageProjectDetails.ts b/src/version2/models/pageProjectDetails.ts deleted file mode 100644 index 0f1672409d..0000000000 --- a/src/version2/models/pageProjectDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ProjectDetails } from './projectDetails'; - -/** A page of items. */ -export interface PageProjectDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ProjectDetails[]; -} diff --git a/src/version2/models/pageResolution.mts b/src/version2/models/pageResolution.mts new file mode 100644 index 0000000000..59c7355b3f --- /dev/null +++ b/src/version2/models/pageResolution.mts @@ -0,0 +1,19 @@ +import type { Resolution } from './resolution.mjs'; + +/** A page of items. */ +export interface PageResolution { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Resolution[]; +} diff --git a/src/version2/models/pageResolution.ts b/src/version2/models/pageResolution.ts deleted file mode 100644 index 28760b7a99..0000000000 --- a/src/version2/models/pageResolution.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Resolution } from './resolution'; - -/** A page of items. */ -export interface PageResolution { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Resolution[]; -} diff --git a/src/version2/models/pageScreen.mts b/src/version2/models/pageScreen.mts new file mode 100644 index 0000000000..9f1a8e9141 --- /dev/null +++ b/src/version2/models/pageScreen.mts @@ -0,0 +1,19 @@ +import type { Screen } from './screen.mjs'; + +/** A page of items. */ +export interface PageScreen { + /** 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?: Screen[]; +} diff --git a/src/version2/models/pageScreen.ts b/src/version2/models/pageScreen.ts deleted file mode 100644 index d1e381cd8b..0000000000 --- a/src/version2/models/pageScreen.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Screen } from './screen'; - -/** A page of items. */ -export interface PageScreen { - /** 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?: Screen[]; -} diff --git a/src/version2/models/pageScreenScheme.mts b/src/version2/models/pageScreenScheme.mts new file mode 100644 index 0000000000..f8a7c693b5 --- /dev/null +++ b/src/version2/models/pageScreenScheme.mts @@ -0,0 +1,19 @@ +import type { ScreenScheme } from './screenScheme.mjs'; + +/** A page of items. */ +export interface PageScreenScheme { + /** 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?: ScreenScheme[]; +} diff --git a/src/version2/models/pageScreenScheme.ts b/src/version2/models/pageScreenScheme.ts deleted file mode 100644 index 924af96948..0000000000 --- a/src/version2/models/pageScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ScreenScheme } from './screenScheme'; - -/** A page of items. */ -export interface PageScreenScheme { - /** 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?: ScreenScheme[]; -} diff --git a/src/version2/models/pageScreenWithTab.mts b/src/version2/models/pageScreenWithTab.mts new file mode 100644 index 0000000000..6400ffe480 --- /dev/null +++ b/src/version2/models/pageScreenWithTab.mts @@ -0,0 +1,19 @@ +import type { ScreenWithTab } from './screenWithTab.mjs'; + +/** A page of items. */ +export interface PageScreenWithTab { + /** 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?: ScreenWithTab[]; +} diff --git a/src/version2/models/pageScreenWithTab.ts b/src/version2/models/pageScreenWithTab.ts deleted file mode 100644 index 8d9c234746..0000000000 --- a/src/version2/models/pageScreenWithTab.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ScreenWithTab } from './screenWithTab'; - -/** A page of items. */ -export interface PageScreenWithTab { - /** 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?: ScreenWithTab[]; -} diff --git a/src/version2/models/pageSecurityLevel.mts b/src/version2/models/pageSecurityLevel.mts new file mode 100644 index 0000000000..131ab86e80 --- /dev/null +++ b/src/version2/models/pageSecurityLevel.mts @@ -0,0 +1,19 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** A page of items. */ +export interface PageSecurityLevel { + /** 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: SecurityLevel[]; +} diff --git a/src/version2/models/pageSecurityLevel.ts b/src/version2/models/pageSecurityLevel.ts deleted file mode 100644 index 629a4ef9fe..0000000000 --- a/src/version2/models/pageSecurityLevel.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SecurityLevel } from './securityLevel'; - -/** A page of items. */ -export interface PageSecurityLevel { - /** 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: SecurityLevel[]; -} diff --git a/src/version2/models/pageSecurityLevelMember.mts b/src/version2/models/pageSecurityLevelMember.mts new file mode 100644 index 0000000000..d455f37d09 --- /dev/null +++ b/src/version2/models/pageSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import type { SecurityLevelMember } from './securityLevelMember.mjs'; + +/** A page of items. */ +export interface PageSecurityLevelMember { + /** 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: SecurityLevelMember[]; +} diff --git a/src/version2/models/pageSecurityLevelMember.ts b/src/version2/models/pageSecurityLevelMember.ts deleted file mode 100644 index 5519acc8a3..0000000000 --- a/src/version2/models/pageSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SecurityLevelMember } from './securityLevelMember'; - -/** A page of items. */ -export interface PageSecurityLevelMember { - /** 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: SecurityLevelMember[]; -} diff --git a/src/version2/models/pageSecuritySchemeWithProjects.mts b/src/version2/models/pageSecuritySchemeWithProjects.mts new file mode 100644 index 0000000000..54d63a3c5b --- /dev/null +++ b/src/version2/models/pageSecuritySchemeWithProjects.mts @@ -0,0 +1,19 @@ +import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects.mjs'; + +/** A page of items. */ +export interface PageSecuritySchemeWithProjects { + /** 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: SecuritySchemeWithProjects[]; +} diff --git a/src/version2/models/pageSecuritySchemeWithProjects.ts b/src/version2/models/pageSecuritySchemeWithProjects.ts deleted file mode 100644 index a03f5ea09d..0000000000 --- a/src/version2/models/pageSecuritySchemeWithProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SecuritySchemeWithProjects } from './securitySchemeWithProjects'; - -/** A page of items. */ -export interface PageSecuritySchemeWithProjects { - /** 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: SecuritySchemeWithProjects[]; -} diff --git a/src/version2/models/pageString.ts b/src/version2/models/pageString.mts similarity index 100% rename from src/version2/models/pageString.ts rename to src/version2/models/pageString.mts diff --git a/src/version2/models/pageUiModificationDetails.mts b/src/version2/models/pageUiModificationDetails.mts new file mode 100644 index 0000000000..3c85bb4b3a --- /dev/null +++ b/src/version2/models/pageUiModificationDetails.mts @@ -0,0 +1,19 @@ +import type { UiModificationDetails } from './uiModificationDetails.mjs'; + +/** A page of items. */ +export interface PageUiModificationDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: UiModificationDetails[]; +} diff --git a/src/version2/models/pageUiModificationDetails.ts b/src/version2/models/pageUiModificationDetails.ts deleted file mode 100644 index b29e8c928e..0000000000 --- a/src/version2/models/pageUiModificationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UiModificationDetails } from './uiModificationDetails'; - -/** A page of items. */ -export interface PageUiModificationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: UiModificationDetails[]; -} diff --git a/src/version2/models/pageUser.mts b/src/version2/models/pageUser.mts new file mode 100644 index 0000000000..c57577c91d --- /dev/null +++ b/src/version2/models/pageUser.mts @@ -0,0 +1,19 @@ +import { User } from './user.mjs'; + +/** A page of items. */ +export interface PageUser { + /** 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?: User[]; +} diff --git a/src/version2/models/pageUser.ts b/src/version2/models/pageUser.ts deleted file mode 100644 index 0486b7ed1d..0000000000 --- a/src/version2/models/pageUser.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { User } from './user'; - -/** A page of items. */ -export interface PageUser { - /** 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?: User[]; -} diff --git a/src/version2/models/pageUserDetails.mts b/src/version2/models/pageUserDetails.mts new file mode 100644 index 0000000000..8c77b5deab --- /dev/null +++ b/src/version2/models/pageUserDetails.mts @@ -0,0 +1,19 @@ +import { UserDetails } from './userDetails.mjs'; + +/** A page of items. */ +export interface PageUserDetails { + /** 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?: UserDetails[]; +} diff --git a/src/version2/models/pageUserDetails.ts b/src/version2/models/pageUserDetails.ts deleted file mode 100644 index e6456227e1..0000000000 --- a/src/version2/models/pageUserDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** A page of items. */ -export interface PageUserDetails { - /** 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?: UserDetails[]; -} diff --git a/src/version2/models/pageUserKey.mts b/src/version2/models/pageUserKey.mts new file mode 100644 index 0000000000..be04dc234b --- /dev/null +++ b/src/version2/models/pageUserKey.mts @@ -0,0 +1,19 @@ +import type { UserKey } from './userKey.mjs'; + +/** A page of items. */ +export interface PageUserKey { + /** 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?: UserKey[]; +} diff --git a/src/version2/models/pageUserKey.ts b/src/version2/models/pageUserKey.ts deleted file mode 100644 index d591323570..0000000000 --- a/src/version2/models/pageUserKey.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UserKey } from './userKey'; - -/** A page of items. */ -export interface PageUserKey { - /** 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?: UserKey[]; -} diff --git a/src/version2/models/pageVersion.mts b/src/version2/models/pageVersion.mts new file mode 100644 index 0000000000..b09289ea5f --- /dev/null +++ b/src/version2/models/pageVersion.mts @@ -0,0 +1,19 @@ +import type { Version } from './version.mjs'; + +/** A page of items. */ +export interface PageVersion { + /** 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?: Version[]; +} diff --git a/src/version2/models/pageVersion.ts b/src/version2/models/pageVersion.ts deleted file mode 100644 index 2226565274..0000000000 --- a/src/version2/models/pageVersion.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Version } from './version'; - -/** A page of items. */ -export interface PageVersion { - /** 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?: Version[]; -} diff --git a/src/version2/models/pageWebhook.mts b/src/version2/models/pageWebhook.mts new file mode 100644 index 0000000000..e18662b784 --- /dev/null +++ b/src/version2/models/pageWebhook.mts @@ -0,0 +1,19 @@ +import type { Webhook } from './webhook.mjs'; + +/** A page of items. */ +export interface PageWebhook { + /** 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?: Webhook[]; +} diff --git a/src/version2/models/pageWebhook.ts b/src/version2/models/pageWebhook.ts deleted file mode 100644 index 7a77edfb67..0000000000 --- a/src/version2/models/pageWebhook.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Webhook } from './webhook'; - -/** A page of items. */ -export interface PageWebhook { - /** 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?: Webhook[]; -} diff --git a/src/version2/models/pageWorkflow.mts b/src/version2/models/pageWorkflow.mts new file mode 100644 index 0000000000..e9fef4cf6b --- /dev/null +++ b/src/version2/models/pageWorkflow.mts @@ -0,0 +1,19 @@ +import type { Workflow } from './workflow.mjs'; + +/** A page of items. */ +export interface PageWorkflow { + /** 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?: Workflow[]; +} diff --git a/src/version2/models/pageWorkflow.ts b/src/version2/models/pageWorkflow.ts deleted file mode 100644 index 60ab409322..0000000000 --- a/src/version2/models/pageWorkflow.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Workflow } from './workflow'; - -/** A page of items. */ -export interface PageWorkflow { - /** 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?: Workflow[]; -} diff --git a/src/version2/models/pageWorkflowScheme.mts b/src/version2/models/pageWorkflowScheme.mts new file mode 100644 index 0000000000..bce4502827 --- /dev/null +++ b/src/version2/models/pageWorkflowScheme.mts @@ -0,0 +1,19 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A page of items. */ +export interface PageWorkflowScheme { + /** 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?: WorkflowScheme[]; +} diff --git a/src/version2/models/pageWorkflowScheme.ts b/src/version2/models/pageWorkflowScheme.ts deleted file mode 100644 index 44431297bc..0000000000 --- a/src/version2/models/pageWorkflowScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { WorkflowScheme } from './workflowScheme'; - -/** A page of items. */ -export interface PageWorkflowScheme { - /** 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?: WorkflowScheme[]; -} diff --git a/src/version2/models/pageWorkflowTransitionRules.mts b/src/version2/models/pageWorkflowTransitionRules.mts new file mode 100644 index 0000000000..5860100613 --- /dev/null +++ b/src/version2/models/pageWorkflowTransitionRules.mts @@ -0,0 +1,19 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** A page of items. */ +export interface PageWorkflowTransitionRules { + /** 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?: WorkflowTransitionRules[]; +} diff --git a/src/version2/models/pageWorkflowTransitionRules.ts b/src/version2/models/pageWorkflowTransitionRules.ts deleted file mode 100644 index 4daab20c37..0000000000 --- a/src/version2/models/pageWorkflowTransitionRules.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** A page of items. */ -export interface PageWorkflowTransitionRules { - /** 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?: WorkflowTransitionRules[]; -} diff --git a/src/version2/models/pagedListUserDetailsApplicationUser.mts b/src/version2/models/pagedListUserDetailsApplicationUser.mts new file mode 100644 index 0000000000..8f22b739aa --- /dev/null +++ b/src/version2/models/pagedListUserDetailsApplicationUser.mts @@ -0,0 +1,18 @@ +import { UserDetails } from './userDetails.mjs'; + +/** + * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, + * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. + */ +export interface PagedListUserDetailsApplicationUser { + /** The index of the last item returned on the page. */ + 'end-index'?: number; + /** The list of items. */ + items?: UserDetails[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The number of items on the page. */ + size?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; +} diff --git a/src/version2/models/pagedListUserDetailsApplicationUser.ts b/src/version2/models/pagedListUserDetailsApplicationUser.ts deleted file mode 100644 index 1e92b480c9..0000000000 --- a/src/version2/models/pagedListUserDetailsApplicationUser.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** - * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, - * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. - */ -export interface PagedListUserDetailsApplicationUser { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: UserDetails[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/parsedJqlQueries.mts b/src/version2/models/parsedJqlQueries.mts new file mode 100644 index 0000000000..e4ae784f63 --- /dev/null +++ b/src/version2/models/parsedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { ParsedJqlQuery } from './parsedJqlQuery.mjs'; + +/** A list of parsed Jql queries. */ +export interface ParsedJqlQueries { + /** A list of parsed Jql queries. */ + queries: ParsedJqlQuery[]; +} diff --git a/src/version2/models/parsedJqlQueries.ts b/src/version2/models/parsedJqlQueries.ts deleted file mode 100644 index bb75f00a3c..0000000000 --- a/src/version2/models/parsedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ParsedJqlQuery } from './parsedJqlQuery'; - -/** A list of parsed JQL queries. */ -export interface ParsedJqlQueries { - /** A list of parsed JQL queries. */ - queries: ParsedJqlQuery[]; -} diff --git a/src/version2/models/parsedJqlQuery.mts b/src/version2/models/parsedJqlQuery.mts new file mode 100644 index 0000000000..33299e83a3 --- /dev/null +++ b/src/version2/models/parsedJqlQuery.mts @@ -0,0 +1,10 @@ +import type { JqlQuery } from './jqlQuery.mjs'; + +/** Details of a parsed Jql query. */ +export interface ParsedJqlQuery { + /** The list of syntax or validation errors. */ + errors?: string[]; + /** The Jql query that was parsed and validated. */ + query: string; + structure?: JqlQuery; +} diff --git a/src/version2/models/parsedJqlQuery.ts b/src/version2/models/parsedJqlQuery.ts deleted file mode 100644 index fea14dedfe..0000000000 --- a/src/version2/models/parsedJqlQuery.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { JqlQuery } from './jqlQuery'; - -/** Details of a parsed JQL query. */ -export interface ParsedJqlQuery { - /** The list of syntax or validation errors. */ - errors?: string[]; - /** The JQL query that was parsed and validated. */ - query: string; - structure?: JqlQuery; -} diff --git a/src/version2/models/permissionDetails.mts b/src/version2/models/permissionDetails.mts new file mode 100644 index 0000000000..14aaa79dd6 --- /dev/null +++ b/src/version2/models/permissionDetails.mts @@ -0,0 +1,9 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details for permissions of shareable entities */ +export interface PermissionDetails { + /** The edit permissions for the shareable entities. */ + editPermissions: SharePermission[]; + /** The share permissions for the shareable entities. */ + sharePermissions: SharePermission[]; +} diff --git a/src/version2/models/permissionDetails.ts b/src/version2/models/permissionDetails.ts deleted file mode 100644 index df73897699..0000000000 --- a/src/version2/models/permissionDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { SharePermission } from './sharePermission'; - -/** Details for permissions of shareable entities */ -export interface PermissionDetails { - /** The edit permissions for the shareable entities. */ - editPermissions: SharePermission[]; - /** The share permissions for the shareable entities. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version2/models/permissionGrant.mts b/src/version2/models/permissionGrant.mts new file mode 100644 index 0000000000..cbb933bbc8 --- /dev/null +++ b/src/version2/models/permissionGrant.mts @@ -0,0 +1,19 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Details about a permission granted to a user or group. */ +export interface PermissionGrant { + holder?: PermissionHolder; + /** The ID of the permission granted details. */ + id?: number; + /** + * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an + * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission + * schemes_ for more information about the built-in permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information about custom permissions. + */ + permission?: string; + /** The URL of the permission granted details. */ + self?: string; +} diff --git a/src/version2/models/permissionGrant.ts b/src/version2/models/permissionGrant.ts deleted file mode 100644 index 33909846d8..0000000000 --- a/src/version2/models/permissionGrant.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { PermissionHolder } from './permissionHolder'; - -/** Details about a permission granted to a user or group. */ -export interface PermissionGrant { - holder?: PermissionHolder; - /** The ID of the permission granted details. */ - id?: number; - /** - * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an - * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission - * schemes_ for more information about the built-in permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information about custom permissions. - */ - permission?: string; - /** The URL of the permission granted details. */ - self?: string; -} diff --git a/src/version2/models/permissionGrants.mts b/src/version2/models/permissionGrants.mts new file mode 100644 index 0000000000..53188d4975 --- /dev/null +++ b/src/version2/models/permissionGrants.mts @@ -0,0 +1,9 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; + +/** List of permission grants. */ +export interface PermissionGrants { + /** Expand options that include additional permission grant details in the response. */ + expand?: string; + /** Permission grants list. */ + permissions?: PermissionGrant[]; +} diff --git a/src/version2/models/permissionGrants.ts b/src/version2/models/permissionGrants.ts deleted file mode 100644 index 9f4b2d7619..0000000000 --- a/src/version2/models/permissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { PermissionGrant } from './permissionGrant'; - -/** List of permission grants. */ -export interface PermissionGrants { - /** Expand options that include additional permission grant details in the response. */ - expand?: string; - /** Permission grants list. */ - permissions?: PermissionGrant[]; -} diff --git a/src/version2/models/permissionHolder.ts b/src/version2/models/permissionHolder.mts similarity index 100% rename from src/version2/models/permissionHolder.ts rename to src/version2/models/permissionHolder.mts diff --git a/src/version2/models/permissionScheme.mts b/src/version2/models/permissionScheme.mts new file mode 100644 index 0000000000..f6c36117e5 --- /dev/null +++ b/src/version2/models/permissionScheme.mts @@ -0,0 +1,22 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details of a permission scheme. */ +export interface PermissionScheme { + /** A description for the permission scheme. */ + description?: string; + /** The expand options available for the permission scheme. */ + expand?: string; + /** The ID of the permission scheme. */ + id?: number; + /** The name of the permission scheme. Must be unique. */ + name: string; + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions?: PermissionGrant[]; + scope?: Scope; + /** The URL of the permission scheme. */ + self?: string; +} diff --git a/src/version2/models/permissionScheme.ts b/src/version2/models/permissionScheme.ts deleted file mode 100644 index 19b084d0dc..0000000000 --- a/src/version2/models/permissionScheme.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PermissionGrant } from './permissionGrant'; -import { Scope } from './scope'; - -/** Details of a permission scheme. */ -export interface PermissionScheme { - /** A description for the permission scheme. */ - description?: string; - /** The expand options available for the permission scheme. */ - expand?: string; - /** The ID of the permission scheme. */ - id?: number; - /** The name of the permission scheme. Must be unique. */ - name: string; - /** - * The permission scheme to create or update. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. - */ - permissions?: PermissionGrant[]; - scope?: Scope; - /** The URL of the permission scheme. */ - self?: string; -} diff --git a/src/version2/models/permissionSchemes.mts b/src/version2/models/permissionSchemes.mts new file mode 100644 index 0000000000..2ac1a132e5 --- /dev/null +++ b/src/version2/models/permissionSchemes.mts @@ -0,0 +1,7 @@ +import type { PermissionScheme } from './permissionScheme.mjs'; + +/** List of all permission schemes. */ +export interface PermissionSchemes { + /** Permission schemes list. */ + permissionSchemes?: PermissionScheme[]; +} diff --git a/src/version2/models/permissionSchemes.ts b/src/version2/models/permissionSchemes.ts deleted file mode 100644 index 181dd57788..0000000000 --- a/src/version2/models/permissionSchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PermissionScheme } from './permissionScheme'; - -/** List of all permission schemes. */ -export interface PermissionSchemes { - /** Permission schemes list. */ - permissionSchemes?: PermissionScheme[]; -} diff --git a/src/version2/models/permissions.ts b/src/version2/models/permissions.mts similarity index 100% rename from src/version2/models/permissions.ts rename to src/version2/models/permissions.mts diff --git a/src/version2/models/permissionsKeys.ts b/src/version2/models/permissionsKeys.mts similarity index 100% rename from src/version2/models/permissionsKeys.ts rename to src/version2/models/permissionsKeys.mts diff --git a/src/version2/models/permittedProjects.mts b/src/version2/models/permittedProjects.mts new file mode 100644 index 0000000000..3b1dad5f77 --- /dev/null +++ b/src/version2/models/permittedProjects.mts @@ -0,0 +1,7 @@ +import type { ProjectIdentifier } from './projectIdentifier.mjs'; + +/** A list of projects in which a user is granted permissions. */ +export interface PermittedProjects { + /** A list of projects. */ + projects?: ProjectIdentifier[]; +} diff --git a/src/version2/models/permittedProjects.ts b/src/version2/models/permittedProjects.ts deleted file mode 100644 index 80cf250e71..0000000000 --- a/src/version2/models/permittedProjects.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProjectIdentifier } from './projectIdentifier'; - -/** A list of projects in which a user is granted permissions. */ -export interface PermittedProjects { - /** A list of projects. */ - projects?: ProjectIdentifier[]; -} diff --git a/src/version2/models/priority.ts b/src/version2/models/priority.mts similarity index 100% rename from src/version2/models/priority.ts rename to src/version2/models/priority.mts diff --git a/src/version2/models/priorityId.ts b/src/version2/models/priorityId.mts similarity index 100% rename from src/version2/models/priorityId.ts rename to src/version2/models/priorityId.mts diff --git a/src/version2/models/project.mts b/src/version2/models/project.mts new file mode 100644 index 0000000000..e06d3dfe21 --- /dev/null +++ b/src/version2/models/project.mts @@ -0,0 +1,80 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { Hierarchy } from './hierarchy.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { ProjectCategory } from './projectCategory.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { ProjectInsight } from './projectInsight.mjs'; +import type { ProjectLandingPageInfo } from './projectLandingPageInfo.mjs'; +import type { ProjectPermissions } from './projectPermissions.mjs'; +import { User } from './user.mjs'; +import type { Version } from './version.mjs'; + +/** Details about a project. */ +export interface Project { + /** Whether the project is archived. */ + archived?: boolean; + archivedBy?: User; + /** The date when the project was archived. */ + archivedDate?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: string; + avatarUrls?: AvatarUrls; + /** List of the components contained in the project. */ + components?: ProjectComponent[]; + /** Whether the project is marked as deleted. */ + deleted?: boolean; + deletedBy?: User; + /** The date when the project was marked as deleted. */ + deletedDate?: string; + /** A brief description of the project. */ + description?: string; + /** An email address associated with the project. */ + email?: string; + /** Expand options that include additional project details in the response. */ + expand?: string; + /** Whether the project is selected as a favorite. */ + favourite?: boolean; + /** The ID of the project. */ + id?: string; + insight?: ProjectInsight; + /** Whether the project is private. */ + isPrivate?: boolean; + issueTypeHierarchy?: Hierarchy; + /** List of the issue types available in the project. */ + issueTypes?: IssueTypeDetails[]; + /** The key of the project. */ + key?: string; + landingPageInfo?: ProjectLandingPageInfo; + lead?: User; + /** The name of the project. */ + name?: string; + permissions?: ProjectPermissions; + projectCategory?: ProjectCategory; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** Map of project properties */ + properties?: {}; + /** The date when the project is deleted permanently. */ + retentionTillDate?: string; + /** + * The name and self URL for each role defined in the project. For more information, see [Create project + * role](#api-rest-api-2-role-post). + */ + roles?: {}; + /** The URL of the project details. */ + self?: string; + /** Whether the project is simplified. */ + simplified?: boolean; + /** The type of the project. */ + style?: string; + /** A link to information about this project, such as project documentation. */ + url?: string; + /** Unique ID for next-gen projects. */ + uuid?: string; + /** The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post). */ + versions?: Version[]; +} diff --git a/src/version2/models/project.ts b/src/version2/models/project.ts deleted file mode 100644 index 474abbf236..0000000000 --- a/src/version2/models/project.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { Hierarchy } from './hierarchy'; -import { IssueTypeDetails } from './issueTypeDetails'; -import { ProjectCategory } from './projectCategory'; -import { ProjectComponent } from './projectComponent'; -import { ProjectInsight } from './projectInsight'; -import { ProjectLandingPageInfo } from './projectLandingPageInfo'; -import { ProjectPermissions } from './projectPermissions'; -import { User } from './user'; -import { Version } from './version'; - -/** Details about a project. */ -export interface Project { - /** Whether the project is archived. */ - archived?: boolean; - archivedBy?: User; - /** The date when the project was archived. */ - archivedDate?: string; - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - avatarUrls?: AvatarUrls; - /** List of the components contained in the project. */ - components?: ProjectComponent[]; - /** Whether the project is marked as deleted. */ - deleted?: boolean; - deletedBy?: User; - /** The date when the project was marked as deleted. */ - deletedDate?: string; - /** A brief description of the project. */ - description?: string; - /** An email address associated with the project. */ - email?: string; - /** Expand options that include additional project details in the response. */ - expand?: string; - /** Whether the project is selected as a favorite. */ - favourite?: boolean; - /** The ID of the project. */ - id?: string; - insight?: ProjectInsight; - /** Whether the project is private. */ - isPrivate?: boolean; - issueTypeHierarchy?: Hierarchy; - /** List of the issue types available in the project. */ - issueTypes?: IssueTypeDetails[]; - /** The key of the project. */ - key?: string; - landingPageInfo?: ProjectLandingPageInfo; - lead?: User; - /** The name of the project. */ - name?: string; - permissions?: ProjectPermissions; - projectCategory?: ProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Map of project properties */ - properties?: {}; - /** The date when the project is deleted permanently. */ - retentionTillDate?: string; - /** - * The name and self URL for each role defined in the project. For more information, see [Create project - * role](#api-rest-api-2-role-post). - */ - roles?: {}; - /** The URL of the project details. */ - self?: string; - /** Whether the project is simplified. */ - simplified?: boolean; - /** The type of the project. */ - style?: string; - /** A link to information about this project, such as project documentation. */ - url?: string; - /** Unique ID for next-gen projects. */ - uuid?: string; - /** The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post). */ - versions?: Version[]; -} diff --git a/src/version2/models/projectAndIssueTypePair.ts b/src/version2/models/projectAndIssueTypePair.mts similarity index 100% rename from src/version2/models/projectAndIssueTypePair.ts rename to src/version2/models/projectAndIssueTypePair.mts diff --git a/src/version2/models/projectAvatars.mts b/src/version2/models/projectAvatars.mts new file mode 100644 index 0000000000..763dab3022 --- /dev/null +++ b/src/version2/models/projectAvatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of project avatars. */ +export interface ProjectAvatars { + /** List of avatars added to Jira. These avatars may be deleted. */ + custom?: Avatar[]; + /** List of avatars included with Jira. These avatars cannot be deleted. */ + system?: Avatar[]; +} diff --git a/src/version2/models/projectAvatars.ts b/src/version2/models/projectAvatars.ts deleted file mode 100644 index cfbaeb49af..0000000000 --- a/src/version2/models/projectAvatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Avatar } from './avatar'; - -/** List of project avatars. */ -export interface ProjectAvatars { - /** List of avatars added to Jira. These avatars may be deleted. */ - custom?: Avatar[]; - /** List of avatars included with Jira. These avatars cannot be deleted. */ - system?: Avatar[]; -} diff --git a/src/version2/models/projectCategory.ts b/src/version2/models/projectCategory.mts similarity index 100% rename from src/version2/models/projectCategory.ts rename to src/version2/models/projectCategory.mts diff --git a/src/version2/models/projectComponent.mts b/src/version2/models/projectComponent.mts new file mode 100644 index 0000000000..5438226425 --- /dev/null +++ b/src/version2/models/projectComponent.mts @@ -0,0 +1,66 @@ +import { User } from './user.mjs'; + +/** Details about a project component. */ +export interface ProjectComponent { + 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. + * + * Default value: `PROJECT_DEFAULT`. + * Optional when creating or updating a component. + */ + assigneeType?: string; + /** The description for the component. Optional when creating or updating a component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + lead?: User; + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + 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. + */ + leadUserName?: string; + /** + * 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. + */ + name?: string; + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project?: string; + /** The ID of the project the component is assigned to. */ + projectId?: number; + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * 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. + */ + realAssigneeType?: string; + /** The URL of the component. */ + self?: string; +} diff --git a/src/version2/models/projectComponent.ts b/src/version2/models/projectComponent.ts deleted file mode 100644 index 6703ca07d0..0000000000 --- a/src/version2/models/projectComponent.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { User } from './user'; - -/** Details about a project component. */ -export interface ProjectComponent { - 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. - * - * Default value: `PROJECT_DEFAULT`. - * Optional when creating or updating a component. - */ - assigneeType?: string; - /** The description for the component. Optional when creating or updating a component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - lead?: User; - /** - * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian - * products. For example, _5b10ac8d82e05b22cc7d4ef5_. - */ - 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. - */ - leadUserName?: string; - /** - * 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. - */ - name?: string; - /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ - project?: string; - /** The ID of the project the component is assigned to. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * 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. - */ - realAssigneeType?: string; - /** The URL of the component. */ - self?: string; -} diff --git a/src/version2/models/projectDetails.mts b/src/version2/models/projectDetails.mts new file mode 100644 index 0000000000..28e56f7637 --- /dev/null +++ b/src/version2/models/projectDetails.mts @@ -0,0 +1,24 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { UpdatedProjectCategory } from './updatedProjectCategory.mjs'; + +/** Details about a project. */ +export interface ProjectDetails { + avatarUrls?: AvatarUrls; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + projectCategory?: UpdatedProjectCategory; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; +} diff --git a/src/version2/models/projectDetails.ts b/src/version2/models/projectDetails.ts deleted file mode 100644 index e3b010a6ed..0000000000 --- a/src/version2/models/projectDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { UpdatedProjectCategory } from './updatedProjectCategory'; - -/** Details about a project. */ -export interface ProjectDetails { - avatarUrls?: AvatarUrls; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - projectCategory?: UpdatedProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** The URL of the project details. */ - self?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; -} diff --git a/src/version2/models/projectEmailAddress.ts b/src/version2/models/projectEmailAddress.mts similarity index 100% rename from src/version2/models/projectEmailAddress.ts rename to src/version2/models/projectEmailAddress.mts diff --git a/src/version2/models/projectFeature.ts b/src/version2/models/projectFeature.mts similarity index 100% rename from src/version2/models/projectFeature.ts rename to src/version2/models/projectFeature.mts diff --git a/src/version2/models/projectFeatureToggleRequest.ts b/src/version2/models/projectFeatureToggleRequest.mts similarity index 100% rename from src/version2/models/projectFeatureToggleRequest.ts rename to src/version2/models/projectFeatureToggleRequest.mts diff --git a/src/version2/models/projectId.ts b/src/version2/models/projectId.mts similarity index 100% rename from src/version2/models/projectId.ts rename to src/version2/models/projectId.mts diff --git a/src/version2/models/projectIdentifier.ts b/src/version2/models/projectIdentifier.mts similarity index 100% rename from src/version2/models/projectIdentifier.ts rename to src/version2/models/projectIdentifier.mts diff --git a/src/version2/models/projectIdentifiers.ts b/src/version2/models/projectIdentifiers.mts similarity index 100% rename from src/version2/models/projectIdentifiers.ts rename to src/version2/models/projectIdentifiers.mts diff --git a/src/version2/models/projectIds.ts b/src/version2/models/projectIds.mts similarity index 100% rename from src/version2/models/projectIds.ts rename to src/version2/models/projectIds.mts diff --git a/src/version2/models/projectInsight.ts b/src/version2/models/projectInsight.mts similarity index 100% rename from src/version2/models/projectInsight.ts rename to src/version2/models/projectInsight.mts diff --git a/src/version2/models/projectIssueCreateMetadata.mts b/src/version2/models/projectIssueCreateMetadata.mts new file mode 100644 index 0000000000..04b7571563 --- /dev/null +++ b/src/version2/models/projectIssueCreateMetadata.mts @@ -0,0 +1,19 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata.mjs'; + +/** Details of the issue creation metadata for a project. */ +export interface ProjectIssueCreateMetadata { + avatarUrls?: AvatarUrls; + /** Expand options that include additional project issue create metadata details in the response. */ + expand?: string; + /** The ID of the project. */ + id?: string; + /** List of the issue types supported by the project. */ + issuetypes?: IssueTypeIssueCreateMetadata[]; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** The URL of the project. */ + self?: string; +} diff --git a/src/version2/models/projectIssueCreateMetadata.ts b/src/version2/models/projectIssueCreateMetadata.ts deleted file mode 100644 index 3b350783e5..0000000000 --- a/src/version2/models/projectIssueCreateMetadata.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; - -/** Details of the issue creation metadata for a project. */ -export interface ProjectIssueCreateMetadata { - avatarUrls?: AvatarUrls; - /** Expand options that include additional project issue create metadata details in the response. */ - expand?: string; - /** The ID of the project. */ - id?: string; - /** List of the issue types supported by the project. */ - issuetypes?: IssueTypeIssueCreateMetadata[]; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** The URL of the project. */ - self?: string; -} diff --git a/src/version2/models/projectIssueSecurityLevels.mts b/src/version2/models/projectIssueSecurityLevels.mts new file mode 100644 index 0000000000..f8a3d01fbe --- /dev/null +++ b/src/version2/models/projectIssueSecurityLevels.mts @@ -0,0 +1,7 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** List of issue level security items in a project. */ +export interface ProjectIssueSecurityLevels { + /** Issue level security items list. */ + levels: SecurityLevel[]; +} diff --git a/src/version2/models/projectIssueSecurityLevels.ts b/src/version2/models/projectIssueSecurityLevels.ts deleted file mode 100644 index 410834302f..0000000000 --- a/src/version2/models/projectIssueSecurityLevels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SecurityLevel } from './securityLevel'; - -/** List of issue level security items in a project. */ -export interface ProjectIssueSecurityLevels { - /** Issue level security items list. */ - levels: SecurityLevel[]; -} diff --git a/src/version2/models/projectIssueTypeHierarchy.mts b/src/version2/models/projectIssueTypeHierarchy.mts new file mode 100644 index 0000000000..6e6eba2259 --- /dev/null +++ b/src/version2/models/projectIssueTypeHierarchy.mts @@ -0,0 +1,9 @@ +import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel.mjs'; + +/** The hierarchy of issue types within a project. */ +export interface ProjectIssueTypeHierarchy { + /** Details of an issue type hierarchy level. */ + hierarchy?: ProjectIssueTypesHierarchyLevel[]; + /** The ID of the project. */ + projectId?: number; +} diff --git a/src/version2/models/projectIssueTypeHierarchy.ts b/src/version2/models/projectIssueTypeHierarchy.ts deleted file mode 100644 index 868dc5dfb5..0000000000 --- a/src/version2/models/projectIssueTypeHierarchy.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel'; - -/** The hierarchy of issue types within a project. */ -export interface ProjectIssueTypeHierarchy { - /** Details of an issue type hierarchy level. */ - hierarchy?: ProjectIssueTypesHierarchyLevel[]; - /** The ID of the project. */ - projectId?: number; -} diff --git a/src/version2/models/projectIssueTypeMapping.ts b/src/version2/models/projectIssueTypeMapping.mts similarity index 100% rename from src/version2/models/projectIssueTypeMapping.ts rename to src/version2/models/projectIssueTypeMapping.mts diff --git a/src/version2/models/projectIssueTypeMappings.mts b/src/version2/models/projectIssueTypeMappings.mts new file mode 100644 index 0000000000..81055b4ebe --- /dev/null +++ b/src/version2/models/projectIssueTypeMappings.mts @@ -0,0 +1,7 @@ +import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping.mjs'; + +/** The project and issue type mappings. */ +export interface ProjectIssueTypeMappings { + /** The project and issue type mappings. */ + mappings: ProjectIssueTypeMapping[]; +} diff --git a/src/version2/models/projectIssueTypeMappings.ts b/src/version2/models/projectIssueTypeMappings.ts deleted file mode 100644 index ac79a3ad1a..0000000000 --- a/src/version2/models/projectIssueTypeMappings.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProjectIssueTypeMapping } from './projectIssueTypeMapping'; - -/** The project and issue type mappings. */ -export interface ProjectIssueTypeMappings { - /** The project and issue type mappings. */ - mappings: ProjectIssueTypeMapping[]; -} diff --git a/src/version2/models/projectIssueTypes.mts b/src/version2/models/projectIssueTypes.mts new file mode 100644 index 0000000000..4dcad8c6ea --- /dev/null +++ b/src/version2/models/projectIssueTypes.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ +export interface ProjectIssueTypes { + /** IDs of the issue types */ + issueTypes?: string[]; + project?: ProjectId; +} diff --git a/src/version2/models/projectIssueTypes.ts b/src/version2/models/projectIssueTypes.ts deleted file mode 100644 index 147fec84f3..0000000000 --- a/src/version2/models/projectIssueTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectId } from './projectId'; - -/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ -export interface ProjectIssueTypes { - /** IDs of the issue types */ - issueTypes?: string[]; - project?: ProjectId; -} diff --git a/src/version2/models/projectIssueTypesHierarchyLevel.mts b/src/version2/models/projectIssueTypesHierarchyLevel.mts new file mode 100644 index 0000000000..6953904cd8 --- /dev/null +++ b/src/version2/models/projectIssueTypesHierarchyLevel.mts @@ -0,0 +1,11 @@ +import type { IssueTypeInfo } from './issueTypeInfo.mjs'; + +/** Details of an issue type hierarchy level. */ +export interface ProjectIssueTypesHierarchyLevel { + /** The list of issue types in the hierarchy level. */ + issueTypes?: IssueTypeInfo[]; + /** The level of the issue type hierarchy level. */ + level?: number; + /** The name of the issue type hierarchy level. */ + name?: string; +} diff --git a/src/version2/models/projectIssueTypesHierarchyLevel.ts b/src/version2/models/projectIssueTypesHierarchyLevel.ts deleted file mode 100644 index b1d1aef657..0000000000 --- a/src/version2/models/projectIssueTypesHierarchyLevel.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IssueTypeInfo } from './issueTypeInfo'; - -/** Details of an issue type hierarchy level. */ -export interface ProjectIssueTypesHierarchyLevel { - /** The list of issue types in the hierarchy level. */ - issueTypes?: IssueTypeInfo[]; - /** The level of the issue type hierarchy level. */ - level?: number; - /** The name of the issue type hierarchy level. */ - name?: string; -} diff --git a/src/version2/models/projectLandingPageInfo.ts b/src/version2/models/projectLandingPageInfo.mts similarity index 100% rename from src/version2/models/projectLandingPageInfo.ts rename to src/version2/models/projectLandingPageInfo.mts diff --git a/src/version2/models/projectPermissions.ts b/src/version2/models/projectPermissions.mts similarity index 100% rename from src/version2/models/projectPermissions.ts rename to src/version2/models/projectPermissions.mts diff --git a/src/version2/models/projectRole.mts b/src/version2/models/projectRole.mts new file mode 100644 index 0000000000..f624b8deb8 --- /dev/null +++ b/src/version2/models/projectRole.mts @@ -0,0 +1,27 @@ +import type { RoleActor } from './roleActor.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about the roles in a project. */ +export interface ProjectRole { + /** The list of users who act in this role. */ + actors?: RoleActor[]; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether the calling user is part of this role. */ + currentUserRole?: boolean; + /** Whether this role is the default role for the project */ + default?: boolean; + /** The description of the project role. */ + description?: string; + /** The ID of the project role. */ + id?: number; + /** The name of the project role. */ + name?: string; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + scope?: Scope; + /** The URL the project role details. */ + self?: string; + /** The translated name of the project role. */ + translatedName?: string; +} diff --git a/src/version2/models/projectRole.ts b/src/version2/models/projectRole.ts deleted file mode 100644 index 78b9b5e365..0000000000 --- a/src/version2/models/projectRole.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { RoleActor } from './roleActor'; -import { Scope } from './scope'; - -/** Details about the roles in a project. */ -export interface ProjectRole { - /** The list of users who act in this role. */ - actors?: RoleActor[]; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether the calling user is part of this role. */ - currentUserRole?: boolean; - /** Whether this role is the default role for the project */ - default?: boolean; - /** The description of the project role. */ - description?: string; - /** The ID of the project role. */ - id?: number; - /** The name of the project role. */ - name?: string; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - scope?: Scope; - /** The URL the project role details. */ - self?: string; - /** The translated name of the project role. */ - translatedName?: string; -} diff --git a/src/version2/models/projectRoleActorsUpdate.ts b/src/version2/models/projectRoleActorsUpdate.mts similarity index 100% rename from src/version2/models/projectRoleActorsUpdate.ts rename to src/version2/models/projectRoleActorsUpdate.mts diff --git a/src/version2/models/projectRoleDetails.mts b/src/version2/models/projectRoleDetails.mts new file mode 100644 index 0000000000..55f0669f64 --- /dev/null +++ b/src/version2/models/projectRoleDetails.mts @@ -0,0 +1,22 @@ +import type { Scope } from './scope.mjs'; + +/** Details about a project role. */ +export interface ProjectRoleDetails { + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether this role is the default role for the project. */ + default?: boolean; + /** The description of the project role. */ + description?: string; + /** The ID of the project role. */ + id?: number; + /** The name of the project role. */ + name?: string; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + scope?: Scope; + /** The URL the project role details. */ + self?: string; + /** The translated name of the project role. */ + translatedName?: string; +} diff --git a/src/version2/models/projectRoleDetails.ts b/src/version2/models/projectRoleDetails.ts deleted file mode 100644 index 868fa39578..0000000000 --- a/src/version2/models/projectRoleDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Scope } from './scope'; - -/** Details about a project role. */ -export interface ProjectRoleDetails { - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether this role is the default role for the project. */ - default?: boolean; - /** The description of the project role. */ - description?: string; - /** The ID of the project role. */ - id?: number; - /** The name of the project role. */ - name?: string; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - scope?: Scope; - /** The URL the project role details. */ - self?: string; - /** The translated name of the project role. */ - translatedName?: string; -} diff --git a/src/version2/models/projectRoleGroup.ts b/src/version2/models/projectRoleGroup.mts similarity index 100% rename from src/version2/models/projectRoleGroup.ts rename to src/version2/models/projectRoleGroup.mts diff --git a/src/version2/models/projectRoleUser.ts b/src/version2/models/projectRoleUser.mts similarity index 100% rename from src/version2/models/projectRoleUser.ts rename to src/version2/models/projectRoleUser.mts diff --git a/src/version2/models/projectScope.ts b/src/version2/models/projectScope.mts similarity index 100% rename from src/version2/models/projectScope.ts rename to src/version2/models/projectScope.mts diff --git a/src/version2/models/projectType.ts b/src/version2/models/projectType.mts similarity index 100% rename from src/version2/models/projectType.ts rename to src/version2/models/projectType.mts diff --git a/src/version2/models/propertyKey.ts b/src/version2/models/propertyKey.mts similarity index 100% rename from src/version2/models/propertyKey.ts rename to src/version2/models/propertyKey.mts diff --git a/src/version2/models/propertyKeys.mts b/src/version2/models/propertyKeys.mts new file mode 100644 index 0000000000..3db8a9493c --- /dev/null +++ b/src/version2/models/propertyKeys.mts @@ -0,0 +1,7 @@ +import type { PropertyKey } from './propertyKey.mjs'; + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} diff --git a/src/version2/models/propertyKeys.ts b/src/version2/models/propertyKeys.ts deleted file mode 100644 index f4e13a499e..0000000000 --- a/src/version2/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PropertyKey } from './propertyKey'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/version2/models/publishedWorkflowId.ts b/src/version2/models/publishedWorkflowId.mts similarity index 100% rename from src/version2/models/publishedWorkflowId.ts rename to src/version2/models/publishedWorkflowId.mts diff --git a/src/version2/models/registeredWebhook.ts b/src/version2/models/registeredWebhook.mts similarity index 100% rename from src/version2/models/registeredWebhook.ts rename to src/version2/models/registeredWebhook.mts diff --git a/src/version2/models/remoteIssueLink.mts b/src/version2/models/remoteIssueLink.mts new file mode 100644 index 0000000000..b78b237b1e --- /dev/null +++ b/src/version2/models/remoteIssueLink.mts @@ -0,0 +1,16 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of an issue remote link. */ +export interface RemoteIssueLink { + application?: Application; + /** The global ID of the link, such as the ID of the item on the remote system. */ + globalId?: string; + /** The ID of the link. */ + id?: number; + object?: RemoteObject; + /** Description of the relationship between the issue and the linked item. */ + relationship?: string; + /** The URL of the link. */ + self?: string; +} diff --git a/src/version2/models/remoteIssueLink.ts b/src/version2/models/remoteIssueLink.ts deleted file mode 100644 index 40bb68945f..0000000000 --- a/src/version2/models/remoteIssueLink.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Application } from './application'; -import { RemoteObject } from './remoteObject'; - -/** Details of an issue remote link. */ -export interface RemoteIssueLink { - application?: Application; - /** The global ID of the link, such as the ID of the item on the remote system. */ - globalId?: string; - /** The ID of the link. */ - id?: number; - object?: RemoteObject; - /** Description of the relationship between the issue and the linked item. */ - relationship?: string; - /** The URL of the link. */ - self?: string; -} diff --git a/src/version2/models/remoteIssueLinkIdentifies.ts b/src/version2/models/remoteIssueLinkIdentifies.mts similarity index 100% rename from src/version2/models/remoteIssueLinkIdentifies.ts rename to src/version2/models/remoteIssueLinkIdentifies.mts diff --git a/src/version2/models/remoteIssueLinkRequest.mts b/src/version2/models/remoteIssueLinkRequest.mts new file mode 100644 index 0000000000..c12f620dda --- /dev/null +++ b/src/version2/models/remoteIssueLinkRequest.mts @@ -0,0 +1,23 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of a remote issue link. */ +export interface RemoteIssueLinkRequest { + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId?: string; + application?: Application; + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship?: string; + object?: RemoteObject; +} diff --git a/src/version2/models/remoteIssueLinkRequest.ts b/src/version2/models/remoteIssueLinkRequest.ts deleted file mode 100644 index 71f47f2043..0000000000 --- a/src/version2/models/remoteIssueLinkRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Application } from './application'; -import { RemoteObject } from './remoteObject'; - -/** Details of a remote issue link. */ -export interface RemoteIssueLinkRequest { - /** - * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence - * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. - * - * Setting this field enables the remote issue link details to be updated or deleted using remote system and item - * details as the record identifier, rather than using the record's Jira ID. - * - * The maximum length is 255 characters. - */ - globalId?: string; - application?: Application; - /** - * Description of the relationship between the issue and the linked item. If not set, the relationship description - * "links to" is used in Jira. - */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version2/models/remoteObject.mts b/src/version2/models/remoteObject.mts new file mode 100644 index 0000000000..e8d3f312f1 --- /dev/null +++ b/src/version2/models/remoteObject.mts @@ -0,0 +1,14 @@ +import type { Icon } from './icon.mjs'; +import type { Status } from './status.mjs'; + +/** The linked item. */ +export interface RemoteObject { + icon?: Icon; + status?: Status; + /** The summary details of the item. */ + summary?: string; + /** The title of the item. */ + title: string; + /** The URL of the item. */ + url: string; +} diff --git a/src/version2/models/remoteObject.ts b/src/version2/models/remoteObject.ts deleted file mode 100644 index 5bc5ebffef..0000000000 --- a/src/version2/models/remoteObject.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Icon } from './icon'; -import { Status } from './status'; - -/** The linked item. */ -export interface RemoteObject { - icon?: Icon; - status?: Status; - /** The summary details of the item. */ - summary?: string; - /** The title of the item. */ - title: string; - /** The URL of the item. */ - url: string; -} diff --git a/src/version2/models/reorderIssuePriorities.ts b/src/version2/models/reorderIssuePriorities.mts similarity index 100% rename from src/version2/models/reorderIssuePriorities.ts rename to src/version2/models/reorderIssuePriorities.mts diff --git a/src/version2/models/reorderIssueResolutionsRequest.ts b/src/version2/models/reorderIssueResolutionsRequest.mts similarity index 100% rename from src/version2/models/reorderIssueResolutionsRequest.ts rename to src/version2/models/reorderIssueResolutionsRequest.mts diff --git a/src/version2/models/resolution.ts b/src/version2/models/resolution.mts similarity index 100% rename from src/version2/models/resolution.ts rename to src/version2/models/resolution.mts diff --git a/src/version2/models/resolutionId.ts b/src/version2/models/resolutionId.mts similarity index 100% rename from src/version2/models/resolutionId.ts rename to src/version2/models/resolutionId.mts diff --git a/src/version2/models/restrictedPermission.ts b/src/version2/models/restrictedPermission.mts similarity index 100% rename from src/version2/models/restrictedPermission.ts rename to src/version2/models/restrictedPermission.mts diff --git a/src/version2/models/richText.ts b/src/version2/models/richText.mts similarity index 100% rename from src/version2/models/richText.ts rename to src/version2/models/richText.mts diff --git a/src/version2/models/roleActor.mts b/src/version2/models/roleActor.mts new file mode 100644 index 0000000000..9e16006eab --- /dev/null +++ b/src/version2/models/roleActor.mts @@ -0,0 +1,25 @@ +import type { ProjectRoleGroup } from './projectRoleGroup.mjs'; +import type { ProjectRoleUser } from './projectRoleUser.mjs'; + +/** Details about a user assigned to a project role. */ +export interface RoleActor { + actorGroup?: ProjectRoleGroup; + actorUser?: ProjectRoleUser; + /** The avatar of the role actor. */ + avatarUrl?: string; + /** + * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an + * alternative value for the user's name. + */ + displayName?: string; + /** The ID of the role actor. */ + id?: number; + /** + * 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. + */ + name?: string; + /** The type of role actor. */ + type?: string; +} diff --git a/src/version2/models/roleActor.ts b/src/version2/models/roleActor.ts deleted file mode 100644 index 2f4971749d..0000000000 --- a/src/version2/models/roleActor.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ProjectRoleGroup } from './projectRoleGroup'; -import { ProjectRoleUser } from './projectRoleUser'; - -/** Details about a user assigned to a project role. */ -export interface RoleActor { - actorGroup?: ProjectRoleGroup; - actorUser?: ProjectRoleUser; - /** The avatar of the role actor. */ - avatarUrl?: string; - /** - * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an - * alternative value for the user's name. - */ - displayName?: string; - /** The ID of the role actor. */ - id?: number; - /** - * 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. - */ - name?: string; - /** The type of role actor. */ - type?: string; -} diff --git a/src/version2/models/ruleConfiguration.ts b/src/version2/models/ruleConfiguration.mts similarity index 100% rename from src/version2/models/ruleConfiguration.ts rename to src/version2/models/ruleConfiguration.mts diff --git a/src/version2/models/sanitizedJqlQueries.mts b/src/version2/models/sanitizedJqlQueries.mts new file mode 100644 index 0000000000..462913b181 --- /dev/null +++ b/src/version2/models/sanitizedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { SanitizedJqlQuery } from './sanitizedJqlQuery.mjs'; + +/** The sanitized Jql queries for the given account IDs. */ +export interface SanitizedJqlQueries { + /** The list of sanitized Jql queries. */ + queries?: SanitizedJqlQuery[]; +} diff --git a/src/version2/models/sanitizedJqlQueries.ts b/src/version2/models/sanitizedJqlQueries.ts deleted file mode 100644 index 94ca4c611c..0000000000 --- a/src/version2/models/sanitizedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SanitizedJqlQuery } from './sanitizedJqlQuery'; - -/** The sanitized JQL queries for the given account IDs. */ -export interface SanitizedJqlQueries { - /** The list of sanitized JQL queries. */ - queries?: SanitizedJqlQuery[]; -} diff --git a/src/version2/models/sanitizedJqlQuery.mts b/src/version2/models/sanitizedJqlQuery.mts new file mode 100644 index 0000000000..2d2bef2838 --- /dev/null +++ b/src/version2/models/sanitizedJqlQuery.mts @@ -0,0 +1,12 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +/** Details of the sanitized Jql query. */ +export interface SanitizedJqlQuery { + /** The account ID of the user for whom sanitization was performed. */ + accountId?: string; + errors?: ErrorCollection; + /** The initial query. */ + initialQuery?: string; + /** The sanitized query, if there were no errors. */ + sanitizedQuery?: string; +} diff --git a/src/version2/models/sanitizedJqlQuery.ts b/src/version2/models/sanitizedJqlQuery.ts deleted file mode 100644 index 3422332316..0000000000 --- a/src/version2/models/sanitizedJqlQuery.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ErrorCollection } from './errorCollection'; - -/** Details of the sanitized JQL query. */ -export interface SanitizedJqlQuery { - /** The account ID of the user for whom sanitization was performed. */ - accountId?: string; - errors?: ErrorCollection; - /** The initial query. */ - initialQuery?: string; - /** The sanitized query, if there were no errors. */ - sanitizedQuery?: string; -} diff --git a/src/version2/models/scope.mts b/src/version2/models/scope.mts new file mode 100644 index 0000000000..2e7e657019 --- /dev/null +++ b/src/version2/models/scope.mts @@ -0,0 +1,11 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + project?: ProjectDetails; + /** The type of scope. */ + type?: string; +} diff --git a/src/version2/models/scope.ts b/src/version2/models/scope.ts deleted file mode 100644 index 681461b6af..0000000000 --- a/src/version2/models/scope.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ProjectDetails } from './projectDetails'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - project?: ProjectDetails; - /** The type of scope. */ - type?: string; -} diff --git a/src/version2/models/screen.mts b/src/version2/models/screen.mts new file mode 100644 index 0000000000..58c3abdbca --- /dev/null +++ b/src/version2/models/screen.mts @@ -0,0 +1,12 @@ +import type { Scope } from './scope.mjs'; + +/** A screen. */ +export interface Screen { + /** The description of the screen. */ + description?: string; + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + scope?: Scope; +} diff --git a/src/version2/models/screen.ts b/src/version2/models/screen.ts deleted file mode 100644 index 2d1529648e..0000000000 --- a/src/version2/models/screen.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Scope } from './scope'; - -/** A screen. */ -export interface Screen { - /** The description of the screen. */ - description?: string; - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - scope?: Scope; -} diff --git a/src/version2/models/screenDetails.ts b/src/version2/models/screenDetails.mts similarity index 100% rename from src/version2/models/screenDetails.ts rename to src/version2/models/screenDetails.mts diff --git a/src/version2/models/screenScheme.mts b/src/version2/models/screenScheme.mts new file mode 100644 index 0000000000..c774dc4a88 --- /dev/null +++ b/src/version2/models/screenScheme.mts @@ -0,0 +1,14 @@ +import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme.mjs'; +import type { ScreenTypes } from './screenTypes.mjs'; + +/** A screen scheme. */ +export interface ScreenScheme { + /** The description of the screen scheme. */ + description?: string; + /** The ID of the screen scheme. */ + id?: number; + issueTypeScreenSchemes?: PageIssueTypeScreenScheme; + /** The name of the screen scheme. */ + name?: string; + screens?: ScreenTypes; +} diff --git a/src/version2/models/screenScheme.ts b/src/version2/models/screenScheme.ts deleted file mode 100644 index dc593a9e7d..0000000000 --- a/src/version2/models/screenScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme'; -import { ScreenTypes } from './screenTypes'; - -/** A screen scheme. */ -export interface ScreenScheme { - /** The description of the screen scheme. */ - description?: string; - /** The ID of the screen scheme. */ - id?: number; - issueTypeScreenSchemes?: PageIssueTypeScreenScheme; - /** The name of the screen scheme. */ - name?: string; - screens?: ScreenTypes; -} diff --git a/src/version2/models/screenSchemeDetails.mts b/src/version2/models/screenSchemeDetails.mts new file mode 100644 index 0000000000..7a7e650cbb --- /dev/null +++ b/src/version2/models/screenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { ScreenTypes } from './screenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface ScreenSchemeDetails { + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + screens?: ScreenTypes; +} diff --git a/src/version2/models/screenSchemeDetails.ts b/src/version2/models/screenSchemeDetails.ts deleted file mode 100644 index 89b8f2077d..0000000000 --- a/src/version2/models/screenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ScreenTypes } from './screenTypes'; - -/** Details of a screen scheme. */ -export interface ScreenSchemeDetails { - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - screens?: ScreenTypes; -} diff --git a/src/version2/models/screenSchemeId.ts b/src/version2/models/screenSchemeId.mts similarity index 100% rename from src/version2/models/screenSchemeId.ts rename to src/version2/models/screenSchemeId.mts diff --git a/src/version2/models/screenTypes.ts b/src/version2/models/screenTypes.mts similarity index 100% rename from src/version2/models/screenTypes.ts rename to src/version2/models/screenTypes.mts diff --git a/src/version2/models/screenWithTab.mts b/src/version2/models/screenWithTab.mts new file mode 100644 index 0000000000..a40ffb30ac --- /dev/null +++ b/src/version2/models/screenWithTab.mts @@ -0,0 +1,14 @@ +import type { Scope } from './scope.mjs'; +import type { ScreenableTab } from './screenableTab.mjs'; + +/** A screen with tab details. */ +export interface ScreenWithTab { + /** The description of the screen. */ + description?: string; + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + scope?: Scope; + tab?: ScreenableTab; +} diff --git a/src/version2/models/screenWithTab.ts b/src/version2/models/screenWithTab.ts deleted file mode 100644 index afac145fea..0000000000 --- a/src/version2/models/screenWithTab.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Scope } from './scope'; -import { ScreenableTab } from './screenableTab'; - -/** A screen with tab details. */ -export interface ScreenWithTab { - /** The description of the screen. */ - description?: string; - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - scope?: Scope; - tab?: ScreenableTab; -} diff --git a/src/version2/models/screenableField.ts b/src/version2/models/screenableField.mts similarity index 100% rename from src/version2/models/screenableField.ts rename to src/version2/models/screenableField.mts diff --git a/src/version2/models/screenableTab.ts b/src/version2/models/screenableTab.mts similarity index 100% rename from src/version2/models/screenableTab.ts rename to src/version2/models/screenableTab.mts diff --git a/src/version2/models/searchAutoComplete.ts b/src/version2/models/searchAutoComplete.mts similarity index 100% rename from src/version2/models/searchAutoComplete.ts rename to src/version2/models/searchAutoComplete.mts diff --git a/src/version2/models/searchRequest.mts b/src/version2/models/searchRequest.mts new file mode 100644 index 0000000000..019483de78 --- /dev/null +++ b/src/version2/models/searchRequest.mts @@ -0,0 +1,80 @@ +export interface SearchRequest { + /** A [Jql](https://confluence.atlassian.com/x/egORLQ) expression. */ + jql?: string; + /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ + startAt?: number; + /** The maximum number of items to return per page. */ + 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. 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[]; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values: + * + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * The default is `strict`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: string; + /** + * Use [expand](em>#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' + | ( + | '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; +} diff --git a/src/version2/models/searchRequest.ts b/src/version2/models/searchRequest.ts deleted file mode 100644 index 59057b364e..0000000000 --- a/src/version2/models/searchRequest.ts +++ /dev/null @@ -1,80 +0,0 @@ -export interface SearchRequest { - /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ - jql?: string; - /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ - startAt?: number; - /** The maximum number of items to return per page. */ - 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. 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[]; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values: - * - * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * The default is `strict`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: string; - /** - * Use [expand](em>#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' - | ( - | '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; -} diff --git a/src/version2/models/searchResults.mts b/src/version2/models/searchResults.mts new file mode 100644 index 0000000000..bc282b13b6 --- /dev/null +++ b/src/version2/models/searchResults.mts @@ -0,0 +1,21 @@ +import type { Issue } from './issue.mjs'; + +/** The result of a Jql search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The list of issues found by the search. */ + issues?: Issue[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The ID and name of each field in the search results. */ + names?: {}; + /** The schema describing the field types in the search results. */ + schema?: {}; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; + /** Any warnings related to the Jql query. */ + warningMessages?: string[]; +} diff --git a/src/version2/models/searchResults.ts b/src/version2/models/searchResults.ts deleted file mode 100644 index 295b48280a..0000000000 --- a/src/version2/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Issue } from './issue'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The list of issues found by the search. */ - issues?: Issue[]; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The ID and name of each field in the search results. */ - names?: {}; - /** The schema describing the field types in the search results. */ - schema?: {}; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The number of results on the page. */ - total?: number; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; -} diff --git a/src/version2/models/securityLevel.ts b/src/version2/models/securityLevel.mts similarity index 100% rename from src/version2/models/securityLevel.ts rename to src/version2/models/securityLevel.mts diff --git a/src/version2/models/securityLevelMember.mts b/src/version2/models/securityLevelMember.mts new file mode 100644 index 0000000000..f9723fbfb0 --- /dev/null +++ b/src/version2/models/securityLevelMember.mts @@ -0,0 +1,12 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface SecurityLevelMember { + holder?: PermissionHolder; + /** The ID of the issue security level member. */ + id: string; + /** The ID of the issue security level. */ + issueSecurityLevelId: string; + /** The ID of the issue security scheme. */ + issueSecuritySchemeId: string; +} diff --git a/src/version2/models/securityLevelMember.ts b/src/version2/models/securityLevelMember.ts deleted file mode 100644 index 4c2f05fc63..0000000000 --- a/src/version2/models/securityLevelMember.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { PermissionHolder } from './permissionHolder'; - -/** Issue security level member. */ -export interface SecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: string; - /** The ID of the issue security level. */ - issueSecurityLevelId: string; - /** The ID of the issue security scheme. */ - issueSecuritySchemeId: string; -} diff --git a/src/version2/models/securityScheme.mts b/src/version2/models/securityScheme.mts new file mode 100644 index 0000000000..d9529b9cf3 --- /dev/null +++ b/src/version2/models/securityScheme.mts @@ -0,0 +1,16 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** Details about a security scheme. */ +export interface SecurityScheme { + /** The ID of the default security level. */ + defaultSecurityLevelId?: number; + /** The description of the issue security scheme. */ + description?: string; + /** The ID of the issue security scheme. */ + id?: number; + levels?: SecurityLevel[]; + /** The name of the issue security scheme. */ + name?: string; + /** The URL of the issue security scheme. */ + self?: string; +} diff --git a/src/version2/models/securityScheme.ts b/src/version2/models/securityScheme.ts deleted file mode 100644 index b97cc9125e..0000000000 --- a/src/version2/models/securityScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { SecurityLevel } from './securityLevel'; - -/** Details about a security scheme. */ -export interface SecurityScheme { - /** The ID of the default security level. */ - defaultSecurityLevelId?: number; - /** The description of the issue security scheme. */ - description?: string; - /** The ID of the issue security scheme. */ - id?: number; - levels?: SecurityLevel[]; - /** The name of the issue security scheme. */ - name?: string; - /** The URL of the issue security scheme. */ - self?: string; -} diff --git a/src/version2/models/securitySchemeId.ts b/src/version2/models/securitySchemeId.mts similarity index 100% rename from src/version2/models/securitySchemeId.ts rename to src/version2/models/securitySchemeId.mts diff --git a/src/version2/models/securitySchemeLevel.mts b/src/version2/models/securitySchemeLevel.mts new file mode 100644 index 0000000000..55f6505285 --- /dev/null +++ b/src/version2/models/securitySchemeLevel.mts @@ -0,0 +1,12 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +export interface SecuritySchemeLevel { + /** The description of the issue security scheme level. */ + description?: string; + /** Specifies whether the level is the default level. False by default. */ + isDefault?: boolean; + /** The list of level members which should be added to the issue security scheme level. */ + members?: SecuritySchemeLevelMember[]; + /** The name of the issue security scheme level. Must be unique. */ + name: string; +} diff --git a/src/version2/models/securitySchemeLevel.ts b/src/version2/models/securitySchemeLevel.ts deleted file mode 100644 index a1e5b28ac4..0000000000 --- a/src/version2/models/securitySchemeLevel.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { SecuritySchemeLevelMember } from './securitySchemeLevelMember'; - -export interface SecuritySchemeLevel { - /** The description of the issue security scheme level. */ - description?: string; - /** Specifies whether the level is the default level. False by default. */ - isDefault?: boolean; - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; - /** The name of the issue security scheme level. Must be unique. */ - name: string; -} diff --git a/src/version2/models/securitySchemeLevelMember.ts b/src/version2/models/securitySchemeLevelMember.mts similarity index 100% rename from src/version2/models/securitySchemeLevelMember.ts rename to src/version2/models/securitySchemeLevelMember.mts diff --git a/src/version2/models/securitySchemeMembersRequest.mts b/src/version2/models/securitySchemeMembersRequest.mts new file mode 100644 index 0000000000..346c88f32e --- /dev/null +++ b/src/version2/models/securitySchemeMembersRequest.mts @@ -0,0 +1,7 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +/** Details of issue security scheme level new members. */ +export interface SecuritySchemeMembersRequest { + /** The list of level members which should be added to the issue security scheme level. */ + members: SecuritySchemeLevelMember[]; +} diff --git a/src/version2/models/securitySchemeMembersRequest.ts b/src/version2/models/securitySchemeMembersRequest.ts deleted file mode 100644 index bec2ba7de3..0000000000 --- a/src/version2/models/securitySchemeMembersRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SecuritySchemeLevelMember } from './securitySchemeLevelMember'; - -/** Details of issue security scheme level new members. */ -export interface SecuritySchemeMembersRequest { - /** The list of level members which should be added to the issue security scheme level. */ - members: SecuritySchemeLevelMember[]; -} diff --git a/src/version2/models/securitySchemeWithProjects.ts b/src/version2/models/securitySchemeWithProjects.mts similarity index 100% rename from src/version2/models/securitySchemeWithProjects.ts rename to src/version2/models/securitySchemeWithProjects.mts diff --git a/src/version2/models/securitySchemes.mts b/src/version2/models/securitySchemes.mts new file mode 100644 index 0000000000..cc5c5d77a1 --- /dev/null +++ b/src/version2/models/securitySchemes.mts @@ -0,0 +1,7 @@ +import type { SecurityScheme } from './securityScheme.mjs'; + +/** List of security schemes. */ +export interface SecuritySchemes { + /** List of security schemes. */ + issueSecuritySchemes?: SecurityScheme[]; +} diff --git a/src/version2/models/securitySchemes.ts b/src/version2/models/securitySchemes.ts deleted file mode 100644 index 2ee8c346cd..0000000000 --- a/src/version2/models/securitySchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SecurityScheme } from './securityScheme'; - -/** List of security schemes. */ -export interface SecuritySchemes { - /** List of security schemes. */ - issueSecuritySchemes?: SecurityScheme[]; -} diff --git a/src/version2/models/serverInformation.ts b/src/version2/models/serverInformation.mts similarity index 100% rename from src/version2/models/serverInformation.ts rename to src/version2/models/serverInformation.mts diff --git a/src/version2/models/setDefaultLevelsRequest.mts b/src/version2/models/setDefaultLevelsRequest.mts new file mode 100644 index 0000000000..9aeece50e4 --- /dev/null +++ b/src/version2/models/setDefaultLevelsRequest.mts @@ -0,0 +1,7 @@ +import type { DefaultLevelValue } from './defaultLevelValue.mjs'; + +/** Details of new default levels. */ +export interface SetDefaultLevelsRequest { + /** List of objects with issue security scheme ID and new default level ID. */ + defaultValues: DefaultLevelValue[]; +} diff --git a/src/version2/models/setDefaultLevelsRequest.ts b/src/version2/models/setDefaultLevelsRequest.ts deleted file mode 100644 index 64888b0ce6..0000000000 --- a/src/version2/models/setDefaultLevelsRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultLevelValue } from './defaultLevelValue'; - -/** Details of new default levels. */ -export interface SetDefaultLevelsRequest { - /** List of objects with issue security scheme ID and new default level ID. */ - defaultValues: DefaultLevelValue[]; -} diff --git a/src/version2/models/setDefaultPriorityRequest.ts b/src/version2/models/setDefaultPriorityRequest.mts similarity index 100% rename from src/version2/models/setDefaultPriorityRequest.ts rename to src/version2/models/setDefaultPriorityRequest.mts diff --git a/src/version2/models/setDefaultResolutionRequest.ts b/src/version2/models/setDefaultResolutionRequest.mts similarity index 100% rename from src/version2/models/setDefaultResolutionRequest.ts rename to src/version2/models/setDefaultResolutionRequest.mts diff --git a/src/version2/models/sharePermission.mts b/src/version2/models/sharePermission.mts new file mode 100644 index 0000000000..93fb3bf88e --- /dev/null +++ b/src/version2/models/sharePermission.mts @@ -0,0 +1,28 @@ +import type { GroupName } from './groupName.mjs'; +import type { Project } from './project.mjs'; +import type { ProjectRole } from './projectRole.mjs'; +import { User } from './user.mjs'; + +/** Details of a share permission for the filter. */ +export interface SharePermission { + /** The unique identifier of the share permission. */ + id?: number; + /** + * The type of share permission: + * + * - `user` Shared with a user. + * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. + * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. + * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in + * requests, where it needs to be specify with `projectId` and `projectRoleId`. + * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. + * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as + * the `type`. + * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. + */ + type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; + project?: Project; + role?: ProjectRole; + group?: GroupName; + user?: User; +} diff --git a/src/version2/models/sharePermission.ts b/src/version2/models/sharePermission.ts deleted file mode 100644 index ffe12470fb..0000000000 --- a/src/version2/models/sharePermission.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { GroupName } from './groupName'; -import { Project } from './project'; -import { ProjectRole } from './projectRole'; -import { User } from './user'; - -/** Details of a share permission for the filter. */ -export interface SharePermission { - /** The unique identifier of the share permission. */ - id?: number; - /** - * The type of share permission: - * - * - `user` Shared with a user. - * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. - * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. - * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in - * requests, where it needs to be specify with `projectId` and `projectRoleId`. - * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. - * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as - * the `type`. - * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. - */ - type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; - project?: Project; - role?: ProjectRole; - group?: GroupName; - user?: User; -} diff --git a/src/version2/models/sharePermissionInput.ts b/src/version2/models/sharePermissionInput.mts similarity index 100% rename from src/version2/models/sharePermissionInput.ts rename to src/version2/models/sharePermissionInput.mts diff --git a/src/version2/models/simpleApplicationProperty.ts b/src/version2/models/simpleApplicationProperty.mts similarity index 100% rename from src/version2/models/simpleApplicationProperty.ts rename to src/version2/models/simpleApplicationProperty.mts diff --git a/src/version2/models/simpleLink.ts b/src/version2/models/simpleLink.mts similarity index 100% rename from src/version2/models/simpleLink.ts rename to src/version2/models/simpleLink.mts diff --git a/src/version2/models/simpleListWrapperApplicationRole.mts b/src/version2/models/simpleListWrapperApplicationRole.mts new file mode 100644 index 0000000000..0bd81e6c07 --- /dev/null +++ b/src/version2/models/simpleListWrapperApplicationRole.mts @@ -0,0 +1,10 @@ +import type { ApplicationRole } from './applicationRole.mjs'; +import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole.mjs'; + +export interface SimpleListWrapperApplicationRole { + callback?: ListWrapperCallbackApplicationRole; + items?: ApplicationRole[]; + 'max-results'?: number; + pagingCallback?: ListWrapperCallbackApplicationRole; + size?: number; +} diff --git a/src/version2/models/simpleListWrapperApplicationRole.ts b/src/version2/models/simpleListWrapperApplicationRole.ts deleted file mode 100644 index 2b7c171dcc..0000000000 --- a/src/version2/models/simpleListWrapperApplicationRole.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ApplicationRole } from './applicationRole'; -import { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole'; - -export interface SimpleListWrapperApplicationRole { - callback?: ListWrapperCallbackApplicationRole; - items?: ApplicationRole[]; - 'max-results'?: number; - pagingCallback?: ListWrapperCallbackApplicationRole; - size?: number; -} diff --git a/src/version2/models/simpleListWrapperGroupName.mts b/src/version2/models/simpleListWrapperGroupName.mts new file mode 100644 index 0000000000..bc74037cfe --- /dev/null +++ b/src/version2/models/simpleListWrapperGroupName.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName.mjs'; + +export interface SimpleListWrapperGroupName { + callback?: ListWrapperCallbackGroupName; + items?: GroupName[]; + 'max-results'?: number; + pagingCallback?: ListWrapperCallbackGroupName; + size?: number; +} diff --git a/src/version2/models/simpleListWrapperGroupName.ts b/src/version2/models/simpleListWrapperGroupName.ts deleted file mode 100644 index 41323db360..0000000000 --- a/src/version2/models/simpleListWrapperGroupName.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GroupName } from './groupName'; -import { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName'; - -export interface SimpleListWrapperGroupName { - callback?: ListWrapperCallbackGroupName; - items?: GroupName[]; - 'max-results'?: number; - pagingCallback?: ListWrapperCallbackGroupName; - size?: number; -} diff --git a/src/version2/models/status.mts b/src/version2/models/status.mts new file mode 100644 index 0000000000..e073b370dd --- /dev/null +++ b/src/version2/models/status.mts @@ -0,0 +1,11 @@ +import type { Icon } from './icon.mjs'; + +/** The status of the item. */ +export interface Status { + icon?: Icon; + /** + * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, + * otherwise the link displays in normal font. + */ + resolved?: boolean; +} diff --git a/src/version2/models/status.ts b/src/version2/models/status.ts deleted file mode 100644 index 973aaeb523..0000000000 --- a/src/version2/models/status.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Icon } from './icon'; - -/** The status of the item. */ -export interface Status { - icon?: Icon; - /** - * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, - * otherwise the link displays in normal font. - */ - resolved?: boolean; -} diff --git a/src/version2/models/statusCategory.ts b/src/version2/models/statusCategory.mts similarity index 100% rename from src/version2/models/statusCategory.ts rename to src/version2/models/statusCategory.mts diff --git a/src/version2/models/statusCreate.ts b/src/version2/models/statusCreate.mts similarity index 100% rename from src/version2/models/statusCreate.ts rename to src/version2/models/statusCreate.mts diff --git a/src/version2/models/statusCreateRequest.mts b/src/version2/models/statusCreateRequest.mts new file mode 100644 index 0000000000..12963af2f9 --- /dev/null +++ b/src/version2/models/statusCreateRequest.mts @@ -0,0 +1,9 @@ +import type { StatusCreate } from './statusCreate.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of the statuses being created and their scope. */ +export interface StatusCreateRequest { + scope: StatusScope; + /** Details of the statuses being created. */ + statuses: StatusCreate[]; +} diff --git a/src/version2/models/statusCreateRequest.ts b/src/version2/models/statusCreateRequest.ts deleted file mode 100644 index 89e1f041c0..0000000000 --- a/src/version2/models/statusCreateRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { StatusCreate } from './statusCreate'; -import { StatusScope } from './statusScope'; - -/** Details of the statuses being created and their scope. */ -export interface StatusCreateRequest { - scope: StatusScope; - /** Details of the statuses being created. */ - statuses: StatusCreate[]; -} diff --git a/src/version2/models/statusDetails.mts b/src/version2/models/statusDetails.mts new file mode 100644 index 0000000000..d29381c3ae --- /dev/null +++ b/src/version2/models/statusDetails.mts @@ -0,0 +1,16 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +/** A status. */ +export interface StatusDetails { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** The URL of the status. */ + self?: string; + statusCategory?: StatusCategory; +} diff --git a/src/version2/models/statusDetails.ts b/src/version2/models/statusDetails.ts deleted file mode 100644 index ee2c95c9af..0000000000 --- a/src/version2/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { StatusCategory } from './statusCategory'; - -/** A status. */ -export interface StatusDetails { - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The ID of the status. */ - id?: string; - /** The name of the status. */ - name?: string; - /** The URL of the status. */ - self?: string; - statusCategory?: StatusCategory; -} diff --git a/src/version2/models/statusLayoutUpdate.mts b/src/version2/models/statusLayoutUpdate.mts new file mode 100644 index 0000000000..b1bd2f1c1b --- /dev/null +++ b/src/version2/models/statusLayoutUpdate.mts @@ -0,0 +1,10 @@ +import { WorkflowLayout } from './workflowLayout.mjs'; + +/** The statuses associated with this workflow. */ +export interface StatusLayoutUpdate { + layout?: WorkflowLayout; + /** The properties for this status layout. */ + properties: {}; + /** A unique ID which the status will use to refer to this layout configuration. */ + statusReference: string; +} diff --git a/src/version2/models/statusLayoutUpdate.ts b/src/version2/models/statusLayoutUpdate.ts deleted file mode 100644 index ea1130ee59..0000000000 --- a/src/version2/models/statusLayoutUpdate.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { WorkflowLayout } from './workflowLayout'; - -/** The statuses associated with this workflow. */ -export interface StatusLayoutUpdate { - layout?: WorkflowLayout; - /** The properties for this status layout. */ - properties: {}; - /** A unique ID which the status will use to refer to this layout configuration. */ - statusReference: string; -} diff --git a/src/version2/models/statusMapping.ts b/src/version2/models/statusMapping.mts similarity index 100% rename from src/version2/models/statusMapping.ts rename to src/version2/models/statusMapping.mts diff --git a/src/version2/models/statusMappingDTO.mts b/src/version2/models/statusMappingDTO.mts new file mode 100644 index 0000000000..0f4a9450c4 --- /dev/null +++ b/src/version2/models/statusMappingDTO.mts @@ -0,0 +1,11 @@ +import { StatusMigration } from './statusMigration.mjs'; + +/** The mapping of old to new status ID for a specific project and issue type. */ +export interface StatusMappingDTO { + /** The issue type for the status mapping. */ + issueTypeId: string; + /** The project for the status mapping. */ + projectId: string; + /** The list of old and new status ID mappings for the specified project and issue type. */ + statusMigrations: StatusMigration[]; +} diff --git a/src/version2/models/statusMappingDTO.ts b/src/version2/models/statusMappingDTO.ts deleted file mode 100644 index 8754433ffe..0000000000 --- a/src/version2/models/statusMappingDTO.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { StatusMigration } from './statusMigration'; - -/** The mapping of old to new status ID for a specific project and issue type. */ -export interface StatusMappingDTO { - /** The issue type for the status mapping. */ - issueTypeId: string; - /** The project for the status mapping. */ - projectId: string; - /** The list of old and new status ID mappings for the specified project and issue type. */ - statusMigrations: StatusMigration[]; -} diff --git a/src/version2/models/statusMigration.ts b/src/version2/models/statusMigration.mts similarity index 100% rename from src/version2/models/statusMigration.ts rename to src/version2/models/statusMigration.mts diff --git a/src/version2/models/statusReferenceAndPort.ts b/src/version2/models/statusReferenceAndPort.mts similarity index 100% rename from src/version2/models/statusReferenceAndPort.ts rename to src/version2/models/statusReferenceAndPort.mts diff --git a/src/version2/models/statusScope.mts b/src/version2/models/statusScope.mts new file mode 100644 index 0000000000..5688339287 --- /dev/null +++ b/src/version2/models/statusScope.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** The scope of the status. */ +export interface StatusScope { + project?: ProjectId; + /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: string; +} diff --git a/src/version2/models/statusScope.ts b/src/version2/models/statusScope.ts deleted file mode 100644 index 58fec1109e..0000000000 --- a/src/version2/models/statusScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectId } from './projectId'; - -/** The scope of the status. */ -export interface StatusScope { - project?: ProjectId; - /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; -} diff --git a/src/version2/models/statusUpdate.ts b/src/version2/models/statusUpdate.mts similarity index 100% rename from src/version2/models/statusUpdate.ts rename to src/version2/models/statusUpdate.mts diff --git a/src/version2/models/statusUpdateRequest.mts b/src/version2/models/statusUpdateRequest.mts new file mode 100644 index 0000000000..2ae0c2697a --- /dev/null +++ b/src/version2/models/statusUpdateRequest.mts @@ -0,0 +1,7 @@ +import type { StatusUpdate } from './statusUpdate.mjs'; + +/** The list of statuses that will be updated. */ +export interface StatusUpdateRequest { + /** The list of statuses that will be updated. */ + statuses?: StatusUpdate[]; +} diff --git a/src/version2/models/statusUpdateRequest.ts b/src/version2/models/statusUpdateRequest.ts deleted file mode 100644 index d68fbf12d4..0000000000 --- a/src/version2/models/statusUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { StatusUpdate } from './statusUpdate'; - -/** The list of statuses that will be updated. */ -export interface StatusUpdateRequest { - /** The list of statuses that will be updated. */ - statuses?: StatusUpdate[]; -} diff --git a/src/version2/models/suggestedIssue.ts b/src/version2/models/suggestedIssue.mts similarity index 100% rename from src/version2/models/suggestedIssue.ts rename to src/version2/models/suggestedIssue.mts diff --git a/src/version2/models/systemAvatars.mts b/src/version2/models/systemAvatars.mts new file mode 100644 index 0000000000..7984cb58a8 --- /dev/null +++ b/src/version2/models/systemAvatars.mts @@ -0,0 +1,7 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of system avatars. */ +export interface SystemAvatars { + /** A list of avatar details. */ + system?: Avatar[]; +} diff --git a/src/version2/models/systemAvatars.ts b/src/version2/models/systemAvatars.ts deleted file mode 100644 index b7a72d47f9..0000000000 --- a/src/version2/models/systemAvatars.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Avatar } from './avatar'; - -/** List of system avatars. */ -export interface SystemAvatars { - /** A list of avatar details. */ - system?: Avatar[]; -} diff --git a/src/version2/models/tabMetadata.mts b/src/version2/models/tabMetadata.mts new file mode 100644 index 0000000000..3e774e6511 --- /dev/null +++ b/src/version2/models/tabMetadata.mts @@ -0,0 +1,9 @@ +import { FieldMetadata } from './fieldMetadata.mjs'; + +/** The metadata describing a tab in an issue screen. */ +export interface TabMetadata { + /** The name of the tab. */ + name: string; + /** The fields within the tab */ + fields: FieldMetadata[]; +} diff --git a/src/version2/models/tabMetadata.ts b/src/version2/models/tabMetadata.ts deleted file mode 100644 index 6074a7477c..0000000000 --- a/src/version2/models/tabMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { FieldMetadata } from './fieldMetadata'; - -/** The metadata describing a tab in an issue screen. */ -export interface TabMetadata { - /** The name of the tab. */ - name: string; - /** The fields within the tab */ - fields: FieldMetadata[]; -} diff --git a/src/version2/models/taskProgressObject.ts b/src/version2/models/taskProgressObject.mts similarity index 100% rename from src/version2/models/taskProgressObject.ts rename to src/version2/models/taskProgressObject.mts diff --git a/src/version2/models/timeTrackingConfiguration.ts b/src/version2/models/timeTrackingConfiguration.mts similarity index 100% rename from src/version2/models/timeTrackingConfiguration.ts rename to src/version2/models/timeTrackingConfiguration.mts diff --git a/src/version2/models/timeTrackingDetails.ts b/src/version2/models/timeTrackingDetails.mts similarity index 100% rename from src/version2/models/timeTrackingDetails.ts rename to src/version2/models/timeTrackingDetails.mts diff --git a/src/version2/models/timeTrackingProvider.ts b/src/version2/models/timeTrackingProvider.mts similarity index 100% rename from src/version2/models/timeTrackingProvider.ts rename to src/version2/models/timeTrackingProvider.mts diff --git a/src/version2/models/transition.mts b/src/version2/models/transition.mts new file mode 100644 index 0000000000..f98fc1fc29 --- /dev/null +++ b/src/version2/models/transition.mts @@ -0,0 +1,22 @@ +import { TransitionScreenDetails } from './transitionScreenDetails.mjs'; +import type { WorkflowRules } from './workflowRules.mjs'; + +/** Details of a workflow transition. */ +export interface Transition { + /** The description of the transition. */ + description: string; + /** The statuses the transition can start from. */ + from: string[]; + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The properties of the transition. */ + properties?: {}; + rules?: WorkflowRules; + screen?: TransitionScreenDetails; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; +} diff --git a/src/version2/models/transition.ts b/src/version2/models/transition.ts deleted file mode 100644 index f32828e74c..0000000000 --- a/src/version2/models/transition.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { TransitionScreenDetails } from './transitionScreenDetails'; -import { WorkflowRules } from './workflowRules'; - -/** Details of a workflow transition. */ -export interface Transition { - /** The description of the transition. */ - description: string; - /** The statuses the transition can start from. */ - from: string[]; - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The properties of the transition. */ - properties?: {}; - rules?: WorkflowRules; - screen?: TransitionScreenDetails; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; -} diff --git a/src/version2/models/transitionScreenDetails.ts b/src/version2/models/transitionScreenDetails.mts similarity index 100% rename from src/version2/models/transitionScreenDetails.ts rename to src/version2/models/transitionScreenDetails.mts diff --git a/src/version2/models/transitionUpdateDTO.mts b/src/version2/models/transitionUpdateDTO.mts new file mode 100644 index 0000000000..a5a5b21357 --- /dev/null +++ b/src/version2/models/transitionUpdateDTO.mts @@ -0,0 +1,31 @@ +import { ConditionGroupUpdate } from './conditionGroupUpdate.mjs'; +import { StatusReferenceAndPort } from './statusReferenceAndPort.mjs'; +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; +import { WorkflowTrigger } from './workflowTrigger.mjs'; + +/** The transitions of this workflow. */ +export interface TransitionUpdateDTO { + /** The post-functions of the transition. */ + actions?: WorkflowRuleConfiguration[]; + conditions?: ConditionGroupUpdate; + /** The custom event ID of the transition. */ + customIssueEventId?: string; + /** The description of the transition. */ + description?: string; + /** The statuses the transition can start from. */ + from?: StatusReferenceAndPort[]; + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The properties of the transition. */ + properties?: {}; + to?: StatusReferenceAndPort; + transitionScreen?: WorkflowRuleConfiguration; + /** The triggers of the transition. */ + triggers?: WorkflowTrigger[]; + /** The transition type. */ + type: string; + /** The validators of the transition. */ + validators?: WorkflowRuleConfiguration[]; +} diff --git a/src/version2/models/transitionUpdateDTO.ts b/src/version2/models/transitionUpdateDTO.ts deleted file mode 100644 index d98aec9f58..0000000000 --- a/src/version2/models/transitionUpdateDTO.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ConditionGroupUpdate } from './conditionGroupUpdate'; -import { StatusReferenceAndPort } from './statusReferenceAndPort'; -import { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; -import { WorkflowTrigger } from './workflowTrigger'; - -/** The transitions of this workflow. */ -export interface TransitionUpdateDTO { - /** The post-functions of the transition. */ - actions?: WorkflowRuleConfiguration[]; - conditions?: ConditionGroupUpdate; - /** The custom event ID of the transition. */ - customIssueEventId?: string; - /** The description of the transition. */ - description?: string; - /** The statuses the transition can start from. */ - from?: StatusReferenceAndPort[]; - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The properties of the transition. */ - properties?: {}; - to?: StatusReferenceAndPort; - transitionScreen?: WorkflowRuleConfiguration; - /** The triggers of the transition. */ - triggers?: WorkflowTrigger[]; - /** The transition type. */ - type: string; - /** The validators of the transition. */ - validators?: WorkflowRuleConfiguration[]; -} diff --git a/src/version2/models/transitions.mts b/src/version2/models/transitions.mts new file mode 100644 index 0000000000..58362e7767 --- /dev/null +++ b/src/version2/models/transitions.mts @@ -0,0 +1,9 @@ +import type { IssueTransition } from './issueTransition.mjs'; + +/** List of issue transitions. */ +export interface Transitions { + /** Expand options that include additional transitions details in the response. */ + expand?: string; + /** List of issue transitions. */ + transitions?: IssueTransition[]; +} diff --git a/src/version2/models/transitions.ts b/src/version2/models/transitions.ts deleted file mode 100644 index 1423f0d5a8..0000000000 --- a/src/version2/models/transitions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IssueTransition } from './issueTransition'; - -/** List of issue transitions. */ -export interface Transitions { - /** Expand options that include additional transitions details in the response. */ - expand?: string; - /** List of issue transitions. */ - transitions?: IssueTransition[]; -} diff --git a/src/version2/models/uiModificationContextDetails.ts b/src/version2/models/uiModificationContextDetails.mts similarity index 100% rename from src/version2/models/uiModificationContextDetails.ts rename to src/version2/models/uiModificationContextDetails.mts diff --git a/src/version2/models/uiModificationDetails.mts b/src/version2/models/uiModificationDetails.mts new file mode 100644 index 0000000000..d65963bb6f --- /dev/null +++ b/src/version2/models/uiModificationDetails.mts @@ -0,0 +1,17 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The ID of the UI modification. */ + id: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The URL of the UI modification. */ + self: string; +} diff --git a/src/version2/models/uiModificationDetails.ts b/src/version2/models/uiModificationDetails.ts deleted file mode 100644 index 7475cf76a8..0000000000 --- a/src/version2/models/uiModificationDetails.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface UiModificationDetails { - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The ID of the UI modification. */ - id: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The URL of the UI modification. */ - self: string; -} diff --git a/src/version2/models/uiModificationIdentifiers.ts b/src/version2/models/uiModificationIdentifiers.mts similarity index 100% rename from src/version2/models/uiModificationIdentifiers.ts rename to src/version2/models/uiModificationIdentifiers.mts diff --git a/src/version2/models/unrestrictedUserEmail.ts b/src/version2/models/unrestrictedUserEmail.mts similarity index 100% rename from src/version2/models/unrestrictedUserEmail.ts rename to src/version2/models/unrestrictedUserEmail.mts diff --git a/src/version2/models/updateCustomFieldDetails.ts b/src/version2/models/updateCustomFieldDetails.mts similarity index 100% rename from src/version2/models/updateCustomFieldDetails.ts rename to src/version2/models/updateCustomFieldDetails.mts diff --git a/src/version2/models/updateFieldConfigurationSchemeDetails.ts b/src/version2/models/updateFieldConfigurationSchemeDetails.mts similarity index 100% rename from src/version2/models/updateFieldConfigurationSchemeDetails.ts rename to src/version2/models/updateFieldConfigurationSchemeDetails.mts diff --git a/src/version2/models/updateIssueSecurityLevelDetails.ts b/src/version2/models/updateIssueSecurityLevelDetails.mts similarity index 100% rename from src/version2/models/updateIssueSecurityLevelDetails.ts rename to src/version2/models/updateIssueSecurityLevelDetails.mts diff --git a/src/version2/models/updateIssueSecuritySchemeRequest.ts b/src/version2/models/updateIssueSecuritySchemeRequest.mts similarity index 100% rename from src/version2/models/updateIssueSecuritySchemeRequest.ts rename to src/version2/models/updateIssueSecuritySchemeRequest.mts diff --git a/src/version2/models/updateNotificationSchemeDetails.ts b/src/version2/models/updateNotificationSchemeDetails.mts similarity index 100% rename from src/version2/models/updateNotificationSchemeDetails.ts rename to src/version2/models/updateNotificationSchemeDetails.mts diff --git a/src/version2/models/updatePriorityDetails.ts b/src/version2/models/updatePriorityDetails.mts similarity index 100% rename from src/version2/models/updatePriorityDetails.ts rename to src/version2/models/updatePriorityDetails.mts diff --git a/src/version2/models/updateProjectDetails.ts b/src/version2/models/updateProjectDetails.mts similarity index 100% rename from src/version2/models/updateProjectDetails.ts rename to src/version2/models/updateProjectDetails.mts diff --git a/src/version2/models/updateResolutionDetails.ts b/src/version2/models/updateResolutionDetails.mts similarity index 100% rename from src/version2/models/updateResolutionDetails.ts rename to src/version2/models/updateResolutionDetails.mts diff --git a/src/version2/models/updateScreenDetails.ts b/src/version2/models/updateScreenDetails.mts similarity index 100% rename from src/version2/models/updateScreenDetails.ts rename to src/version2/models/updateScreenDetails.mts diff --git a/src/version2/models/updateScreenSchemeDetails.mts b/src/version2/models/updateScreenSchemeDetails.mts new file mode 100644 index 0000000000..920f135502 --- /dev/null +++ b/src/version2/models/updateScreenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { UpdateScreenTypes } from './updateScreenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface UpdateScreenSchemeDetails { + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; + screens?: UpdateScreenTypes; +} diff --git a/src/version2/models/updateScreenSchemeDetails.ts b/src/version2/models/updateScreenSchemeDetails.ts deleted file mode 100644 index c860adf7e9..0000000000 --- a/src/version2/models/updateScreenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UpdateScreenTypes } from './updateScreenTypes'; - -/** Details of a screen scheme. */ -export interface UpdateScreenSchemeDetails { - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; - screens?: UpdateScreenTypes; -} diff --git a/src/version2/models/updateScreenTypes.ts b/src/version2/models/updateScreenTypes.mts similarity index 100% rename from src/version2/models/updateScreenTypes.ts rename to src/version2/models/updateScreenTypes.mts diff --git a/src/version2/models/updateUiModificationDetails.mts b/src/version2/models/updateUiModificationDetails.mts new file mode 100644 index 0000000000..8f40932f30 --- /dev/null +++ b/src/version2/models/updateUiModificationDetails.mts @@ -0,0 +1,16 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UpdateUiModificationDetails { + /** + * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing + * contexts. + */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name?: string; +} diff --git a/src/version2/models/updateUiModificationDetails.ts b/src/version2/models/updateUiModificationDetails.ts deleted file mode 100644 index c3c63b2a9a..0000000000 --- a/src/version2/models/updateUiModificationDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface UpdateUiModificationDetails { - /** - * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing - * contexts. - */ - contexts?: UiModificationContextDetails[]; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name?: string; -} diff --git a/src/version2/models/updateUserToGroup.ts b/src/version2/models/updateUserToGroup.mts similarity index 100% rename from src/version2/models/updateUserToGroup.ts rename to src/version2/models/updateUserToGroup.mts diff --git a/src/version2/models/updatedProjectCategory.ts b/src/version2/models/updatedProjectCategory.mts similarity index 100% rename from src/version2/models/updatedProjectCategory.ts rename to src/version2/models/updatedProjectCategory.mts diff --git a/src/version2/models/user.mts b/src/version2/models/user.mts new file mode 100644 index 0000000000..a7306a8a6e --- /dev/null +++ b/src/version2/models/user.mts @@ -0,0 +1,62 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole.mjs'; +import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName.mjs'; + +/** + * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these + * exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface User { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. + */ + accountId?: string; + /** + * The user account type. Can take the following values: + * + * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to + * represent external systems `customer` Jira Service Desk account representing an external service desk + */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + applicationRoles?: SimpleListWrapperApplicationRole; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress?: string; + /** Expand options that include additional user details in the response. */ + expand?: string; + groups?: SimpleListWrapperGroupName; + /** + * 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. + */ + key?: string; + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale?: 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. + */ + name?: string; + /** The URL of the user. */ + self?: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as + * null. + */ + timeZone?: string; +} diff --git a/src/version2/models/user.ts b/src/version2/models/user.ts deleted file mode 100644 index aa421e2121..0000000000 --- a/src/version2/models/user.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole'; -import { SimpleListWrapperGroupName } from './simpleListWrapperGroupName'; - -/** - * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these - * exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. - */ - accountId?: string; - /** - * The user account type. Can take the following values: - * - * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to - * represent external systems `customer` Jira Service Desk account representing an external service desk - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - applicationRoles?: SimpleListWrapperApplicationRole; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ - emailAddress?: string; - /** Expand options that include additional user details in the response. */ - expand?: string; - groups?: SimpleListWrapperGroupName; - /** - * 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. - */ - key?: string; - /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ - locale?: 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. - */ - name?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as - * null. - */ - timeZone?: string; -} diff --git a/src/version2/models/userAvatarUrls.ts b/src/version2/models/userAvatarUrls.mts similarity index 100% rename from src/version2/models/userAvatarUrls.ts rename to src/version2/models/userAvatarUrls.mts diff --git a/src/version2/models/userDetails.mts b/src/version2/models/userDetails.mts new file mode 100644 index 0000000000..212442eccc --- /dev/null +++ b/src/version2/models/userDetails.mts @@ -0,0 +1,51 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface UserDetails { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** + * 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. + */ + key?: 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. + */ + name?: string; + /** The URL of the user. */ + self?: string; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone?: string; +} diff --git a/src/version2/models/userDetails.ts b/src/version2/models/userDetails.ts deleted file mode 100644 index 8f848988b6..0000000000 --- a/src/version2/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; - /** Whether the user is active. */ - active?: boolean; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** - * 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. - */ - key?: 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. - */ - name?: string; - /** The URL of the user. */ - self?: string; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; -} diff --git a/src/version2/models/userKey.ts b/src/version2/models/userKey.mts similarity index 100% rename from src/version2/models/userKey.ts rename to src/version2/models/userKey.mts diff --git a/src/version2/models/userList.mts b/src/version2/models/userList.mts new file mode 100644 index 0000000000..1f3b9ef6dc --- /dev/null +++ b/src/version2/models/userList.mts @@ -0,0 +1,18 @@ +import { User } from './user.mjs'; + +/** + * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the + * projects that the filter is shared with. + */ +export interface UserList { + /** The index of the last item returned on the page. */ + 'end-index'?: number; + /** The list of items. */ + items?: User[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The number of items on the page. */ + size?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; +} diff --git a/src/version2/models/userList.ts b/src/version2/models/userList.ts deleted file mode 100644 index 851a952eb6..0000000000 --- a/src/version2/models/userList.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { User } from './user'; - -/** - * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the - * projects that the filter is shared with. - */ -export interface UserList { - /** The index of the last item returned on the page. */ - 'end-index'?: number; - /** The list of items. */ - items?: User[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The number of items on the page. */ - size?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; -} diff --git a/src/version2/models/userMigration.ts b/src/version2/models/userMigration.mts similarity index 100% rename from src/version2/models/userMigration.ts rename to src/version2/models/userMigration.mts diff --git a/src/version2/models/userPickerUser.ts b/src/version2/models/userPickerUser.mts similarity index 100% rename from src/version2/models/userPickerUser.ts rename to src/version2/models/userPickerUser.mts diff --git a/src/version2/models/validationOptionsForCreate.ts b/src/version2/models/validationOptionsForCreate.mts similarity index 100% rename from src/version2/models/validationOptionsForCreate.ts rename to src/version2/models/validationOptionsForCreate.mts diff --git a/src/version2/models/validationOptionsForUpdate.ts b/src/version2/models/validationOptionsForUpdate.mts similarity index 100% rename from src/version2/models/validationOptionsForUpdate.ts rename to src/version2/models/validationOptionsForUpdate.mts diff --git a/src/version2/models/version.mts b/src/version2/models/version.mts new file mode 100644 index 0000000000..c33537eec8 --- /dev/null +++ b/src/version2/models/version.mts @@ -0,0 +1,71 @@ +import type { SimpleLink } from './simpleLink.mjs'; +import type { VersionIssuesStatus } from './versionIssuesStatus.mjs'; + +/** Details about a project version. */ +export interface Version { + /** + * 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: + * + * - `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_. + * + * Optional for create and update. + */ + expand?: 'operations' | 'issuesstatus' | ('operations' | 'issuesstatus')[] | string | string[]; + /** The URL of the 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. + */ + released?: boolean; + /** + * 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. + */ + moveUnfixedIssuesTo?: string; + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations?: SimpleLink[]; + issuesStatusForFixVersion?: VersionIssuesStatus; +} diff --git a/src/version2/models/version.ts b/src/version2/models/version.ts deleted file mode 100644 index 5c2cd84911..0000000000 --- a/src/version2/models/version.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { SimpleLink } from './simpleLink'; -import { VersionIssuesStatus } from './versionIssuesStatus'; - -/** Details about a project version. */ -export interface Version { - /** - * 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: - * - * - `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_. - * - * Optional for create and update. - */ - expand?: 'operations' | 'issuesstatus' | ('operations' | 'issuesstatus')[] | string | string[]; - /** The URL of the 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. - */ - released?: boolean; - /** - * 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. - */ - moveUnfixedIssuesTo?: string; - /** If the expand option `operations` is used, returns the list of operations available for this version. */ - operations?: SimpleLink[]; - issuesStatusForFixVersion?: VersionIssuesStatus; -} diff --git a/src/version2/models/versionIssueCounts.mts b/src/version2/models/versionIssueCounts.mts new file mode 100644 index 0000000000..48fa9adc91 --- /dev/null +++ b/src/version2/models/versionIssueCounts.mts @@ -0,0 +1,15 @@ +import { VersionUsageInCustomField } from './versionUsageInCustomField.mjs'; + +/** Various counts of issues within a version. */ +export interface VersionIssueCounts { + /** List of custom fields using the version. */ + customFieldUsage?: VersionUsageInCustomField[]; + /** Count of issues where a version custom field is set to the version. */ + issueCountWithCustomFieldsShowingVersion?: number; + /** Count of issues where the `affectedVersion` is set to the version. */ + issuesAffectedCount?: number; + /** Count of issues where the `fixVersion` is set to the version. */ + issuesFixedCount?: number; + /** The URL of these count details. */ + self?: string; +} diff --git a/src/version2/models/versionIssueCounts.ts b/src/version2/models/versionIssueCounts.ts deleted file mode 100644 index fe9c86d59d..0000000000 --- a/src/version2/models/versionIssueCounts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { VersionUsageInCustomField } from './versionUsageInCustomField'; - -/** Various counts of issues within a version. */ -export interface VersionIssueCounts { - /** List of custom fields using the version. */ - customFieldUsage?: VersionUsageInCustomField[]; - /** Count of issues where a version custom field is set to the version. */ - issueCountWithCustomFieldsShowingVersion?: number; - /** Count of issues where the `affectedVersion` is set to the version. */ - issuesAffectedCount?: number; - /** Count of issues where the `fixVersion` is set to the version. */ - issuesFixedCount?: number; - /** The URL of these count details. */ - self?: string; -} diff --git a/src/version2/models/versionIssuesStatus.ts b/src/version2/models/versionIssuesStatus.mts similarity index 100% rename from src/version2/models/versionIssuesStatus.ts rename to src/version2/models/versionIssuesStatus.mts diff --git a/src/version2/models/versionMove.ts b/src/version2/models/versionMove.mts similarity index 100% rename from src/version2/models/versionMove.ts rename to src/version2/models/versionMove.mts diff --git a/src/version2/models/versionUnresolvedIssuesCount.ts b/src/version2/models/versionUnresolvedIssuesCount.mts similarity index 100% rename from src/version2/models/versionUnresolvedIssuesCount.ts rename to src/version2/models/versionUnresolvedIssuesCount.mts diff --git a/src/version2/models/versionUsageInCustomField.ts b/src/version2/models/versionUsageInCustomField.mts similarity index 100% rename from src/version2/models/versionUsageInCustomField.ts rename to src/version2/models/versionUsageInCustomField.mts diff --git a/src/version2/models/visibility.ts b/src/version2/models/visibility.mts similarity index 100% rename from src/version2/models/visibility.ts rename to src/version2/models/visibility.mts diff --git a/src/version2/models/votes.mts b/src/version2/models/votes.mts new file mode 100644 index 0000000000..2796869cc5 --- /dev/null +++ b/src/version2/models/votes.mts @@ -0,0 +1,16 @@ +import { User } from './user.mjs'; + +/** The details of votes on an issue. */ +export interface Votes { + /** Whether the user making this request has voted on the issue. */ + hasVoted?: boolean; + /** The URL of these issue vote details. */ + self?: string; + /** + * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the + * _View voters and watchers_ project permission. + */ + voters?: User[]; + /** The number of votes on the issue. */ + votes?: number; +} diff --git a/src/version2/models/votes.ts b/src/version2/models/votes.ts deleted file mode 100644 index 4bf3785e87..0000000000 --- a/src/version2/models/votes.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { User } from './user'; - -/** The details of votes on an issue. */ -export interface Votes { - /** Whether the user making this request has voted on the issue. */ - hasVoted?: boolean; - /** The URL of these issue vote details. */ - self?: string; - /** - * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the - * _View voters and watchers_ project permission. - */ - voters?: User[]; - /** The number of votes on the issue. */ - votes?: number; -} diff --git a/src/version2/models/warningCollection.ts b/src/version2/models/warningCollection.mts similarity index 100% rename from src/version2/models/warningCollection.ts rename to src/version2/models/warningCollection.mts diff --git a/src/version2/models/watchers.mts b/src/version2/models/watchers.mts new file mode 100644 index 0000000000..fa8268e105 --- /dev/null +++ b/src/version2/models/watchers.mts @@ -0,0 +1,13 @@ +import { UserDetails } from './userDetails.mjs'; + +/** The details of watchers on an issue. */ +export interface Watchers { + /** Whether the calling user is watching this issue. */ + isWatching?: boolean; + /** The URL of these issue watcher details. */ + self?: string; + /** The number of users watching this issue. */ + watchCount?: number; + /** Details of the users watching this issue. */ + watchers?: UserDetails[]; +} diff --git a/src/version2/models/watchers.ts b/src/version2/models/watchers.ts deleted file mode 100644 index 2414477abc..0000000000 --- a/src/version2/models/watchers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** The details of watchers on an issue. */ -export interface Watchers { - /** Whether the calling user is watching this issue. */ - isWatching?: boolean; - /** The URL of these issue watcher details. */ - self?: string; - /** The number of users watching this issue. */ - watchCount?: number; - /** Details of the users watching this issue. */ - watchers?: UserDetails[]; -} diff --git a/src/version2/models/webhook.mts b/src/version2/models/webhook.mts new file mode 100644 index 0000000000..0b1c83ef79 --- /dev/null +++ b/src/version2/models/webhook.mts @@ -0,0 +1,26 @@ +/** A webhook. */ +export interface Webhook { + /** The Jira events that trigger the 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) + * to extend the date. + */ + expirationDate?: number; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** The ID of the webhook. */ + id: number; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** The Jql filter that specifies which issues the webhook is sent for. */ + jqlFilter: string; +} diff --git a/src/version2/models/webhook.ts b/src/version2/models/webhook.ts deleted file mode 100644 index 7886ad7274..0000000000 --- a/src/version2/models/webhook.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** A webhook. */ -export interface Webhook { - /** The Jira events that trigger the 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) - * to extend the date. - */ - expirationDate?: number; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** The ID of the webhook. */ - id: number; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The JQL filter that specifies which issues the webhook is sent for. */ - jqlFilter: string; -} diff --git a/src/version2/models/webhookDetails.mts b/src/version2/models/webhookDetails.mts new file mode 100644 index 0000000000..aefca5d3d8 --- /dev/null +++ b/src/version2/models/webhookDetails.mts @@ -0,0 +1,25 @@ +/** A list of webhooks. */ +export interface WebhookDetails { + /** The Jira events that trigger the webhook. */ + events: string[]; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** + * The Jql filter that specifies which issues the webhook is sent for. Only a subset of Jql can be used. The supported + * elements are: + * + * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For + * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT + * IN`. + */ + jqlFilter: string; +} diff --git a/src/version2/models/webhookDetails.ts b/src/version2/models/webhookDetails.ts deleted file mode 100644 index 2fb3e0f981..0000000000 --- a/src/version2/models/webhookDetails.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** A list of webhooks. */ -export interface WebhookDetails { - /** The Jira events that trigger the webhook. */ - events: string[]; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** - * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported - * elements are: - * - * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For - * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT - * IN`. - */ - jqlFilter: string; -} diff --git a/src/version2/models/webhookRegistrationDetails.mts b/src/version2/models/webhookRegistrationDetails.mts new file mode 100644 index 0000000000..13c31de8f6 --- /dev/null +++ b/src/version2/models/webhookRegistrationDetails.mts @@ -0,0 +1,12 @@ +import { WebhookDetails } from './webhookDetails.mjs'; + +/** Details of webhooks to register. */ +export interface WebhookRegistrationDetails { + /** + * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a + * single URL per app is allowed to be registered. + */ + url: string; + /** A list of webhooks. */ + webhooks: WebhookDetails[]; +} diff --git a/src/version2/models/webhookRegistrationDetails.ts b/src/version2/models/webhookRegistrationDetails.ts deleted file mode 100644 index 6894c2f7ab..0000000000 --- a/src/version2/models/webhookRegistrationDetails.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { WebhookDetails } from './webhookDetails'; - -/** Details of webhooks to register. */ -export interface WebhookRegistrationDetails { - /** - * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a - * single URL per app is allowed to be registered. - */ - url: string; - /** A list of webhooks. */ - webhooks: WebhookDetails[]; -} diff --git a/src/version2/models/webhooksExpirationDate.ts b/src/version2/models/webhooksExpirationDate.mts similarity index 100% rename from src/version2/models/webhooksExpirationDate.ts rename to src/version2/models/webhooksExpirationDate.mts diff --git a/src/version2/models/workflow.mts b/src/version2/models/workflow.mts new file mode 100644 index 0000000000..bf7157572a --- /dev/null +++ b/src/version2/models/workflow.mts @@ -0,0 +1,30 @@ +import type { ProjectDetails } from './projectDetails.mjs'; +import { PublishedWorkflowId } from './publishedWorkflowId.mjs'; +import { Transition } from './transition.mjs'; +import { WorkflowOperations } from './workflowOperations.mjs'; +import { WorkflowSchemeIdName } from './workflowSchemeIdName.mjs'; +import { WorkflowStatus } from './workflowStatus.mjs'; + +/** Details about a workflow. */ +export interface Workflow { + /** The creation date of the workflow. */ + created?: string; + /** The description of the workflow. */ + description: string; + /** Whether the workflow has a draft version. */ + hasDraftWorkflow?: boolean; + id: PublishedWorkflowId; + /** Whether this is the default workflow. */ + isDefault?: boolean; + operations?: WorkflowOperations; + /** The projects the workflow is assigned to, through workflow schemes. */ + projects?: ProjectDetails[]; + /** The workflow schemes the workflow is assigned to. */ + schemes?: WorkflowSchemeIdName[]; + /** The statuses of the workflow. */ + statuses?: WorkflowStatus[]; + /** The transitions of the workflow. */ + transitions?: Transition[]; + /** The last edited date of the workflow. */ + updated?: string; +} diff --git a/src/version2/models/workflow.ts b/src/version2/models/workflow.ts deleted file mode 100644 index 596a7b27bf..0000000000 --- a/src/version2/models/workflow.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ProjectDetails } from './projectDetails'; -import { PublishedWorkflowId } from './publishedWorkflowId'; -import { Transition } from './transition'; -import { WorkflowOperations } from './workflowOperations'; -import { WorkflowSchemeIdName } from './workflowSchemeIdName'; -import { WorkflowStatus } from './workflowStatus'; - -/** Details about a workflow. */ -export interface Workflow { - /** The creation date of the workflow. */ - created?: string; - /** The description of the workflow. */ - description: string; - /** Whether the workflow has a draft version. */ - hasDraftWorkflow?: boolean; - id: PublishedWorkflowId; - /** Whether this is the default workflow. */ - isDefault?: boolean; - operations?: WorkflowOperations; - /** The projects the workflow is assigned to, through workflow schemes. */ - projects?: ProjectDetails[]; - /** The workflow schemes the workflow is assigned to. */ - schemes?: WorkflowSchemeIdName[]; - /** The statuses of the workflow. */ - statuses?: WorkflowStatus[]; - /** The transitions of the workflow. */ - transitions?: Transition[]; - /** The last edited date of the workflow. */ - updated?: string; -} diff --git a/src/version2/models/workflowCapabilities.mts b/src/version2/models/workflowCapabilities.mts new file mode 100644 index 0000000000..c40bdb92cd --- /dev/null +++ b/src/version2/models/workflowCapabilities.mts @@ -0,0 +1,22 @@ +import { AvailableWorkflowConnectRule } from './availableWorkflowConnectRule.mjs'; +import { AvailableWorkflowForgeRule } from './availableWorkflowForgeRule.mjs'; +import { AvailableWorkflowSystemRule } from './availableWorkflowSystemRule.mjs'; +import { AvailableWorkflowTriggers } from './availableWorkflowTriggers.mjs'; + +export interface WorkflowCapabilities { + /** The Connect provided ecosystem rules available. */ + connectRules?: AvailableWorkflowConnectRule[]; + /** + * The scope of the workflow capabilities. `GLOBAL` for company-managed projects and `PROJECT` for team-managed + * projects. + */ + editorScope?: string; + /** The Forge provided ecosystem rules available. */ + forgeRules?: AvailableWorkflowForgeRule[]; + /** The types of projects that this capability set is available for. */ + projectTypes?: string[]; + /** The Atlassian provided system rules available. */ + systemRules?: AvailableWorkflowSystemRule[]; + /** The trigger rules available. */ + triggerRules?: AvailableWorkflowTriggers[]; +} diff --git a/src/version2/models/workflowCapabilities.ts b/src/version2/models/workflowCapabilities.ts deleted file mode 100644 index 2fbb6213d6..0000000000 --- a/src/version2/models/workflowCapabilities.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { AvailableWorkflowConnectRule } from './availableWorkflowConnectRule'; -import { AvailableWorkflowForgeRule } from './availableWorkflowForgeRule'; -import { AvailableWorkflowSystemRule } from './availableWorkflowSystemRule'; -import { AvailableWorkflowTriggers } from './availableWorkflowTriggers'; - -export interface WorkflowCapabilities { - /** The Connect provided ecosystem rules available. */ - connectRules?: AvailableWorkflowConnectRule[]; - /** - * The scope of the workflow capabilities. `GLOBAL` for company-managed projects and `PROJECT` for team-managed - * projects. - */ - editorScope?: string; - /** The Forge provided ecosystem rules available. */ - forgeRules?: AvailableWorkflowForgeRule[]; - /** The types of projects that this capability set is available for. */ - projectTypes?: string[]; - /** The Atlassian provided system rules available. */ - systemRules?: AvailableWorkflowSystemRule[]; - /** The trigger rules available. */ - triggerRules?: AvailableWorkflowTriggers[]; -} diff --git a/src/version2/models/workflowCondition.ts b/src/version2/models/workflowCondition.mts similarity index 100% rename from src/version2/models/workflowCondition.ts rename to src/version2/models/workflowCondition.mts diff --git a/src/version2/models/workflowCreate.mts b/src/version2/models/workflowCreate.mts new file mode 100644 index 0000000000..b93e509228 --- /dev/null +++ b/src/version2/models/workflowCreate.mts @@ -0,0 +1,16 @@ +import { StatusLayoutUpdate } from './statusLayoutUpdate.mjs'; +import { TransitionUpdateDTO } from './transitionUpdateDTO.mjs'; +import { WorkflowLayout } from './workflowLayout.mjs'; + +/** The details of the workflows to create. */ +export interface WorkflowCreate { + /** The description of the workflow to create. */ + description?: string; + /** The name of the workflow to create. */ + name: string; + startPointLayout?: WorkflowLayout; + /** The statuses associated with this workflow. */ + statuses: StatusLayoutUpdate[]; + /** The transitions of this workflow. */ + transitions: TransitionUpdateDTO[]; +} diff --git a/src/version2/models/workflowCreate.ts b/src/version2/models/workflowCreate.ts deleted file mode 100644 index dcd7390cd5..0000000000 --- a/src/version2/models/workflowCreate.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { StatusLayoutUpdate } from './statusLayoutUpdate'; -import { TransitionUpdateDTO } from './transitionUpdateDTO'; -import { WorkflowLayout } from './workflowLayout'; - -/** The details of the workflows to create. */ -export interface WorkflowCreate { - /** The description of the workflow to create. */ - description?: string; - /** The name of the workflow to create. */ - name: string; - startPointLayout?: WorkflowLayout; - /** The statuses associated with this workflow. */ - statuses: StatusLayoutUpdate[]; - /** The transitions of this workflow. */ - transitions: TransitionUpdateDTO[]; -} diff --git a/src/version2/models/workflowCreateRequest.mts b/src/version2/models/workflowCreateRequest.mts new file mode 100644 index 0000000000..af6ab2c3f5 --- /dev/null +++ b/src/version2/models/workflowCreateRequest.mts @@ -0,0 +1,12 @@ +import { WorkflowCreate } from './workflowCreate.mjs'; +import { WorkflowScope } from './workflowScope.mjs'; +import { WorkflowStatusUpdate } from './workflowStatusUpdate.mjs'; + +/** 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/version2/models/workflowCreateRequest.ts b/src/version2/models/workflowCreateRequest.ts deleted file mode 100644 index b4eaf9cc0a..0000000000 --- a/src/version2/models/workflowCreateRequest.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { WorkflowCreate } from './workflowCreate'; -import { WorkflowScope } from './workflowScope'; -import { WorkflowStatusUpdate } from './workflowStatusUpdate'; - -/** 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/version2/models/workflowCreateResponse.mts b/src/version2/models/workflowCreateResponse.mts new file mode 100644 index 0000000000..16f5c2bcc6 --- /dev/null +++ b/src/version2/models/workflowCreateResponse.mts @@ -0,0 +1,10 @@ +import { JiraWorkflow } from './jiraWorkflow.mjs'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus.mjs'; + +/** Details of the created workflows and statuses. */ +export interface WorkflowCreateResponse { + /** List of created statuses. */ + statuses?: JiraWorkflowStatus[]; + /** List of created workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowCreateResponse.ts b/src/version2/models/workflowCreateResponse.ts deleted file mode 100644 index 1600d3ce86..0000000000 --- a/src/version2/models/workflowCreateResponse.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { JiraWorkflow } from './jiraWorkflow'; -import { JiraWorkflowStatus } from './jiraWorkflowStatus'; - -/** Details of the created workflows and statuses. */ -export interface WorkflowCreateResponse { - /** List of created statuses. */ - statuses?: JiraWorkflowStatus[]; - /** List of created workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowElementReference.mts b/src/version2/models/workflowElementReference.mts new file mode 100644 index 0000000000..ee4dfea333 --- /dev/null +++ b/src/version2/models/workflowElementReference.mts @@ -0,0 +1,14 @@ +import { ProjectAndIssueTypePair } from './projectAndIssueTypePair.mjs'; + +/** 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/version2/models/workflowElementReference.ts b/src/version2/models/workflowElementReference.ts deleted file mode 100644 index e0b0ed2390..0000000000 --- a/src/version2/models/workflowElementReference.ts +++ /dev/null @@ -1,14 +0,0 @@ -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/version2/models/workflowId.ts b/src/version2/models/workflowId.mts similarity index 100% rename from src/version2/models/workflowId.ts rename to src/version2/models/workflowId.mts diff --git a/src/version2/models/workflowLayout.ts b/src/version2/models/workflowLayout.mts similarity index 100% rename from src/version2/models/workflowLayout.ts rename to src/version2/models/workflowLayout.mts diff --git a/src/version2/models/workflowOperations.ts b/src/version2/models/workflowOperations.mts similarity index 100% rename from src/version2/models/workflowOperations.ts rename to src/version2/models/workflowOperations.mts diff --git a/src/version2/models/workflowRead.mts b/src/version2/models/workflowRead.mts new file mode 100644 index 0000000000..3fbe7b2fde --- /dev/null +++ b/src/version2/models/workflowRead.mts @@ -0,0 +1,10 @@ +import { JiraWorkflow } from './jiraWorkflow.mjs'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus.mjs'; + +/** Details of workflows and related statuses. */ +export interface WorkflowRead { + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; + /** List of workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowRead.ts b/src/version2/models/workflowRead.ts deleted file mode 100644 index 64ae1fb21f..0000000000 --- a/src/version2/models/workflowRead.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { JiraWorkflow } from './jiraWorkflow'; -import { JiraWorkflowStatus } from './jiraWorkflowStatus'; - -/** Details of workflows and related statuses. */ -export interface WorkflowRead { - /** List of statuses. */ - statuses?: JiraWorkflowStatus[]; - /** List of workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowReferenceStatus.mts b/src/version2/models/workflowReferenceStatus.mts new file mode 100644 index 0000000000..f3e1aed6a8 --- /dev/null +++ b/src/version2/models/workflowReferenceStatus.mts @@ -0,0 +1,12 @@ +import { WorkflowStatusLayout } from './workflowStatusLayout.mjs'; + +/** The statuses referenced in the workflow. */ +export interface WorkflowReferenceStatus { + /** 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/version2/models/workflowReferenceStatus.ts b/src/version2/models/workflowReferenceStatus.ts deleted file mode 100644 index b60f99d504..0000000000 --- a/src/version2/models/workflowReferenceStatus.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { WorkflowStatusLayout } from './workflowStatusLayout'; - -/** The statuses referenced in the workflow. */ -export interface WorkflowReferenceStatus { - /** 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/version2/models/workflowRuleConfiguration.ts b/src/version2/models/workflowRuleConfiguration.mts similarity index 100% rename from src/version2/models/workflowRuleConfiguration.ts rename to src/version2/models/workflowRuleConfiguration.mts diff --git a/src/version2/models/workflowRules.mts b/src/version2/models/workflowRules.mts new file mode 100644 index 0000000000..ef9ed10db7 --- /dev/null +++ b/src/version2/models/workflowRules.mts @@ -0,0 +1,11 @@ +import { WorkflowCondition } from './workflowCondition.mjs'; +import { WorkflowTransitionRule } from './workflowTransitionRule.mjs'; + +/** A collection of transition rules. */ +export interface WorkflowRules { + conditionsTree?: WorkflowCondition; + /** The workflow post functions. */ + postFunctions?: WorkflowTransitionRule[]; + /** The workflow validators. */ + validators?: WorkflowTransitionRule[]; +} diff --git a/src/version2/models/workflowRules.ts b/src/version2/models/workflowRules.ts deleted file mode 100644 index 0f04cb9d05..0000000000 --- a/src/version2/models/workflowRules.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { WorkflowCondition } from './workflowCondition'; -import { WorkflowTransitionRule } from './workflowTransitionRule'; - -/** A collection of transition rules. */ -export interface WorkflowRules { - conditionsTree?: WorkflowCondition; - /** The workflow post functions. */ - postFunctions?: WorkflowTransitionRule[]; - /** The workflow validators. */ - validators?: WorkflowTransitionRule[]; -} diff --git a/src/version2/models/workflowRulesSearch.ts b/src/version2/models/workflowRulesSearch.mts similarity index 100% rename from src/version2/models/workflowRulesSearch.ts rename to src/version2/models/workflowRulesSearch.mts diff --git a/src/version2/models/workflowRulesSearchDetails.mts b/src/version2/models/workflowRulesSearchDetails.mts new file mode 100644 index 0000000000..89d3ff9b17 --- /dev/null +++ b/src/version2/models/workflowRulesSearchDetails.mts @@ -0,0 +1,11 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details of workflow transition rules. */ +export interface WorkflowRulesSearchDetails { + /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ + invalidRules?: string[]; + /** List of valid workflow transition rules. */ + validRules?: WorkflowTransitionRules[]; + /** The workflow ID. */ + workflowEntityId?: string; +} diff --git a/src/version2/models/workflowRulesSearchDetails.ts b/src/version2/models/workflowRulesSearchDetails.ts deleted file mode 100644 index f5973ced5e..0000000000 --- a/src/version2/models/workflowRulesSearchDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** Details of workflow transition rules. */ -export interface WorkflowRulesSearchDetails { - /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ - invalidRules?: string[]; - /** List of valid workflow transition rules. */ - validRules?: WorkflowTransitionRules[]; - /** The workflow ID. */ - workflowEntityId?: string; -} diff --git a/src/version2/models/workflowScheme.mts b/src/version2/models/workflowScheme.mts new file mode 100644 index 0000000000..8d82b8e179 --- /dev/null +++ b/src/version2/models/workflowScheme.mts @@ -0,0 +1,61 @@ +import { User } from './user.mjs'; + +/** Details about a workflow scheme. */ +export interface WorkflowScheme { + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow?: string; + /** The description of the workflow scheme. */ + description?: string; + /** Whether the workflow scheme is a draft or not. */ + draft?: boolean; + /** The ID of the workflow scheme. */ + id?: number; + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings?: {}; + /** The issue types available in Jira. */ + issueTypes?: {}; + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified?: string; + lastModifiedUser?: User; + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name?: string; + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow?: string; + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings?: {}; + self?: string; + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` + * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow + * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do + * not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; +} diff --git a/src/version2/models/workflowScheme.ts b/src/version2/models/workflowScheme.ts deleted file mode 100644 index 7940c321cd..0000000000 --- a/src/version2/models/workflowScheme.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { User } from './user'; - -/** Details about a workflow scheme. */ -export interface WorkflowScheme { - /** - * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ - * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira - * Workflow (jira)_. - */ - defaultWorkflow?: string; - /** The description of the workflow scheme. */ - description?: string; - /** Whether the workflow scheme is a draft or not. */ - draft?: boolean; - /** The ID of the workflow scheme. */ - id?: number; - /** - * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an - * issue type can only be mapped to one workflow in a workflow scheme. - */ - issueTypeMappings?: {}; - /** The issue types available in Jira. */ - issueTypes?: {}; - /** - * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue - * type-project mappings only. This property does not apply to non-draft workflows. - */ - lastModified?: string; - lastModifiedUser?: User; - /** - * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when - * creating a workflow scheme. - */ - name?: string; - /** - * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The - * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. - */ - originalDefaultWorkflow?: string; - /** - * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, - * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one - * workflow in a workflow scheme. - */ - originalIssueTypeMappings?: {}; - self?: string; - /** - * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow - * scheme is a workflow scheme that is used by at least one project. The following examples show how this property - * works: - * - * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is - * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` - * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow - * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do - * not require drafts to update. - * - * Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; -} diff --git a/src/version2/models/workflowSchemeAssociations.mts b/src/version2/models/workflowSchemeAssociations.mts new file mode 100644 index 0000000000..b14453a234 --- /dev/null +++ b/src/version2/models/workflowSchemeAssociations.mts @@ -0,0 +1,8 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A workflow scheme along with a list of projects that use it. */ +export interface WorkflowSchemeAssociations { + /** The list of projects that use the workflow scheme. */ + projectIds: string[]; + workflowScheme?: WorkflowScheme; +} diff --git a/src/version2/models/workflowSchemeAssociations.ts b/src/version2/models/workflowSchemeAssociations.ts deleted file mode 100644 index ac253e98ac..0000000000 --- a/src/version2/models/workflowSchemeAssociations.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { WorkflowScheme } from './workflowScheme'; - -/** A workflow scheme along with a list of projects that use it. */ -export interface WorkflowSchemeAssociations { - /** The list of projects that use the workflow scheme. */ - projectIds: string[]; - workflowScheme?: WorkflowScheme; -} diff --git a/src/version2/models/workflowSchemeIdName.ts b/src/version2/models/workflowSchemeIdName.mts similarity index 100% rename from src/version2/models/workflowSchemeIdName.ts rename to src/version2/models/workflowSchemeIdName.mts diff --git a/src/version2/models/workflowSchemeProjectAssociation.ts b/src/version2/models/workflowSchemeProjectAssociation.mts similarity index 100% rename from src/version2/models/workflowSchemeProjectAssociation.ts rename to src/version2/models/workflowSchemeProjectAssociation.mts diff --git a/src/version2/models/workflowScope.mts b/src/version2/models/workflowScope.mts new file mode 100644 index 0000000000..59c70d09e9 --- /dev/null +++ b/src/version2/models/workflowScope.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** 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: string; +} diff --git a/src/version2/models/workflowScope.ts b/src/version2/models/workflowScope.ts deleted file mode 100644 index c1d31a8fd5..0000000000 --- a/src/version2/models/workflowScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -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: string; -} diff --git a/src/version2/models/workflowStatus.mts b/src/version2/models/workflowStatus.mts new file mode 100644 index 0000000000..bd34734ffa --- /dev/null +++ b/src/version2/models/workflowStatus.mts @@ -0,0 +1,14 @@ +import { WorkflowStatusProperties } from './workflowStatusProperties.mjs'; + +/** Details of a workflow status. */ +export interface WorkflowStatus { + /** The ID of the issue status. */ + id: string; + /** The name of the status in the workflow. */ + name: string; + /** + * Additional properties that modify the behavior of issues in this status. Supports the properties + * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. + */ + properties?: WorkflowStatusProperties; +} diff --git a/src/version2/models/workflowStatus.ts b/src/version2/models/workflowStatus.ts deleted file mode 100644 index 64b93bff11..0000000000 --- a/src/version2/models/workflowStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { WorkflowStatusProperties } from './workflowStatusProperties'; - -/** Details of a workflow status. */ -export interface WorkflowStatus { - /** The ID of the issue status. */ - id: string; - /** The name of the status in the workflow. */ - name: string; - /** - * Additional properties that modify the behavior of issues in this status. Supports the properties - * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. - */ - properties?: WorkflowStatusProperties; -} diff --git a/src/version2/models/workflowStatusAndPort.ts b/src/version2/models/workflowStatusAndPort.mts similarity index 100% rename from src/version2/models/workflowStatusAndPort.ts rename to src/version2/models/workflowStatusAndPort.mts diff --git a/src/version2/models/workflowStatusLayout.ts b/src/version2/models/workflowStatusLayout.mts similarity index 100% rename from src/version2/models/workflowStatusLayout.ts rename to src/version2/models/workflowStatusLayout.mts diff --git a/src/version2/models/workflowStatusProperties.ts b/src/version2/models/workflowStatusProperties.mts similarity index 100% rename from src/version2/models/workflowStatusProperties.ts rename to src/version2/models/workflowStatusProperties.mts diff --git a/src/version2/models/workflowStatusUpdate.ts b/src/version2/models/workflowStatusUpdate.mts similarity index 100% rename from src/version2/models/workflowStatusUpdate.ts rename to src/version2/models/workflowStatusUpdate.mts diff --git a/src/version2/models/workflowTransition.ts b/src/version2/models/workflowTransition.mts similarity index 100% rename from src/version2/models/workflowTransition.ts rename to src/version2/models/workflowTransition.mts diff --git a/src/version2/models/workflowTransitionProperty.ts b/src/version2/models/workflowTransitionProperty.mts similarity index 100% rename from src/version2/models/workflowTransitionProperty.ts rename to src/version2/models/workflowTransitionProperty.mts diff --git a/src/version2/models/workflowTransitionRule.ts b/src/version2/models/workflowTransitionRule.mts similarity index 100% rename from src/version2/models/workflowTransitionRule.ts rename to src/version2/models/workflowTransitionRule.mts diff --git a/src/version2/models/workflowTransitionRules.mts b/src/version2/models/workflowTransitionRules.mts new file mode 100644 index 0000000000..b6e550ff72 --- /dev/null +++ b/src/version2/models/workflowTransitionRules.mts @@ -0,0 +1,13 @@ +import { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule.mjs'; +import { WorkflowId } from './workflowId.mjs'; + +/** A workflow with transition rules. */ +export interface WorkflowTransitionRules { + workflowId: WorkflowId; + /** The list of post functions within the workflow. */ + postFunctions: ConnectWorkflowTransitionRule[]; + /** The list of conditions within the workflow. */ + conditions: ConnectWorkflowTransitionRule[]; + /** The list of validators within the workflow. */ + validators: ConnectWorkflowTransitionRule[]; +} diff --git a/src/version2/models/workflowTransitionRules.ts b/src/version2/models/workflowTransitionRules.ts deleted file mode 100644 index 88bb365a28..0000000000 --- a/src/version2/models/workflowTransitionRules.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule'; -import { WorkflowId } from './workflowId'; - -/** A workflow with transition rules. */ -export interface WorkflowTransitionRules { - workflowId: WorkflowId; - /** The list of post functions within the workflow. */ - postFunctions: ConnectWorkflowTransitionRule[]; - /** The list of conditions within the workflow. */ - conditions: ConnectWorkflowTransitionRule[]; - /** The list of validators within the workflow. */ - validators: ConnectWorkflowTransitionRule[]; -} diff --git a/src/version2/models/workflowTransitionRulesDetails.mts b/src/version2/models/workflowTransitionRulesDetails.mts new file mode 100644 index 0000000000..ca62a71f7d --- /dev/null +++ b/src/version2/models/workflowTransitionRulesDetails.mts @@ -0,0 +1,8 @@ +import { WorkflowId } from './workflowId.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesDetails { + workflowId: WorkflowId; + /** The list of connect workflow rule IDs. */ + workflowRuleIds: string[]; +} diff --git a/src/version2/models/workflowTransitionRulesDetails.ts b/src/version2/models/workflowTransitionRulesDetails.ts deleted file mode 100644 index d09ad9f96f..0000000000 --- a/src/version2/models/workflowTransitionRulesDetails.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { WorkflowId } from './workflowId'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesDetails { - workflowId: WorkflowId; - /** The list of connect workflow rule IDs. */ - workflowRuleIds: string[]; -} diff --git a/src/version2/models/workflowTransitionRulesUpdate.mts b/src/version2/models/workflowTransitionRulesUpdate.mts new file mode 100644 index 0000000000..882da8d8a2 --- /dev/null +++ b/src/version2/models/workflowTransitionRulesUpdate.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesUpdate { + /** The list of workflows with transition rules to update. */ + workflows: WorkflowTransitionRules[]; +} diff --git a/src/version2/models/workflowTransitionRulesUpdate.ts b/src/version2/models/workflowTransitionRulesUpdate.ts deleted file mode 100644 index 376e0aa354..0000000000 --- a/src/version2/models/workflowTransitionRulesUpdate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesUpdate { - /** The list of workflows with transition rules to update. */ - workflows: WorkflowTransitionRules[]; -} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts new file mode 100644 index 0000000000..008fa96a2a --- /dev/null +++ b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.mts @@ -0,0 +1,16 @@ +import { WorkflowId } from './workflowId.mjs'; + +/** Details of any errors encountered while updating workflow transition rules for a workflow. */ +export interface WorkflowTransitionRulesUpdateErrorDetails { + /** + * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here + * wasn't updated. + */ + ruleUpdateErrors: {}; + /** + * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains + * any entries. + */ + updateErrors: string[]; + workflowId: WorkflowId; +} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts b/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts deleted file mode 100644 index 1163412b28..0000000000 --- a/src/version2/models/workflowTransitionRulesUpdateErrorDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { WorkflowId } from './workflowId'; - -/** Details of any errors encountered while updating workflow transition rules for a workflow. */ -export interface WorkflowTransitionRulesUpdateErrorDetails { - /** - * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here - * wasn't updated. - */ - ruleUpdateErrors: {}; - /** - * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains - * any entries. - */ - updateErrors: string[]; - workflowId: WorkflowId; -} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrors.mts b/src/version2/models/workflowTransitionRulesUpdateErrors.mts new file mode 100644 index 0000000000..ec25fe9284 --- /dev/null +++ b/src/version2/models/workflowTransitionRulesUpdateErrors.mts @@ -0,0 +1,7 @@ +import { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails.mjs'; + +/** Details of any errors encountered while updating workflow transition rules. */ +export interface WorkflowTransitionRulesUpdateErrors { + /** A list of workflows. */ + updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; +} diff --git a/src/version2/models/workflowTransitionRulesUpdateErrors.ts b/src/version2/models/workflowTransitionRulesUpdateErrors.ts deleted file mode 100644 index 4e5c6ce38a..0000000000 --- a/src/version2/models/workflowTransitionRulesUpdateErrors.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails'; - -/** Details of any errors encountered while updating workflow transition rules. */ -export interface WorkflowTransitionRulesUpdateErrors { - /** A list of workflows. */ - updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; -} diff --git a/src/version2/models/workflowTransitions.mts b/src/version2/models/workflowTransitions.mts new file mode 100644 index 0000000000..0c70c61d31 --- /dev/null +++ b/src/version2/models/workflowTransitions.mts @@ -0,0 +1,31 @@ +import { ConditionGroupConfiguration } from './conditionGroupConfiguration.mjs'; +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration.mjs'; +import { WorkflowStatusAndPort } from './workflowStatusAndPort.mjs'; +import { WorkflowTrigger } from './workflowTrigger.mjs'; + +/** The transitions of the workflow. */ +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 the transition can start from. */ + from?: WorkflowStatusAndPort[]; + /** The ID of the transition. */ + id?: string; + /** The name of the transition. */ + name?: string; + /** The properties of the transition. */ + properties?: {}; + to?: WorkflowStatusAndPort; + transitionScreen?: WorkflowRuleConfiguration; + /** The triggers of the transition. */ + triggers?: WorkflowTrigger[]; + /** The transition type. */ + type?: string; + /** The validators of the transition. */ + validators?: WorkflowRuleConfiguration[]; +} diff --git a/src/version2/models/workflowTransitions.ts b/src/version2/models/workflowTransitions.ts deleted file mode 100644 index dc89268156..0000000000 --- a/src/version2/models/workflowTransitions.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ConditionGroupConfiguration } from './conditionGroupConfiguration'; -import { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; -import { WorkflowStatusAndPort } from './workflowStatusAndPort'; -import { WorkflowTrigger } from './workflowTrigger'; - -/** The transitions of the workflow. */ -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 the transition can start from. */ - from?: WorkflowStatusAndPort[]; - /** The ID of the transition. */ - id?: string; - /** The name of the transition. */ - name?: string; - /** The properties of the transition. */ - properties?: {}; - to?: WorkflowStatusAndPort; - transitionScreen?: WorkflowRuleConfiguration; - /** The triggers of the transition. */ - triggers?: WorkflowTrigger[]; - /** The transition type. */ - type?: string; - /** The validators of the transition. */ - validators?: WorkflowRuleConfiguration[]; -} diff --git a/src/version2/models/workflowTrigger.ts b/src/version2/models/workflowTrigger.mts similarity index 100% rename from src/version2/models/workflowTrigger.ts rename to src/version2/models/workflowTrigger.mts diff --git a/src/version2/models/workflowUpdate.mts b/src/version2/models/workflowUpdate.mts new file mode 100644 index 0000000000..6ca41f24fa --- /dev/null +++ b/src/version2/models/workflowUpdate.mts @@ -0,0 +1,24 @@ +import { DocumentVersion } from './documentVersion.mjs'; +import { StatusLayoutUpdate } from './statusLayoutUpdate.mjs'; +import { StatusMappingDTO } from './statusMappingDTO.mjs'; +import { StatusMigration } from './statusMigration.mjs'; +import { TransitionUpdateDTO } from './transitionUpdateDTO.mjs'; +import { WorkflowLayout } from './workflowLayout.mjs'; + +/** The details of the workflows to update. */ +export interface WorkflowUpdate { + /** The mapping of old to new status ID. */ + defaultStatusMappings?: StatusMigration[]; + /** The new description for this workflow. */ + description?: string; + /** The ID of this workflow. */ + id: string; + startPointLayout?: WorkflowLayout; + /** The mapping of old to new status ID for a specific project and issue type. */ + statusMappings?: StatusMappingDTO[]; + /** The statuses associated with this workflow. */ + statuses: StatusLayoutUpdate[]; + /** The transitions of this workflow. */ + transitions: TransitionUpdateDTO[]; + version: DocumentVersion; +} diff --git a/src/version2/models/workflowUpdate.ts b/src/version2/models/workflowUpdate.ts deleted file mode 100644 index c85fde3077..0000000000 --- a/src/version2/models/workflowUpdate.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { DocumentVersion } from './documentVersion'; -import { StatusLayoutUpdate } from './statusLayoutUpdate'; -import { StatusMappingDTO } from './statusMappingDTO'; -import { StatusMigration } from './statusMigration'; -import { TransitionUpdateDTO } from './transitionUpdateDTO'; -import { WorkflowLayout } from './workflowLayout'; - -/** The details of the workflows to update. */ -export interface WorkflowUpdate { - /** The mapping of old to new status ID. */ - defaultStatusMappings?: StatusMigration[]; - /** The new description for this workflow. */ - description?: string; - /** The ID of this workflow. */ - id: string; - startPointLayout?: WorkflowLayout; - /** The mapping of old to new status ID for a specific project and issue type. */ - statusMappings?: StatusMappingDTO[]; - /** The statuses associated with this workflow. */ - statuses: StatusLayoutUpdate[]; - /** The transitions of this workflow. */ - transitions: TransitionUpdateDTO[]; - version: DocumentVersion; -} diff --git a/src/version2/models/workflowUpdateRequest.mts b/src/version2/models/workflowUpdateRequest.mts new file mode 100644 index 0000000000..da2ff7f8ef --- /dev/null +++ b/src/version2/models/workflowUpdateRequest.mts @@ -0,0 +1,10 @@ +import { WorkflowStatusUpdate } from './workflowStatusUpdate.mjs'; +import { WorkflowUpdate } from './workflowUpdate.mjs'; + +/** 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/version2/models/workflowUpdateRequest.ts b/src/version2/models/workflowUpdateRequest.ts deleted file mode 100644 index 7f5c7e9b17..0000000000 --- a/src/version2/models/workflowUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/version2/models/workflowUpdateResponse.mts b/src/version2/models/workflowUpdateResponse.mts new file mode 100644 index 0000000000..ad3b424cf7 --- /dev/null +++ b/src/version2/models/workflowUpdateResponse.mts @@ -0,0 +1,11 @@ +import { JiraWorkflow } from './jiraWorkflow.mjs'; +import { JiraWorkflowStatus } from './jiraWorkflowStatus.mjs'; + +export interface WorkflowUpdateResponse { + /** List of updated statuses. */ + statuses?: JiraWorkflowStatus[]; + /** If there is a [asynchronous task](#async-operations) operation, as a result of this update. */ + taskId?: string; + /** List of updated workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version2/models/workflowUpdateResponse.ts b/src/version2/models/workflowUpdateResponse.ts deleted file mode 100644 index 57e60d99dd..0000000000 --- a/src/version2/models/workflowUpdateResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { JiraWorkflow } from './jiraWorkflow'; -import { JiraWorkflowStatus } from './jiraWorkflowStatus'; - -export interface WorkflowUpdateResponse { - /** List of updated statuses. */ - statuses?: JiraWorkflowStatus[]; - /** If there is a [asynchronous task](#async-operations) operation, as a result of this update. */ - taskId?: string; - /** List of updated workflows. */ - workflows?: JiraWorkflow[]; -} diff --git a/src/version2/models/workflowValidationError.mts b/src/version2/models/workflowValidationError.mts new file mode 100644 index 0000000000..a16bd11d0e --- /dev/null +++ b/src/version2/models/workflowValidationError.mts @@ -0,0 +1,14 @@ +import { WorkflowElementReference } from './workflowElementReference.mjs'; + +/** The details about a workflow validation error. */ +export interface WorkflowValidationError { + /** An error code. */ + code?: string; + elementReference?: WorkflowElementReference; + /** The validation error level. */ + level?: string; + /** An error message. */ + message?: string; + /** The type of element the error or warning references. */ + type?: string; +} diff --git a/src/version2/models/workflowValidationError.ts b/src/version2/models/workflowValidationError.ts deleted file mode 100644 index 18e8a32d6d..0000000000 --- a/src/version2/models/workflowValidationError.ts +++ /dev/null @@ -1,14 +0,0 @@ -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?: string; - /** An error message. */ - message?: string; - /** The type of element the error or warning references. */ - type?: string; -} diff --git a/src/version2/models/workflowValidationErrorList.mts b/src/version2/models/workflowValidationErrorList.mts new file mode 100644 index 0000000000..a731f8684f --- /dev/null +++ b/src/version2/models/workflowValidationErrorList.mts @@ -0,0 +1,6 @@ +import { WorkflowValidationError } from './workflowValidationError.mjs'; + +export interface WorkflowValidationErrorList { + /** The list of validation errors. */ + errors?: WorkflowValidationError[]; +} diff --git a/src/version2/models/workflowValidationErrorList.ts b/src/version2/models/workflowValidationErrorList.ts deleted file mode 100644 index 95e3690a4d..0000000000 --- a/src/version2/models/workflowValidationErrorList.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { WorkflowValidationError } from './workflowValidationError'; - -export interface WorkflowValidationErrorList { - /** The list of validation errors. */ - errors?: WorkflowValidationError[]; -} diff --git a/src/version2/models/workflowsWithTransitionRulesDetails.mts b/src/version2/models/workflowsWithTransitionRulesDetails.mts new file mode 100644 index 0000000000..6a5b35ed94 --- /dev/null +++ b/src/version2/models/workflowsWithTransitionRulesDetails.mts @@ -0,0 +1,7 @@ +import { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails.mjs'; + +/** Details of workflows and their transition rules to delete. */ +export interface WorkflowsWithTransitionRulesDetails { + /** The list of workflows with transition rules to delete. */ + workflows: WorkflowTransitionRulesDetails[]; +} diff --git a/src/version2/models/workflowsWithTransitionRulesDetails.ts b/src/version2/models/workflowsWithTransitionRulesDetails.ts deleted file mode 100644 index b038041dda..0000000000 --- a/src/version2/models/workflowsWithTransitionRulesDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails'; - -/** Details of workflows and their transition rules to delete. */ -export interface WorkflowsWithTransitionRulesDetails { - /** The list of workflows with transition rules to delete. */ - workflows: WorkflowTransitionRulesDetails[]; -} diff --git a/src/version2/models/worklog.mts b/src/version2/models/worklog.mts new file mode 100644 index 0000000000..5533507f69 --- /dev/null +++ b/src/version2/models/worklog.mts @@ -0,0 +1,40 @@ +import { EntityProperty } from './entityProperty.mjs'; +import { UserDetails } from './userDetails.mjs'; +import { Visibility } from './visibility.mjs'; + +/** Details of a worklog. */ +export interface Worklog { + author?: UserDetails; + /** A comment about the worklog. Optional when creating or updating a worklog. */ + comment?: string; + /** The datetime on which the worklog was created. */ + created?: string; + /** The ID of the worklog record. */ + id?: string; + /** The ID of the issue this worklog is for. */ + issueId?: string; + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties?: EntityProperty[]; + /** The URL of the worklog item. */ + self?: string; + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started?: string; + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent?: string; + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds?: number; + updateAuthor?: UserDetails; + /** The datetime on which the worklog was last updated. */ + updated?: string; + visibility?: Visibility; +} diff --git a/src/version2/models/worklog.ts b/src/version2/models/worklog.ts deleted file mode 100644 index a4d1f7c83d..0000000000 --- a/src/version2/models/worklog.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { EntityProperty } from './entityProperty'; -import { UserDetails } from './userDetails'; -import { Visibility } from './visibility'; - -/** Details of a worklog. */ -export interface Worklog { - author?: UserDetails; - /** A comment about the worklog. Optional when creating or updating a worklog. */ - comment?: string; - /** The datetime on which the worklog was created. */ - created?: string; - /** The ID of the worklog record. */ - id?: string; - /** The ID of the issue this worklog is for. */ - issueId?: string; - /** Details of properties for the worklog. Optional when creating or updating a worklog. */ - properties?: EntityProperty[]; - /** The URL of the worklog item. */ - self?: string; - /** - * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a - * worklog. - */ - started?: string; - /** - * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a - * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if - * `timeSpentSecond` is provided. - */ - timeSpent?: string; - /** - * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. - * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. - */ - timeSpentSeconds?: number; - updateAuthor?: UserDetails; - /** The datetime on which the worklog was last updated. */ - updated?: string; - visibility?: Visibility; -} diff --git a/src/version2/models/worklogIdsRequest.ts b/src/version2/models/worklogIdsRequest.mts similarity index 100% rename from src/version2/models/worklogIdsRequest.ts rename to src/version2/models/worklogIdsRequest.mts diff --git a/src/version2/myself.mts b/src/version2/myself.mts new file mode 100644 index 0000000000..f6a305cba2 --- /dev/null +++ b/src/version2/myself.mts @@ -0,0 +1,234 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Myself { + constructor(private client: Client) {} + + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; + async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences', + method: 'GET', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * 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. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * 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. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; + async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences', + method: 'PUT', + headers: { + 'Content-Type': typeof parameters.value === 'string' ? 'text/plain' : 'application/json', + }, + params: { + key: parameters.key, + }, + data: parameters.value, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; + async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences', + method: 'DELETE', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLocale(callback: Callback): Promise; + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getLocale(callback?: never): Promise; + async getLocale(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypreferences/locale', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser( + parameters: Parameters.GetCurrentUser | undefined, + callback: Callback, + ): Promise; + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; + async getCurrentUser( + parameters?: Parameters.GetCurrentUser, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/myself', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/myself.ts b/src/version2/myself.ts deleted file mode 100644 index 2930c9de48..0000000000 --- a/src/version2/myself.ts +++ /dev/null @@ -1,234 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Myself { - constructor(private client: Client) {} - - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; - async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences', - method: 'GET', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * 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. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * 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. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; - async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences', - method: 'PUT', - headers: { - 'Content-Type': typeof parameters.value === 'string' ? 'text/plain' : 'application/json', - }, - params: { - key: parameters.key, - }, - data: parameters.value, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; - async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences', - method: 'DELETE', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLocale(callback: Callback): Promise; - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getLocale(callback?: never): Promise; - async getLocale(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypreferences/locale', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser( - parameters: Parameters.GetCurrentUser | undefined, - callback: Callback, - ): Promise; - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; - async getCurrentUser( - parameters?: Parameters.GetCurrentUser, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/myself', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/parameters/addActorUsers.mts b/src/version2/parameters/addActorUsers.mts new file mode 100644 index 0000000000..084642245f --- /dev/null +++ b/src/version2/parameters/addActorUsers.mts @@ -0,0 +1,11 @@ +import { ActorsMap } from '../models/index.mjs'; + +export interface AddActorUsers extends ActorsMap { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; + /** + * 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. + */ + id: number; +} diff --git a/src/version2/parameters/addActorUsers.ts b/src/version2/parameters/addActorUsers.ts deleted file mode 100644 index 1451229935..0000000000 --- a/src/version2/parameters/addActorUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ActorsMap } from '../models'; - -export interface AddActorUsers extends ActorsMap { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; - /** - * 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. - */ - id: number; -} diff --git a/src/version2/parameters/addAttachment.ts b/src/version2/parameters/addAttachment.mts similarity index 100% rename from src/version2/parameters/addAttachment.ts rename to src/version2/parameters/addAttachment.mts diff --git a/src/version2/parameters/addComment.mts b/src/version2/parameters/addComment.mts new file mode 100644 index 0000000000..d53266cda9 --- /dev/null +++ b/src/version2/parameters/addComment.mts @@ -0,0 +1,12 @@ +import { Comment } from '../models/index.mjs'; + +export interface AddComment extends Comment { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: string; +} diff --git a/src/version2/parameters/addComment.ts b/src/version2/parameters/addComment.ts deleted file mode 100644 index 97a5242665..0000000000 --- a/src/version2/parameters/addComment.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Comment } from '../models'; - -export interface AddComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; -} diff --git a/src/version2/parameters/addFieldToDefaultScreen.ts b/src/version2/parameters/addFieldToDefaultScreen.mts similarity index 100% rename from src/version2/parameters/addFieldToDefaultScreen.ts rename to src/version2/parameters/addFieldToDefaultScreen.mts diff --git a/src/version2/parameters/addGadget.mts b/src/version2/parameters/addGadget.mts new file mode 100644 index 0000000000..52cfa03f8c --- /dev/null +++ b/src/version2/parameters/addGadget.mts @@ -0,0 +1,6 @@ +import { DashboardGadgetSettings } from '../models/index.mjs'; + +export interface AddGadget extends DashboardGadgetSettings { + /** The ID of the dashboard. */ + dashboardId: number; +} diff --git a/src/version2/parameters/addGadget.ts b/src/version2/parameters/addGadget.ts deleted file mode 100644 index dd161fea1f..0000000000 --- a/src/version2/parameters/addGadget.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DashboardGadgetSettings } from '../models'; - -export interface AddGadget extends DashboardGadgetSettings { - /** The ID of the dashboard. */ - dashboardId: number; -} diff --git a/src/version2/parameters/addIssueTypesToContext.mts b/src/version2/parameters/addIssueTypesToContext.mts new file mode 100644 index 0000000000..973ad9e1be --- /dev/null +++ b/src/version2/parameters/addIssueTypesToContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/addIssueTypesToContext.ts b/src/version2/parameters/addIssueTypesToContext.ts deleted file mode 100644 index e08bf03d6f..0000000000 --- a/src/version2/parameters/addIssueTypesToContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface AddIssueTypesToContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/addIssueTypesToIssueTypeScheme.mts b/src/version2/parameters/addIssueTypesToIssueTypeScheme.mts new file mode 100644 index 0000000000..e8768623bf --- /dev/null +++ b/src/version2/parameters/addIssueTypesToIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts b/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts deleted file mode 100644 index b2c6e15f39..0000000000 --- a/src/version2/parameters/addIssueTypesToIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/addProjectRoleActorsToRole.mts b/src/version2/parameters/addProjectRoleActorsToRole.mts new file mode 100644 index 0000000000..7e575742ac --- /dev/null +++ b/src/version2/parameters/addProjectRoleActorsToRole.mts @@ -0,0 +1,9 @@ +import { ActorInput } from '../models/index.mjs'; + +export interface AddProjectRoleActorsToRole extends ActorInput { + /** + * 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. + */ + id: number; +} diff --git a/src/version2/parameters/addProjectRoleActorsToRole.ts b/src/version2/parameters/addProjectRoleActorsToRole.ts deleted file mode 100644 index 4dc05b2448..0000000000 --- a/src/version2/parameters/addProjectRoleActorsToRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ActorInput } from '../models'; - -export interface AddProjectRoleActorsToRole extends ActorInput { - /** - * 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. - */ - id: number; -} diff --git a/src/version2/parameters/addScreenTab.mts b/src/version2/parameters/addScreenTab.mts new file mode 100644 index 0000000000..3ce2f3a878 --- /dev/null +++ b/src/version2/parameters/addScreenTab.mts @@ -0,0 +1,6 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface AddScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version2/parameters/addScreenTab.ts b/src/version2/parameters/addScreenTab.ts deleted file mode 100644 index 07962426f2..0000000000 --- a/src/version2/parameters/addScreenTab.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ScreenableTab } from '../models'; - -export interface AddScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/addScreenTabField.mts b/src/version2/parameters/addScreenTabField.mts new file mode 100644 index 0000000000..5bff262102 --- /dev/null +++ b/src/version2/parameters/addScreenTabField.mts @@ -0,0 +1,8 @@ +import { AddField } from '../models/index.mjs'; + +export interface AddScreenTabField extends AddField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version2/parameters/addScreenTabField.ts b/src/version2/parameters/addScreenTabField.ts deleted file mode 100644 index b055647c57..0000000000 --- a/src/version2/parameters/addScreenTabField.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AddField } from '../models'; - -export interface AddScreenTabField extends AddField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/addSecurityLevel.mts b/src/version2/parameters/addSecurityLevel.mts new file mode 100644 index 0000000000..6891874274 --- /dev/null +++ b/src/version2/parameters/addSecurityLevel.mts @@ -0,0 +1,6 @@ +import { AddSecuritySchemeLevelsRequest } from '../models/index.mjs'; + +export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { + /** The ID of the issue security scheme. */ + schemeId: string; +} diff --git a/src/version2/parameters/addSecurityLevel.ts b/src/version2/parameters/addSecurityLevel.ts deleted file mode 100644 index ed915fa92c..0000000000 --- a/src/version2/parameters/addSecurityLevel.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { AddSecuritySchemeLevelsRequest } from '../models'; - -export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { - /** The ID of the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/addSecurityLevelMembers.mts b/src/version2/parameters/addSecurityLevelMembers.mts new file mode 100644 index 0000000000..3ed3b0a6f3 --- /dev/null +++ b/src/version2/parameters/addSecurityLevelMembers.mts @@ -0,0 +1,8 @@ +import { SecuritySchemeMembersRequest } from '../models/index.mjs'; + +export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { + /** The ID of the issue security scheme. */ + schemeId: string; + /** The ID of the issue security level. */ + levelId: string; +} diff --git a/src/version2/parameters/addSecurityLevelMembers.ts b/src/version2/parameters/addSecurityLevelMembers.ts deleted file mode 100644 index ac1a26e84d..0000000000 --- a/src/version2/parameters/addSecurityLevelMembers.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SecuritySchemeMembersRequest } from '../models'; - -export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level. */ - levelId: string; -} diff --git a/src/version2/parameters/addSharePermission.mts b/src/version2/parameters/addSharePermission.mts new file mode 100644 index 0000000000..a55798ad14 --- /dev/null +++ b/src/version2/parameters/addSharePermission.mts @@ -0,0 +1,6 @@ +import { SharePermissionInput } from '../models/index.mjs'; + +export interface AddSharePermission extends SharePermissionInput { + /** The ID of the filter. */ + id: number; +} diff --git a/src/version2/parameters/addSharePermission.ts b/src/version2/parameters/addSharePermission.ts deleted file mode 100644 index 0f672e9756..0000000000 --- a/src/version2/parameters/addSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SharePermissionInput } from '../models'; - -export interface AddSharePermission extends SharePermissionInput { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version2/parameters/addUserToGroup.mts b/src/version2/parameters/addUserToGroup.mts new file mode 100644 index 0000000000..f123c87286 --- /dev/null +++ b/src/version2/parameters/addUserToGroup.mts @@ -0,0 +1,11 @@ +import { UpdateUserToGroup } from '../models/index.mjs'; + +export interface AddUserToGroup extends UpdateUserToGroup { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This + * parameter cannot be used with the `groupId` parameter. + */ + groupName?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; +} diff --git a/src/version2/parameters/addUserToGroup.ts b/src/version2/parameters/addUserToGroup.ts deleted file mode 100644 index ec3c98798b..0000000000 --- a/src/version2/parameters/addUserToGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { UpdateUserToGroup } from '../models'; - -export interface AddUserToGroup extends UpdateUserToGroup { - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This - * parameter cannot be used with the `groupId` parameter. - */ - groupName?: string; - /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ - groupId?: string; -} diff --git a/src/version2/parameters/addVote.ts b/src/version2/parameters/addVote.mts similarity index 100% rename from src/version2/parameters/addVote.ts rename to src/version2/parameters/addVote.mts diff --git a/src/version2/parameters/addWatcher.ts b/src/version2/parameters/addWatcher.mts similarity index 100% rename from src/version2/parameters/addWatcher.ts rename to src/version2/parameters/addWatcher.mts diff --git a/src/version2/parameters/addWorklog.mts b/src/version2/parameters/addWorklog.mts new file mode 100644 index 0000000000..1c1e1d2e8b --- /dev/null +++ b/src/version2/parameters/addWorklog.mts @@ -0,0 +1,39 @@ +import { Worklog } from '../models/index.mjs'; + +export interface AddWorklog extends Worklog { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `manual` Reduces the estimate by amount specified in `reduceBy`. + * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, + * _2d_. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about work logs in the response. This parameter accepts `properties`, which returns worklog + * properties. + */ + expand?: string; + /** + * Whether the worklog entry should be added 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 + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/addWorklog.ts b/src/version2/parameters/addWorklog.ts deleted file mode 100644 index 6bd51e1bce..0000000000 --- a/src/version2/parameters/addWorklog.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { Worklog } from '../models'; - -export interface AddWorklog extends Worklog { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `manual` Reduces the estimate by amount specified in `reduceBy`. - * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, - * _2d_. Required when `adjustEstimate` is `manual`. - */ - reduceBy?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about work logs in the response. This parameter accepts `properties`, which returns worklog - * properties. - */ - expand?: string; - /** - * Whether the worklog entry should be added 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 - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/analyseExpression.mts b/src/version2/parameters/analyseExpression.mts new file mode 100644 index 0000000000..8802ab65df --- /dev/null +++ b/src/version2/parameters/analyseExpression.mts @@ -0,0 +1,17 @@ +import { JiraExpressionForAnalysis } from '../models/index.mjs'; + +export interface AnalyseExpression extends JiraExpressionForAnalysis { + /** + * The check to perform: + * + * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are + * validated. For example, the expression's length. + * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors + * that would result in the expression failure at runtime are reported. For example, accessing properties that don't + * exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive + * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each + * expression may execute. + */ + check?: 'syntax' | 'type' | 'complexity' | string; +} diff --git a/src/version2/parameters/analyseExpression.ts b/src/version2/parameters/analyseExpression.ts deleted file mode 100644 index 46d7696d48..0000000000 --- a/src/version2/parameters/analyseExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { JiraExpressionForAnalysis } from '../models'; - -export interface AnalyseExpression extends JiraExpressionForAnalysis { - /** - * The check to perform: - * - * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are - * validated. For example, the expression's length. - * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors - * that would result in the expression failure at runtime are reported. For example, accessing properties that don't - * exist or passing the wrong number of arguments to functions. Also performs the syntax check. - * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive - * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each - * expression may execute. - */ - check?: 'syntax' | 'type' | 'complexity' | string; -} diff --git a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..99bbd0dbc4 --- /dev/null +++ b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeMappingDetails } from '../models/index.mjs'; + +export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts b/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts deleted file mode 100644 index e31689b20d..0000000000 --- a/src/version2/parameters/appendMappingsForIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeScreenSchemeMappingDetails } from '../models'; - -export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/archiveIssues.ts b/src/version2/parameters/archiveIssues.mts similarity index 100% rename from src/version2/parameters/archiveIssues.ts rename to src/version2/parameters/archiveIssues.mts diff --git a/src/version2/parameters/archiveIssuesAsync.ts b/src/version2/parameters/archiveIssuesAsync.mts similarity index 100% rename from src/version2/parameters/archiveIssuesAsync.ts rename to src/version2/parameters/archiveIssuesAsync.mts diff --git a/src/version2/parameters/archiveProject.ts b/src/version2/parameters/archiveProject.mts similarity index 100% rename from src/version2/parameters/archiveProject.ts rename to src/version2/parameters/archiveProject.mts diff --git a/src/version2/parameters/assignFieldConfigurationSchemeToProject.mts b/src/version2/parameters/assignFieldConfigurationSchemeToProject.mts new file mode 100644 index 0000000000..93d7163142 --- /dev/null +++ b/src/version2/parameters/assignFieldConfigurationSchemeToProject.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts b/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts deleted file mode 100644 index 8cead61b41..0000000000 --- a/src/version2/parameters/assignFieldConfigurationSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FieldConfigurationSchemeProjectAssociation } from '../models'; - -export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssue.mts b/src/version2/parameters/assignIssue.mts new file mode 100644 index 0000000000..dd52f8b27e --- /dev/null +++ b/src/version2/parameters/assignIssue.mts @@ -0,0 +1,15 @@ +import { User } from '../models/index.mjs'; + +export interface AssignIssue extends Omit { + /** The ID or key of the issue to be assigned. */ + issueIdOrKey: string; + + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. + */ + accountId: string | null; + + /** Whether the user is active. */ + active?: boolean; +} diff --git a/src/version2/parameters/assignIssue.ts b/src/version2/parameters/assignIssue.ts deleted file mode 100644 index 5d4f76c84d..0000000000 --- a/src/version2/parameters/assignIssue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { User } from '../models'; - -export interface AssignIssue extends Omit { - /** The ID or key of the issue to be assigned. */ - issueIdOrKey: string; - - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. - */ - accountId: string | null; - - /** Whether the user is active. */ - active?: boolean; -} diff --git a/src/version2/parameters/assignIssueTypeSchemeToProject.mts b/src/version2/parameters/assignIssueTypeSchemeToProject.mts new file mode 100644 index 0000000000..2984b6cc12 --- /dev/null +++ b/src/version2/parameters/assignIssueTypeSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeSchemeToProject.ts b/src/version2/parameters/assignIssueTypeSchemeToProject.ts deleted file mode 100644 index f297c4d1eb..0000000000 --- a/src/version2/parameters/assignIssueTypeSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeSchemeProjectAssociation } from '../models'; - -export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts new file mode 100644 index 0000000000..3a209ea089 --- /dev/null +++ b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts b/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts deleted file mode 100644 index 009b11b8f7..0000000000 --- a/src/version2/parameters/assignIssueTypeScreenSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeScreenSchemeProjectAssociation } from '../models'; - -export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignPermissionScheme.mts b/src/version2/parameters/assignPermissionScheme.mts new file mode 100644 index 0000000000..081619fa3a --- /dev/null +++ b/src/version2/parameters/assignPermissionScheme.mts @@ -0,0 +1,27 @@ +import { Id } from '../models/index.mjs'; + +export interface AssignPermissionScheme extends Id { + /** The project ID or project key (case sensitive). */ + projectKeyOrId: 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. Note that permissions are included when + * you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'permissions' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] + | string; +} diff --git a/src/version2/parameters/assignPermissionScheme.ts b/src/version2/parameters/assignPermissionScheme.ts deleted file mode 100644 index db753f2bad..0000000000 --- a/src/version2/parameters/assignPermissionScheme.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Id } from '../models'; - -export interface AssignPermissionScheme extends Id { - /** The project ID or project key (case sensitive). */ - projectKeyOrId: 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. Note that permissions are included when - * you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string; -} diff --git a/src/version2/parameters/assignProjectsToCustomFieldContext.mts b/src/version2/parameters/assignProjectsToCustomFieldContext.mts new file mode 100644 index 0000000000..d8b4b090a7 --- /dev/null +++ b/src/version2/parameters/assignProjectsToCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface AssignProjectsToCustomFieldContext extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/assignProjectsToCustomFieldContext.ts b/src/version2/parameters/assignProjectsToCustomFieldContext.ts deleted file mode 100644 index 1f9f35a4f3..0000000000 --- a/src/version2/parameters/assignProjectsToCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectIds } from '../models'; - -export interface AssignProjectsToCustomFieldContext extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/assignSchemeToProject.mts b/src/version2/parameters/assignSchemeToProject.mts new file mode 100644 index 0000000000..31f2210137 --- /dev/null +++ b/src/version2/parameters/assignSchemeToProject.mts @@ -0,0 +1,3 @@ +import { WorkflowSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version2/parameters/assignSchemeToProject.ts b/src/version2/parameters/assignSchemeToProject.ts deleted file mode 100644 index 8089f47d09..0000000000 --- a/src/version2/parameters/assignSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowSchemeProjectAssociation } from '../models'; - -export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version2/parameters/associateSchemesToProjects.mts b/src/version2/parameters/associateSchemesToProjects.mts new file mode 100644 index 0000000000..75576ca862 --- /dev/null +++ b/src/version2/parameters/associateSchemesToProjects.mts @@ -0,0 +1,11 @@ +import { OldToNewSecurityLevelMappings } from '../models/index.mjs'; + +/** Issue security scheme, project, and remapping details. */ +export interface AssociateSchemesToProjects { + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings: OldToNewSecurityLevelMappings[]; + /** The ID of the project. */ + projectId: string; + /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ + schemeId: string; +} diff --git a/src/version2/parameters/associateSchemesToProjects.ts b/src/version2/parameters/associateSchemesToProjects.ts deleted file mode 100644 index 1e9752f741..0000000000 --- a/src/version2/parameters/associateSchemesToProjects.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { OldToNewSecurityLevelMappings } from '../models'; - -/** Issue security scheme, project, and remapping details. */ -export interface AssociateSchemesToProjects { - /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ - oldToNewSecurityLevelMappings: OldToNewSecurityLevelMappings[]; - /** The ID of the project. */ - projectId: string; - /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ - schemeId: string; -} diff --git a/src/version2/parameters/bulkDeleteIssueProperty.mts b/src/version2/parameters/bulkDeleteIssueProperty.mts new file mode 100644 index 0000000000..bfc78d867e --- /dev/null +++ b/src/version2/parameters/bulkDeleteIssueProperty.mts @@ -0,0 +1,6 @@ +import { IssueFilterForBulkPropertyDelete } from '../models/index.mjs'; + +export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { + /** The key of the property. */ + propertyKey: string; +} diff --git a/src/version2/parameters/bulkDeleteIssueProperty.ts b/src/version2/parameters/bulkDeleteIssueProperty.ts deleted file mode 100644 index b66f3d9f5e..0000000000 --- a/src/version2/parameters/bulkDeleteIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueFilterForBulkPropertyDelete } from '../models'; - -export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version2/parameters/bulkEditDashboards.mts b/src/version2/parameters/bulkEditDashboards.mts new file mode 100644 index 0000000000..086014ceee --- /dev/null +++ b/src/version2/parameters/bulkEditDashboards.mts @@ -0,0 +1,13 @@ +import { BulkChangeOwnerDetails, PermissionDetails } from '../models/index.mjs'; + +/** Details of a request to bulk edit shareable entity. */ +export interface BulkEditDashboards { + /** Allowed action for bulk edit shareable entity */ + action: string; + changeOwnerDetails?: BulkChangeOwnerDetails; + /** The id list of shareable entities to be changed. */ + entityIds: number[]; + /** Whether the actions are executed by users with Administer Jira global permission. */ + extendAdminPermissions?: boolean; + permissionDetails?: PermissionDetails; +} diff --git a/src/version2/parameters/bulkEditDashboards.ts b/src/version2/parameters/bulkEditDashboards.ts deleted file mode 100644 index 43116d773c..0000000000 --- a/src/version2/parameters/bulkEditDashboards.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { BulkChangeOwnerDetails, PermissionDetails } from '../models'; - -/** Details of a request to bulk edit shareable entity. */ -export interface BulkEditDashboards { - /** Allowed action for bulk edit shareable entity */ - action: string; - changeOwnerDetails?: BulkChangeOwnerDetails; - /** The id list of shareable entities to be changed. */ - entityIds: number[]; - /** Whether the actions are executed by users with Administer Jira global permission. */ - extendAdminPermissions?: boolean; - permissionDetails?: PermissionDetails; -} diff --git a/src/version2/parameters/bulkGetGroups.ts b/src/version2/parameters/bulkGetGroups.mts similarity index 100% rename from src/version2/parameters/bulkGetGroups.ts rename to src/version2/parameters/bulkGetGroups.mts diff --git a/src/version2/parameters/bulkGetUsers.ts b/src/version2/parameters/bulkGetUsers.mts similarity index 100% rename from src/version2/parameters/bulkGetUsers.ts rename to src/version2/parameters/bulkGetUsers.mts diff --git a/src/version2/parameters/bulkGetUsersMigration.ts b/src/version2/parameters/bulkGetUsersMigration.mts similarity index 100% rename from src/version2/parameters/bulkGetUsersMigration.ts rename to src/version2/parameters/bulkGetUsersMigration.mts diff --git a/src/version2/parameters/bulkSetIssuePropertiesByIssue.mts b/src/version2/parameters/bulkSetIssuePropertiesByIssue.mts new file mode 100644 index 0000000000..b96e5308dc --- /dev/null +++ b/src/version2/parameters/bulkSetIssuePropertiesByIssue.mts @@ -0,0 +1,3 @@ +import { MultiIssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts b/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts deleted file mode 100644 index c36f8dee79..0000000000 --- a/src/version2/parameters/bulkSetIssuePropertiesByIssue.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { MultiIssueEntityProperties } from '../models'; - -export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssueProperty.mts b/src/version2/parameters/bulkSetIssueProperty.mts new file mode 100644 index 0000000000..457f8d21b9 --- /dev/null +++ b/src/version2/parameters/bulkSetIssueProperty.mts @@ -0,0 +1,6 @@ +import { BulkIssuePropertyUpdateRequest } from '../models/index.mjs'; + +export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { + /** The key of the property. The maximum length is 255 characters. */ + propertyKey: string; +} diff --git a/src/version2/parameters/bulkSetIssueProperty.ts b/src/version2/parameters/bulkSetIssueProperty.ts deleted file mode 100644 index 3441a3cf2a..0000000000 --- a/src/version2/parameters/bulkSetIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BulkIssuePropertyUpdateRequest } from '../models'; - -export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { - /** The key of the property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version2/parameters/bulkSetIssuesProperties.mts b/src/version2/parameters/bulkSetIssuesProperties.mts new file mode 100644 index 0000000000..f6df48500d --- /dev/null +++ b/src/version2/parameters/bulkSetIssuesProperties.mts @@ -0,0 +1,3 @@ +import { IssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version2/parameters/bulkSetIssuesProperties.ts b/src/version2/parameters/bulkSetIssuesProperties.ts deleted file mode 100644 index a5524aa6dc..0000000000 --- a/src/version2/parameters/bulkSetIssuesProperties.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueEntityProperties } from '../models'; - -export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version2/parameters/cancelTask.ts b/src/version2/parameters/cancelTask.mts similarity index 100% rename from src/version2/parameters/cancelTask.ts rename to src/version2/parameters/cancelTask.mts diff --git a/src/version2/parameters/changeFilterOwner.ts b/src/version2/parameters/changeFilterOwner.mts similarity index 100% rename from src/version2/parameters/changeFilterOwner.ts rename to src/version2/parameters/changeFilterOwner.mts diff --git a/src/version2/parameters/copyDashboard.mts b/src/version2/parameters/copyDashboard.mts new file mode 100644 index 0000000000..8233629223 --- /dev/null +++ b/src/version2/parameters/copyDashboard.mts @@ -0,0 +1,5 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface CopyDashboard extends DashboardDetails { + id: string; +} diff --git a/src/version2/parameters/copyDashboard.ts b/src/version2/parameters/copyDashboard.ts deleted file mode 100644 index 1e157d012e..0000000000 --- a/src/version2/parameters/copyDashboard.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DashboardDetails } from '../models'; - -export interface CopyDashboard extends DashboardDetails { - id: string; -} diff --git a/src/version2/parameters/createComponent.mts b/src/version2/parameters/createComponent.mts new file mode 100644 index 0000000000..82765b5794 --- /dev/null +++ b/src/version2/parameters/createComponent.mts @@ -0,0 +1,3 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface CreateComponent extends ProjectComponent {} diff --git a/src/version2/parameters/createComponent.ts b/src/version2/parameters/createComponent.ts deleted file mode 100644 index d84d76eb7b..0000000000 --- a/src/version2/parameters/createComponent.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ProjectComponent } from '../models'; - -export interface CreateComponent extends ProjectComponent {} diff --git a/src/version2/parameters/createCustomField.mts b/src/version2/parameters/createCustomField.mts new file mode 100644 index 0000000000..409f21d32d --- /dev/null +++ b/src/version2/parameters/createCustomField.mts @@ -0,0 +1,3 @@ +import { CustomFieldDefinitionJson } from '../models/index.mjs'; + +export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version2/parameters/createCustomField.ts b/src/version2/parameters/createCustomField.ts deleted file mode 100644 index b6e8cdd762..0000000000 --- a/src/version2/parameters/createCustomField.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CustomFieldDefinitionJson } from '../models'; - -export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version2/parameters/createCustomFieldContext.ts b/src/version2/parameters/createCustomFieldContext.mts similarity index 100% rename from src/version2/parameters/createCustomFieldContext.ts rename to src/version2/parameters/createCustomFieldContext.mts diff --git a/src/version2/parameters/createCustomFieldOption.mts b/src/version2/parameters/createCustomFieldOption.mts new file mode 100644 index 0000000000..67c684ab53 --- /dev/null +++ b/src/version2/parameters/createCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionCreateRequest } from '../models/index.mjs'; + +export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/createCustomFieldOption.ts b/src/version2/parameters/createCustomFieldOption.ts deleted file mode 100644 index 9bf2208191..0000000000 --- a/src/version2/parameters/createCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BulkCustomFieldOptionCreateRequest } from '../models'; - -export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/createDashboard.mts b/src/version2/parameters/createDashboard.mts new file mode 100644 index 0000000000..08358b7948 --- /dev/null +++ b/src/version2/parameters/createDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails, SharePermission } from '../models/index.mjs'; + +export interface CreateDashboard extends Omit { + /** The edit permissions for the dashboard. */ + editPermissions?: SharePermission[]; +} diff --git a/src/version2/parameters/createDashboard.ts b/src/version2/parameters/createDashboard.ts deleted file mode 100644 index eb78135c41..0000000000 --- a/src/version2/parameters/createDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DashboardDetails, SharePermission } from '../models'; - -export interface CreateDashboard extends Omit { - /** The edit permissions for the dashboard. */ - editPermissions?: SharePermission[]; -} diff --git a/src/version2/parameters/createFieldConfiguration.mts b/src/version2/parameters/createFieldConfiguration.mts new file mode 100644 index 0000000000..fafce9fb0b --- /dev/null +++ b/src/version2/parameters/createFieldConfiguration.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version2/parameters/createFieldConfiguration.ts b/src/version2/parameters/createFieldConfiguration.ts deleted file mode 100644 index 0275a1f5d3..0000000000 --- a/src/version2/parameters/createFieldConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FieldConfigurationDetails } from '../models'; - -export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version2/parameters/createFieldConfigurationScheme.mts b/src/version2/parameters/createFieldConfigurationScheme.mts new file mode 100644 index 0000000000..9383fe66df --- /dev/null +++ b/src/version2/parameters/createFieldConfigurationScheme.mts @@ -0,0 +1,3 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version2/parameters/createFieldConfigurationScheme.ts b/src/version2/parameters/createFieldConfigurationScheme.ts deleted file mode 100644 index 007c1dc319..0000000000 --- a/src/version2/parameters/createFieldConfigurationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { UpdateFieldConfigurationSchemeDetails } from '../models'; - -export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version2/parameters/createFilter.mts b/src/version2/parameters/createFilter.mts new file mode 100644 index 0000000000..87526234c7 --- /dev/null +++ b/src/version2/parameters/createFilter.mts @@ -0,0 +1,23 @@ +import { Filter } from '../models/index.mjs'; + +export interface CreateFilter extends Filter { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't + * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of + * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to + * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version2/parameters/createFilter.ts b/src/version2/parameters/createFilter.ts deleted file mode 100644 index 754fd6a906..0000000000 --- a/src/version2/parameters/createFilter.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Filter } from '../models'; - -export interface CreateFilter extends Filter { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/createGroup.mts b/src/version2/parameters/createGroup.mts new file mode 100644 index 0000000000..fcd378a1bb --- /dev/null +++ b/src/version2/parameters/createGroup.mts @@ -0,0 +1,5 @@ +import { AddGroup } from '../models/index.mjs'; + +export interface CreateGroup extends AddGroup { + [key: string]: any; +} diff --git a/src/version2/parameters/createGroup.ts b/src/version2/parameters/createGroup.ts deleted file mode 100644 index 15c93233fd..0000000000 --- a/src/version2/parameters/createGroup.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { AddGroup } from '../models'; - -export interface CreateGroup extends AddGroup { - [key: string]: any; -} diff --git a/src/version2/parameters/createIssue.mts b/src/version2/parameters/createIssue.mts new file mode 100644 index 0000000000..926ac476d9 --- /dev/null +++ b/src/version2/parameters/createIssue.mts @@ -0,0 +1,62 @@ +import { IssueUpdateDetails, Project, TimeTrackingDetails } from '../models/index.mjs'; + +export interface CreateIssue extends Omit { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a + * project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: { + [key: string]: any; + summary: string; + project: Partial; + issuetype: { + id?: string | number; + name?: string; + }; + parent?: { + [key: string]: any; + key?: string; + }; + components?: Array<{ + [key: string]: any; + id?: string | number; + }>; + description?: string; + reporter?: { + [key: string]: any; + id?: string | number; + }; + fixVersions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + priority?: { + [key: string]: any; + id?: string | number; + }; + labels?: string[]; + timetracking?: TimeTrackingDetails; + security?: { + [key: string]: any; + id?: string | number; + }; + environment?: any; + versions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + duedate?: string; + assignee?: { + [key: string]: any; + id?: string | number; + }; + }; +} diff --git a/src/version2/parameters/createIssue.ts b/src/version2/parameters/createIssue.ts deleted file mode 100644 index 83b5949c2f..0000000000 --- a/src/version2/parameters/createIssue.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { IssueUpdateDetails, Project, TimeTrackingDetails } from '../models'; - -export interface CreateIssue extends Omit { - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a - * project. These values are then used to provide defaults on the issue create screen. - */ - updateHistory?: boolean; - - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields: { - [key: string]: any; - summary: string; - project: Partial; - issuetype: { - id?: string | number; - name?: string; - }; - parent?: { - [key: string]: any; - key?: string; - }; - components?: Array<{ - [key: string]: any; - id?: string | number; - }>; - description?: string; - reporter?: { - [key: string]: any; - id?: string | number; - }; - fixVersions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - priority?: { - [key: string]: any; - id?: string | number; - }; - labels?: string[]; - timetracking?: TimeTrackingDetails; - security?: { - [key: string]: any; - id?: string | number; - }; - environment?: any; - versions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - duedate?: string; - assignee?: { - [key: string]: any; - id?: string | number; - }; - }; -} diff --git a/src/version2/parameters/createIssueFieldOption.mts b/src/version2/parameters/createIssueFieldOption.mts new file mode 100644 index 0000000000..c8ce1bed36 --- /dev/null +++ b/src/version2/parameters/createIssueFieldOption.mts @@ -0,0 +1,14 @@ +import { IssueFieldOptionCreate } from '../models/index.mjs'; + +export interface CreateIssueFieldOption extends IssueFieldOptionCreate { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; +} diff --git a/src/version2/parameters/createIssueFieldOption.ts b/src/version2/parameters/createIssueFieldOption.ts deleted file mode 100644 index 22a756b2f5..0000000000 --- a/src/version2/parameters/createIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IssueFieldOptionCreate } from '../models'; - -export interface CreateIssueFieldOption extends IssueFieldOptionCreate { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version2/parameters/createIssueLinkType.mts b/src/version2/parameters/createIssueLinkType.mts new file mode 100644 index 0000000000..e51df2f5e5 --- /dev/null +++ b/src/version2/parameters/createIssueLinkType.mts @@ -0,0 +1,3 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version2/parameters/createIssueLinkType.ts b/src/version2/parameters/createIssueLinkType.ts deleted file mode 100644 index 10afb86f8c..0000000000 --- a/src/version2/parameters/createIssueLinkType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueLinkType } from '../models'; - -export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version2/parameters/createIssueSecurityScheme.mts b/src/version2/parameters/createIssueSecurityScheme.mts new file mode 100644 index 0000000000..20cbb444a1 --- /dev/null +++ b/src/version2/parameters/createIssueSecurityScheme.mts @@ -0,0 +1,3 @@ +import { CreateIssueSecuritySchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version2/parameters/createIssueSecurityScheme.ts b/src/version2/parameters/createIssueSecurityScheme.ts deleted file mode 100644 index 0f290307b4..0000000000 --- a/src/version2/parameters/createIssueSecurityScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateIssueSecuritySchemeDetails } from '../models'; - -export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version2/parameters/createIssueType.mts b/src/version2/parameters/createIssueType.mts new file mode 100644 index 0000000000..6181ab8fd6 --- /dev/null +++ b/src/version2/parameters/createIssueType.mts @@ -0,0 +1,3 @@ +import { IssueTypeCreate } from '../models/index.mjs'; + +export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version2/parameters/createIssueType.ts b/src/version2/parameters/createIssueType.ts deleted file mode 100644 index 948fbe0cd8..0000000000 --- a/src/version2/parameters/createIssueType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeCreate } from '../models'; - -export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version2/parameters/createIssueTypeAvatar.ts b/src/version2/parameters/createIssueTypeAvatar.mts similarity index 100% rename from src/version2/parameters/createIssueTypeAvatar.ts rename to src/version2/parameters/createIssueTypeAvatar.mts diff --git a/src/version2/parameters/createIssueTypeScheme.mts b/src/version2/parameters/createIssueTypeScheme.mts new file mode 100644 index 0000000000..79cd33aab0 --- /dev/null +++ b/src/version2/parameters/createIssueTypeScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScheme.ts b/src/version2/parameters/createIssueTypeScheme.ts deleted file mode 100644 index 75bff61acd..0000000000 --- a/src/version2/parameters/createIssueTypeScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeSchemeDetails } from '../models'; - -export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScreenScheme.mts b/src/version2/parameters/createIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..65857ffb95 --- /dev/null +++ b/src/version2/parameters/createIssueTypeScreenScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version2/parameters/createIssueTypeScreenScheme.ts b/src/version2/parameters/createIssueTypeScreenScheme.ts deleted file mode 100644 index fb016af54f..0000000000 --- a/src/version2/parameters/createIssueTypeScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeScreenSchemeDetails } from '../models'; - -export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version2/parameters/createIssues.mts b/src/version2/parameters/createIssues.mts new file mode 100644 index 0000000000..556e0719f3 --- /dev/null +++ b/src/version2/parameters/createIssues.mts @@ -0,0 +1,3 @@ +import { IssuesUpdate } from '../models/index.mjs'; + +export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version2/parameters/createIssues.ts b/src/version2/parameters/createIssues.ts deleted file mode 100644 index 4c447caa8e..0000000000 --- a/src/version2/parameters/createIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssuesUpdate } from '../models'; - -export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version2/parameters/createNotificationScheme.mts b/src/version2/parameters/createNotificationScheme.mts new file mode 100644 index 0000000000..adb278e8df --- /dev/null +++ b/src/version2/parameters/createNotificationScheme.mts @@ -0,0 +1,3 @@ +import { CreateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version2/parameters/createNotificationScheme.ts b/src/version2/parameters/createNotificationScheme.ts deleted file mode 100644 index 30f52272ed..0000000000 --- a/src/version2/parameters/createNotificationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateNotificationSchemeDetails } from '../models'; - -export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version2/parameters/createOrUpdateRemoteIssueLink.mts b/src/version2/parameters/createOrUpdateRemoteIssueLink.mts new file mode 100644 index 0000000000..db8e7d2037 --- /dev/null +++ b/src/version2/parameters/createOrUpdateRemoteIssueLink.mts @@ -0,0 +1,6 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/createOrUpdateRemoteIssueLink.ts b/src/version2/parameters/createOrUpdateRemoteIssueLink.ts deleted file mode 100644 index 9f59c96ca0..0000000000 --- a/src/version2/parameters/createOrUpdateRemoteIssueLink.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RemoteIssueLinkRequest } from '../models'; - -export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/createPermissionGrant.mts b/src/version2/parameters/createPermissionGrant.mts new file mode 100644 index 0000000000..97c105cb64 --- /dev/null +++ b/src/version2/parameters/createPermissionGrant.mts @@ -0,0 +1,16 @@ +import { PermissionGrant } from '../models/index.mjs'; + +export interface CreatePermissionGrant extends PermissionGrant { + /** The ID of the permission scheme in which to create a new permission grant. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user + * who is granted the permission. `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. `field` Returns information about + * the custom field granted the permission. `all` Returns all expandable information. + */ + expand?: string; +} diff --git a/src/version2/parameters/createPermissionGrant.ts b/src/version2/parameters/createPermissionGrant.ts deleted file mode 100644 index 28de066567..0000000000 --- a/src/version2/parameters/createPermissionGrant.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PermissionGrant } from '../models'; - -export interface CreatePermissionGrant extends PermissionGrant { - /** The ID of the permission scheme in which to create a new permission grant. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user - * who is granted the permission. `group` Returns information about the group that is granted the permission. - * `projectRole` Returns information about the project role granted the permission. `field` Returns information about - * the custom field granted the permission. `all` Returns all expandable information. - */ - expand?: string; -} diff --git a/src/version2/parameters/createPermissionScheme.mts b/src/version2/parameters/createPermissionScheme.mts new file mode 100644 index 0000000000..0a1bb35ffd --- /dev/null +++ b/src/version2/parameters/createPermissionScheme.mts @@ -0,0 +1,25 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface CreatePermissionScheme extends Omit { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'permissions' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] + | string + | string[]; +} diff --git a/src/version2/parameters/createPermissionScheme.ts b/src/version2/parameters/createPermissionScheme.ts deleted file mode 100644 index 9ca3850bbb..0000000000 --- a/src/version2/parameters/createPermissionScheme.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { PermissionScheme } from '../models'; - -export interface CreatePermissionScheme extends Omit { - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version2/parameters/createPriority.mts b/src/version2/parameters/createPriority.mts new file mode 100644 index 0000000000..118720599f --- /dev/null +++ b/src/version2/parameters/createPriority.mts @@ -0,0 +1,3 @@ +import { CreatePriorityDetails } from '../models/index.mjs'; + +export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version2/parameters/createPriority.ts b/src/version2/parameters/createPriority.ts deleted file mode 100644 index a1dcef42b9..0000000000 --- a/src/version2/parameters/createPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreatePriorityDetails } from '../models'; - -export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version2/parameters/createProject.mts b/src/version2/parameters/createProject.mts new file mode 100644 index 0000000000..d9a484ab8d --- /dev/null +++ b/src/version2/parameters/createProject.mts @@ -0,0 +1,3 @@ +import { CreateProjectDetails } from '../models/index.mjs'; + +export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version2/parameters/createProject.ts b/src/version2/parameters/createProject.ts deleted file mode 100644 index 05b0812087..0000000000 --- a/src/version2/parameters/createProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateProjectDetails } from '../models'; - -export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version2/parameters/createProjectAvatar.ts b/src/version2/parameters/createProjectAvatar.mts similarity index 100% rename from src/version2/parameters/createProjectAvatar.ts rename to src/version2/parameters/createProjectAvatar.mts diff --git a/src/version2/parameters/createProjectCategory.mts b/src/version2/parameters/createProjectCategory.mts new file mode 100644 index 0000000000..4f9bf350f5 --- /dev/null +++ b/src/version2/parameters/createProjectCategory.mts @@ -0,0 +1,3 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version2/parameters/createProjectCategory.ts b/src/version2/parameters/createProjectCategory.ts deleted file mode 100644 index 5e45b24dbb..0000000000 --- a/src/version2/parameters/createProjectCategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ProjectCategory } from '../models'; - -export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version2/parameters/createProjectRole.mts b/src/version2/parameters/createProjectRole.mts new file mode 100644 index 0000000000..96e800bad6 --- /dev/null +++ b/src/version2/parameters/createProjectRole.mts @@ -0,0 +1,3 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version2/parameters/createProjectRole.ts b/src/version2/parameters/createProjectRole.ts deleted file mode 100644 index 4e4ca4cdcf..0000000000 --- a/src/version2/parameters/createProjectRole.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateUpdateRoleRequest } from '../models'; - -export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version2/parameters/createResolution.mts b/src/version2/parameters/createResolution.mts new file mode 100644 index 0000000000..5027d7a387 --- /dev/null +++ b/src/version2/parameters/createResolution.mts @@ -0,0 +1,5 @@ +import { CreateResolutionDetails } from '../models/index.mjs'; + +export interface CreateResolution extends CreateResolutionDetails { + [key: string]: any; +} diff --git a/src/version2/parameters/createResolution.ts b/src/version2/parameters/createResolution.ts deleted file mode 100644 index 05bb71a11a..0000000000 --- a/src/version2/parameters/createResolution.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CreateResolutionDetails } from '../models'; - -export interface CreateResolution extends CreateResolutionDetails { - [key: string]: any; -} diff --git a/src/version2/parameters/createScreen.mts b/src/version2/parameters/createScreen.mts new file mode 100644 index 0000000000..eb6da4bf28 --- /dev/null +++ b/src/version2/parameters/createScreen.mts @@ -0,0 +1,3 @@ +import { ScreenDetails } from '../models/index.mjs'; + +export interface CreateScreen extends ScreenDetails {} diff --git a/src/version2/parameters/createScreen.ts b/src/version2/parameters/createScreen.ts deleted file mode 100644 index 0e4183a765..0000000000 --- a/src/version2/parameters/createScreen.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ScreenDetails } from '../models'; - -export interface CreateScreen extends ScreenDetails {} diff --git a/src/version2/parameters/createScreenScheme.mts b/src/version2/parameters/createScreenScheme.mts new file mode 100644 index 0000000000..8bf3d2df06 --- /dev/null +++ b/src/version2/parameters/createScreenScheme.mts @@ -0,0 +1,3 @@ +import { ScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version2/parameters/createScreenScheme.ts b/src/version2/parameters/createScreenScheme.ts deleted file mode 100644 index e8c919d3c5..0000000000 --- a/src/version2/parameters/createScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ScreenSchemeDetails } from '../models'; - -export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version2/parameters/createStatuses.mts b/src/version2/parameters/createStatuses.mts new file mode 100644 index 0000000000..062949a399 --- /dev/null +++ b/src/version2/parameters/createStatuses.mts @@ -0,0 +1,3 @@ +import { StatusCreateRequest } from '../models/index.mjs'; + +export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version2/parameters/createStatuses.ts b/src/version2/parameters/createStatuses.ts deleted file mode 100644 index 52880e08ad..0000000000 --- a/src/version2/parameters/createStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StatusCreateRequest } from '../models'; - -export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version2/parameters/createUiModification.mts b/src/version2/parameters/createUiModification.mts new file mode 100644 index 0000000000..410d9e3274 --- /dev/null +++ b/src/version2/parameters/createUiModification.mts @@ -0,0 +1,3 @@ +import { CreateUiModificationDetails } from '../models/index.mjs'; + +export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version2/parameters/createUiModification.ts b/src/version2/parameters/createUiModification.ts deleted file mode 100644 index 25d28d2738..0000000000 --- a/src/version2/parameters/createUiModification.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateUiModificationDetails } from '../models'; - -export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version2/parameters/createUser.mts b/src/version2/parameters/createUser.mts new file mode 100644 index 0000000000..f76f95c893 --- /dev/null +++ b/src/version2/parameters/createUser.mts @@ -0,0 +1,3 @@ +import { NewUserDetails } from '../models/index.mjs'; + +export interface CreateUser extends NewUserDetails {} diff --git a/src/version2/parameters/createUser.ts b/src/version2/parameters/createUser.ts deleted file mode 100644 index 84adf035b6..0000000000 --- a/src/version2/parameters/createUser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { NewUserDetails } from '../models'; - -export interface CreateUser extends NewUserDetails {} diff --git a/src/version2/parameters/createVersion.mts b/src/version2/parameters/createVersion.mts new file mode 100644 index 0000000000..44e2c9cbbf --- /dev/null +++ b/src/version2/parameters/createVersion.mts @@ -0,0 +1,3 @@ +import { Version } from '../models/index.mjs'; + +export interface CreateVersion extends Version {} diff --git a/src/version2/parameters/createVersion.ts b/src/version2/parameters/createVersion.ts deleted file mode 100644 index 2538fd232b..0000000000 --- a/src/version2/parameters/createVersion.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Version } from '../models'; - -export interface CreateVersion extends Version {} diff --git a/src/version2/parameters/createWorkflow.mts b/src/version2/parameters/createWorkflow.mts new file mode 100644 index 0000000000..e1be643967 --- /dev/null +++ b/src/version2/parameters/createWorkflow.mts @@ -0,0 +1,3 @@ +import { CreateWorkflowDetails } from '../models/index.mjs'; + +export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version2/parameters/createWorkflow.ts b/src/version2/parameters/createWorkflow.ts deleted file mode 100644 index dba90b0fc4..0000000000 --- a/src/version2/parameters/createWorkflow.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateWorkflowDetails } from '../models'; - -export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version2/parameters/createWorkflowScheme.mts b/src/version2/parameters/createWorkflowScheme.mts new file mode 100644 index 0000000000..432890465a --- /dev/null +++ b/src/version2/parameters/createWorkflowScheme.mts @@ -0,0 +1,3 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version2/parameters/createWorkflowScheme.ts b/src/version2/parameters/createWorkflowScheme.ts deleted file mode 100644 index c4f4ab9d76..0000000000 --- a/src/version2/parameters/createWorkflowScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowScheme } from '../models'; - -export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version2/parameters/createWorkflowSchemeDraftFromParent.ts b/src/version2/parameters/createWorkflowSchemeDraftFromParent.mts similarity index 100% rename from src/version2/parameters/createWorkflowSchemeDraftFromParent.ts rename to src/version2/parameters/createWorkflowSchemeDraftFromParent.mts diff --git a/src/version2/parameters/createWorkflowTransitionProperty.mts b/src/version2/parameters/createWorkflowTransitionProperty.mts new file mode 100644 index 0000000000..3c700f25f1 --- /dev/null +++ b/src/version2/parameters/createWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version2/parameters/createWorkflowTransitionProperty.ts b/src/version2/parameters/createWorkflowTransitionProperty.ts deleted file mode 100644 index 8aeea6ad06..0000000000 --- a/src/version2/parameters/createWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { WorkflowTransitionProperty } from '../models'; - -export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being added, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/createWorkflows.mts b/src/version2/parameters/createWorkflows.mts new file mode 100644 index 0000000000..70039122fa --- /dev/null +++ b/src/version2/parameters/createWorkflows.mts @@ -0,0 +1,3 @@ +import { WorkflowCreateRequest } from '../models/index.mjs'; + +export interface CreateWorkflows extends WorkflowCreateRequest {} diff --git a/src/version2/parameters/createWorkflows.ts b/src/version2/parameters/createWorkflows.ts deleted file mode 100644 index 945aa45f09..0000000000 --- a/src/version2/parameters/createWorkflows.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowCreateRequest } from '../models'; - -export interface CreateWorkflows extends WorkflowCreateRequest {} diff --git a/src/version2/parameters/deleteActor.ts b/src/version2/parameters/deleteActor.mts similarity index 100% rename from src/version2/parameters/deleteActor.ts rename to src/version2/parameters/deleteActor.mts diff --git a/src/version2/parameters/deleteAddonProperty.ts b/src/version2/parameters/deleteAddonProperty.mts similarity index 100% rename from src/version2/parameters/deleteAddonProperty.ts rename to src/version2/parameters/deleteAddonProperty.mts diff --git a/src/version2/parameters/deleteAndReplaceVersion.mts b/src/version2/parameters/deleteAndReplaceVersion.mts new file mode 100644 index 0000000000..9eac1c0eab --- /dev/null +++ b/src/version2/parameters/deleteAndReplaceVersion.mts @@ -0,0 +1,15 @@ +import { CustomFieldReplacement } from '../models/index.mjs'; + +export interface DeleteAndReplaceVersion { + /** The ID of the version. */ + id: string; + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo?: number; + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo?: number; + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList?: CustomFieldReplacement[]; +} diff --git a/src/version2/parameters/deleteAndReplaceVersion.ts b/src/version2/parameters/deleteAndReplaceVersion.ts deleted file mode 100644 index de88fc521f..0000000000 --- a/src/version2/parameters/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CustomFieldReplacement } from '../models'; - -export interface DeleteAndReplaceVersion { - /** The ID of the version. */ - id: string; - /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ - moveFixIssuesTo?: number; - /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ - moveAffectedIssuesTo?: number; - /** - * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the - * deleted version. - */ - customFieldReplacementList?: CustomFieldReplacement[]; -} diff --git a/src/version2/parameters/deleteAppProperty.ts b/src/version2/parameters/deleteAppProperty.mts similarity index 100% rename from src/version2/parameters/deleteAppProperty.ts rename to src/version2/parameters/deleteAppProperty.mts diff --git a/src/version2/parameters/deleteAvatar.ts b/src/version2/parameters/deleteAvatar.mts similarity index 100% rename from src/version2/parameters/deleteAvatar.ts rename to src/version2/parameters/deleteAvatar.mts diff --git a/src/version2/parameters/deleteComment.ts b/src/version2/parameters/deleteComment.mts similarity index 100% rename from src/version2/parameters/deleteComment.ts rename to src/version2/parameters/deleteComment.mts diff --git a/src/version2/parameters/deleteCommentProperty.ts b/src/version2/parameters/deleteCommentProperty.mts similarity index 100% rename from src/version2/parameters/deleteCommentProperty.ts rename to src/version2/parameters/deleteCommentProperty.mts diff --git a/src/version2/parameters/deleteComponent.ts b/src/version2/parameters/deleteComponent.mts similarity index 100% rename from src/version2/parameters/deleteComponent.ts rename to src/version2/parameters/deleteComponent.mts diff --git a/src/version2/parameters/deleteCustomField.ts b/src/version2/parameters/deleteCustomField.mts similarity index 100% rename from src/version2/parameters/deleteCustomField.ts rename to src/version2/parameters/deleteCustomField.mts diff --git a/src/version2/parameters/deleteCustomFieldContext.ts b/src/version2/parameters/deleteCustomFieldContext.mts similarity index 100% rename from src/version2/parameters/deleteCustomFieldContext.ts rename to src/version2/parameters/deleteCustomFieldContext.mts diff --git a/src/version2/parameters/deleteCustomFieldOption.ts b/src/version2/parameters/deleteCustomFieldOption.mts similarity index 100% rename from src/version2/parameters/deleteCustomFieldOption.ts rename to src/version2/parameters/deleteCustomFieldOption.mts diff --git a/src/version2/parameters/deleteDashboard.ts b/src/version2/parameters/deleteDashboard.mts similarity index 100% rename from src/version2/parameters/deleteDashboard.ts rename to src/version2/parameters/deleteDashboard.mts diff --git a/src/version2/parameters/deleteDashboardItemProperty.ts b/src/version2/parameters/deleteDashboardItemProperty.mts similarity index 100% rename from src/version2/parameters/deleteDashboardItemProperty.ts rename to src/version2/parameters/deleteDashboardItemProperty.mts diff --git a/src/version2/parameters/deleteDefaultWorkflow.ts b/src/version2/parameters/deleteDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/deleteDefaultWorkflow.ts rename to src/version2/parameters/deleteDefaultWorkflow.mts diff --git a/src/version2/parameters/deleteDraftDefaultWorkflow.ts b/src/version2/parameters/deleteDraftDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/deleteDraftDefaultWorkflow.ts rename to src/version2/parameters/deleteDraftDefaultWorkflow.mts diff --git a/src/version2/parameters/deleteDraftWorkflowMapping.ts b/src/version2/parameters/deleteDraftWorkflowMapping.mts similarity index 100% rename from src/version2/parameters/deleteDraftWorkflowMapping.ts rename to src/version2/parameters/deleteDraftWorkflowMapping.mts diff --git a/src/version2/parameters/deleteFavouriteForFilter.ts b/src/version2/parameters/deleteFavouriteForFilter.mts similarity index 100% rename from src/version2/parameters/deleteFavouriteForFilter.ts rename to src/version2/parameters/deleteFavouriteForFilter.mts diff --git a/src/version2/parameters/deleteFieldConfiguration.ts b/src/version2/parameters/deleteFieldConfiguration.mts similarity index 100% rename from src/version2/parameters/deleteFieldConfiguration.ts rename to src/version2/parameters/deleteFieldConfiguration.mts diff --git a/src/version2/parameters/deleteFieldConfigurationScheme.ts b/src/version2/parameters/deleteFieldConfigurationScheme.mts similarity index 100% rename from src/version2/parameters/deleteFieldConfigurationScheme.ts rename to src/version2/parameters/deleteFieldConfigurationScheme.mts diff --git a/src/version2/parameters/deleteFilter.ts b/src/version2/parameters/deleteFilter.mts similarity index 100% rename from src/version2/parameters/deleteFilter.ts rename to src/version2/parameters/deleteFilter.mts diff --git a/src/version2/parameters/deleteInactiveWorkflow.ts b/src/version2/parameters/deleteInactiveWorkflow.mts similarity index 100% rename from src/version2/parameters/deleteInactiveWorkflow.ts rename to src/version2/parameters/deleteInactiveWorkflow.mts diff --git a/src/version2/parameters/deleteIssue.ts b/src/version2/parameters/deleteIssue.mts similarity index 100% rename from src/version2/parameters/deleteIssue.ts rename to src/version2/parameters/deleteIssue.mts diff --git a/src/version2/parameters/deleteIssueFieldOption.ts b/src/version2/parameters/deleteIssueFieldOption.mts similarity index 100% rename from src/version2/parameters/deleteIssueFieldOption.ts rename to src/version2/parameters/deleteIssueFieldOption.mts diff --git a/src/version2/parameters/deleteIssueLink.ts b/src/version2/parameters/deleteIssueLink.mts similarity index 100% rename from src/version2/parameters/deleteIssueLink.ts rename to src/version2/parameters/deleteIssueLink.mts diff --git a/src/version2/parameters/deleteIssueLinkType.ts b/src/version2/parameters/deleteIssueLinkType.mts similarity index 100% rename from src/version2/parameters/deleteIssueLinkType.ts rename to src/version2/parameters/deleteIssueLinkType.mts diff --git a/src/version2/parameters/deleteIssueProperty.ts b/src/version2/parameters/deleteIssueProperty.mts similarity index 100% rename from src/version2/parameters/deleteIssueProperty.ts rename to src/version2/parameters/deleteIssueProperty.mts diff --git a/src/version2/parameters/deleteIssueType.ts b/src/version2/parameters/deleteIssueType.mts similarity index 100% rename from src/version2/parameters/deleteIssueType.ts rename to src/version2/parameters/deleteIssueType.mts diff --git a/src/version2/parameters/deleteIssueTypeProperty.ts b/src/version2/parameters/deleteIssueTypeProperty.mts similarity index 100% rename from src/version2/parameters/deleteIssueTypeProperty.ts rename to src/version2/parameters/deleteIssueTypeProperty.mts diff --git a/src/version2/parameters/deleteIssueTypeScheme.ts b/src/version2/parameters/deleteIssueTypeScheme.mts similarity index 100% rename from src/version2/parameters/deleteIssueTypeScheme.ts rename to src/version2/parameters/deleteIssueTypeScheme.mts diff --git a/src/version2/parameters/deleteIssueTypeScreenScheme.ts b/src/version2/parameters/deleteIssueTypeScreenScheme.mts similarity index 100% rename from src/version2/parameters/deleteIssueTypeScreenScheme.ts rename to src/version2/parameters/deleteIssueTypeScreenScheme.mts diff --git a/src/version2/parameters/deleteNotificationScheme.ts b/src/version2/parameters/deleteNotificationScheme.mts similarity index 100% rename from src/version2/parameters/deleteNotificationScheme.ts rename to src/version2/parameters/deleteNotificationScheme.mts diff --git a/src/version2/parameters/deletePermissionScheme.ts b/src/version2/parameters/deletePermissionScheme.mts similarity index 100% rename from src/version2/parameters/deletePermissionScheme.ts rename to src/version2/parameters/deletePermissionScheme.mts diff --git a/src/version2/parameters/deletePermissionSchemeEntity.ts b/src/version2/parameters/deletePermissionSchemeEntity.mts similarity index 100% rename from src/version2/parameters/deletePermissionSchemeEntity.ts rename to src/version2/parameters/deletePermissionSchemeEntity.mts diff --git a/src/version2/parameters/deleteProject.ts b/src/version2/parameters/deleteProject.mts similarity index 100% rename from src/version2/parameters/deleteProject.ts rename to src/version2/parameters/deleteProject.mts diff --git a/src/version2/parameters/deleteProjectAsynchronously.ts b/src/version2/parameters/deleteProjectAsynchronously.mts similarity index 100% rename from src/version2/parameters/deleteProjectAsynchronously.ts rename to src/version2/parameters/deleteProjectAsynchronously.mts diff --git a/src/version2/parameters/deleteProjectAvatar.ts b/src/version2/parameters/deleteProjectAvatar.mts similarity index 100% rename from src/version2/parameters/deleteProjectAvatar.ts rename to src/version2/parameters/deleteProjectAvatar.mts diff --git a/src/version2/parameters/deleteProjectProperty.ts b/src/version2/parameters/deleteProjectProperty.mts similarity index 100% rename from src/version2/parameters/deleteProjectProperty.ts rename to src/version2/parameters/deleteProjectProperty.mts diff --git a/src/version2/parameters/deleteProjectRole.ts b/src/version2/parameters/deleteProjectRole.mts similarity index 100% rename from src/version2/parameters/deleteProjectRole.ts rename to src/version2/parameters/deleteProjectRole.mts diff --git a/src/version2/parameters/deleteProjectRoleActorsFromRole.ts b/src/version2/parameters/deleteProjectRoleActorsFromRole.mts similarity index 100% rename from src/version2/parameters/deleteProjectRoleActorsFromRole.ts rename to src/version2/parameters/deleteProjectRoleActorsFromRole.mts diff --git a/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts b/src/version2/parameters/deleteRemoteIssueLinkByGlobalId.mts similarity index 100% rename from src/version2/parameters/deleteRemoteIssueLinkByGlobalId.ts rename to src/version2/parameters/deleteRemoteIssueLinkByGlobalId.mts diff --git a/src/version2/parameters/deleteRemoteIssueLinkById.ts b/src/version2/parameters/deleteRemoteIssueLinkById.mts similarity index 100% rename from src/version2/parameters/deleteRemoteIssueLinkById.ts rename to src/version2/parameters/deleteRemoteIssueLinkById.mts diff --git a/src/version2/parameters/deleteResolution.ts b/src/version2/parameters/deleteResolution.mts similarity index 100% rename from src/version2/parameters/deleteResolution.ts rename to src/version2/parameters/deleteResolution.mts diff --git a/src/version2/parameters/deleteScreen.ts b/src/version2/parameters/deleteScreen.mts similarity index 100% rename from src/version2/parameters/deleteScreen.ts rename to src/version2/parameters/deleteScreen.mts diff --git a/src/version2/parameters/deleteScreenScheme.ts b/src/version2/parameters/deleteScreenScheme.mts similarity index 100% rename from src/version2/parameters/deleteScreenScheme.ts rename to src/version2/parameters/deleteScreenScheme.mts diff --git a/src/version2/parameters/deleteScreenTab.ts b/src/version2/parameters/deleteScreenTab.mts similarity index 100% rename from src/version2/parameters/deleteScreenTab.ts rename to src/version2/parameters/deleteScreenTab.mts diff --git a/src/version2/parameters/deleteSecurityScheme.ts b/src/version2/parameters/deleteSecurityScheme.mts similarity index 100% rename from src/version2/parameters/deleteSecurityScheme.ts rename to src/version2/parameters/deleteSecurityScheme.mts diff --git a/src/version2/parameters/deleteSharePermission.ts b/src/version2/parameters/deleteSharePermission.mts similarity index 100% rename from src/version2/parameters/deleteSharePermission.ts rename to src/version2/parameters/deleteSharePermission.mts diff --git a/src/version2/parameters/deleteStatusesById.ts b/src/version2/parameters/deleteStatusesById.mts similarity index 100% rename from src/version2/parameters/deleteStatusesById.ts rename to src/version2/parameters/deleteStatusesById.mts diff --git a/src/version2/parameters/deleteUiModification.ts b/src/version2/parameters/deleteUiModification.mts similarity index 100% rename from src/version2/parameters/deleteUiModification.ts rename to src/version2/parameters/deleteUiModification.mts diff --git a/src/version2/parameters/deleteUserProperty.ts b/src/version2/parameters/deleteUserProperty.mts similarity index 100% rename from src/version2/parameters/deleteUserProperty.ts rename to src/version2/parameters/deleteUserProperty.mts diff --git a/src/version2/parameters/deleteWebhookById.mts b/src/version2/parameters/deleteWebhookById.mts new file mode 100644 index 0000000000..56e014fe88 --- /dev/null +++ b/src/version2/parameters/deleteWebhookById.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/deleteWebhookById.ts b/src/version2/parameters/deleteWebhookById.ts deleted file mode 100644 index ae1f449b4d..0000000000 --- a/src/version2/parameters/deleteWebhookById.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ContainerForWebhookIDs } from '../models'; - -export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/deleteWorkflowMapping.ts b/src/version2/parameters/deleteWorkflowMapping.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowMapping.ts rename to src/version2/parameters/deleteWorkflowMapping.mts diff --git a/src/version2/parameters/deleteWorkflowScheme.ts b/src/version2/parameters/deleteWorkflowScheme.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowScheme.ts rename to src/version2/parameters/deleteWorkflowScheme.mts diff --git a/src/version2/parameters/deleteWorkflowSchemeDraft.ts b/src/version2/parameters/deleteWorkflowSchemeDraft.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowSchemeDraft.ts rename to src/version2/parameters/deleteWorkflowSchemeDraft.mts diff --git a/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/deleteWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowSchemeDraftIssueType.ts rename to src/version2/parameters/deleteWorkflowSchemeDraftIssueType.mts diff --git a/src/version2/parameters/deleteWorkflowSchemeIssueType.ts b/src/version2/parameters/deleteWorkflowSchemeIssueType.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowSchemeIssueType.ts rename to src/version2/parameters/deleteWorkflowSchemeIssueType.mts diff --git a/src/version2/parameters/deleteWorkflowTransitionProperty.ts b/src/version2/parameters/deleteWorkflowTransitionProperty.mts similarity index 100% rename from src/version2/parameters/deleteWorkflowTransitionProperty.ts rename to src/version2/parameters/deleteWorkflowTransitionProperty.mts diff --git a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 0000000000..6981ed6250 --- /dev/null +++ b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import { WorkflowsWithTransitionRulesDetails } from '../models/index.mjs'; + +export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index bd76a37fb8..0000000000 --- a/src/version2/parameters/deleteWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowsWithTransitionRulesDetails } from '../models'; - -export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version2/parameters/deleteWorklog.ts b/src/version2/parameters/deleteWorklog.mts similarity index 100% rename from src/version2/parameters/deleteWorklog.ts rename to src/version2/parameters/deleteWorklog.mts diff --git a/src/version2/parameters/deleteWorklogProperty.ts b/src/version2/parameters/deleteWorklogProperty.mts similarity index 100% rename from src/version2/parameters/deleteWorklogProperty.ts rename to src/version2/parameters/deleteWorklogProperty.mts diff --git a/src/version2/parameters/doTransition.mts b/src/version2/parameters/doTransition.mts new file mode 100644 index 0000000000..4c396774d0 --- /dev/null +++ b/src/version2/parameters/doTransition.mts @@ -0,0 +1,6 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface DoTransition extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/doTransition.ts b/src/version2/parameters/doTransition.ts deleted file mode 100644 index 25c872b5da..0000000000 --- a/src/version2/parameters/doTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueUpdateDetails } from '../models'; - -export interface DoTransition extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/editIssue.mts b/src/version2/parameters/editIssue.mts new file mode 100644 index 0000000000..ef0429137a --- /dev/null +++ b/src/version2/parameters/editIssue.mts @@ -0,0 +1,31 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface EditIssue extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, + * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission + * the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + 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). + */ + returnIssue?: boolean; + /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ + expand?: string; +} diff --git a/src/version2/parameters/editIssue.ts b/src/version2/parameters/editIssue.ts deleted file mode 100644 index 1be9cc59a8..0000000000 --- a/src/version2/parameters/editIssue.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IssueUpdateDetails } from '../models'; - -export interface EditIssue extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Whether a notification email about the issue update is sent to all watchers. To disable the notification, - * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission - * the request is ignored. - */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - 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). - */ - returnIssue?: boolean; - /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ - expand?: string; -} diff --git a/src/version2/parameters/evaluateJiraExpression.mts b/src/version2/parameters/evaluateJiraExpression.mts new file mode 100644 index 0000000000..e79085e366 --- /dev/null +++ b/src/version2/parameters/evaluateJiraExpression.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvalRequest } from '../models/index.mjs'; + +export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { + /** + * 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/evaluateJiraExpression.ts b/src/version2/parameters/evaluateJiraExpression.ts deleted file mode 100644 index 5a41750a2c..0000000000 --- a/src/version2/parameters/evaluateJiraExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JiraExpressionEvalRequest } from '../models'; - -export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { - /** - * 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/expandAttachmentForHumans.ts b/src/version2/parameters/expandAttachmentForHumans.mts similarity index 100% rename from src/version2/parameters/expandAttachmentForHumans.ts rename to src/version2/parameters/expandAttachmentForHumans.mts diff --git a/src/version2/parameters/expandAttachmentForMachines.ts b/src/version2/parameters/expandAttachmentForMachines.mts similarity index 100% rename from src/version2/parameters/expandAttachmentForMachines.ts rename to src/version2/parameters/expandAttachmentForMachines.mts diff --git a/src/version2/parameters/exportArchivedIssues.mts b/src/version2/parameters/exportArchivedIssues.mts new file mode 100644 index 0000000000..819cb43437 --- /dev/null +++ b/src/version2/parameters/exportArchivedIssues.mts @@ -0,0 +1,14 @@ +import { DateRangeFilter } from '../models/index.mjs'; + +/** Details of a filter for exporting archived issues. */ +export interface ExportArchivedIssues { + /** List archived issues archived by a specified account ID. */ + archivedBy?: string[]; + archivedDateRange?: DateRangeFilter; + /** List archived issues with a specified issue type ID. */ + issueTypes?: string[]; + /** List archived issues with a specified project key. */ + projects?: string[]; + /** List archived issues where the reporter is a specified account ID. */ + reporters?: string[]; +} diff --git a/src/version2/parameters/exportArchivedIssues.ts b/src/version2/parameters/exportArchivedIssues.ts deleted file mode 100644 index 62a6f84f44..0000000000 --- a/src/version2/parameters/exportArchivedIssues.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { DateRangeFilter } from '../models'; - -/** Details of a filter for exporting archived issues. */ -export interface ExportArchivedIssues { - /** List archived issues archived by a specified account ID. */ - archivedBy?: string[]; - archivedDateRange?: DateRangeFilter; - /** List archived issues with a specified issue type ID. */ - issueTypes?: string[]; - /** List archived issues with a specified project key. */ - projects?: string[]; - /** List archived issues where the reporter is a specified account ID. */ - reporters?: string[]; -} diff --git a/src/version2/parameters/findAssignableUsers.ts b/src/version2/parameters/findAssignableUsers.mts similarity index 100% rename from src/version2/parameters/findAssignableUsers.ts rename to src/version2/parameters/findAssignableUsers.mts diff --git a/src/version2/parameters/findBulkAssignableUsers.ts b/src/version2/parameters/findBulkAssignableUsers.mts similarity index 100% rename from src/version2/parameters/findBulkAssignableUsers.ts rename to src/version2/parameters/findBulkAssignableUsers.mts diff --git a/src/version2/parameters/findGroups.ts b/src/version2/parameters/findGroups.mts similarity index 100% rename from src/version2/parameters/findGroups.ts rename to src/version2/parameters/findGroups.mts diff --git a/src/version2/parameters/findUserKeysByQuery.ts b/src/version2/parameters/findUserKeysByQuery.mts similarity index 100% rename from src/version2/parameters/findUserKeysByQuery.ts rename to src/version2/parameters/findUserKeysByQuery.mts diff --git a/src/version2/parameters/findUsers.ts b/src/version2/parameters/findUsers.mts similarity index 100% rename from src/version2/parameters/findUsers.ts rename to src/version2/parameters/findUsers.mts diff --git a/src/version2/parameters/findUsersAndGroups.ts b/src/version2/parameters/findUsersAndGroups.mts similarity index 100% rename from src/version2/parameters/findUsersAndGroups.ts rename to src/version2/parameters/findUsersAndGroups.mts diff --git a/src/version2/parameters/findUsersByQuery.ts b/src/version2/parameters/findUsersByQuery.mts similarity index 100% rename from src/version2/parameters/findUsersByQuery.ts rename to src/version2/parameters/findUsersByQuery.mts diff --git a/src/version2/parameters/findUsersForPicker.ts b/src/version2/parameters/findUsersForPicker.mts similarity index 100% rename from src/version2/parameters/findUsersForPicker.ts rename to src/version2/parameters/findUsersForPicker.mts diff --git a/src/version2/parameters/findUsersWithAllPermissions.ts b/src/version2/parameters/findUsersWithAllPermissions.mts similarity index 100% rename from src/version2/parameters/findUsersWithAllPermissions.ts rename to src/version2/parameters/findUsersWithAllPermissions.mts diff --git a/src/version2/parameters/findUsersWithBrowsePermission.ts b/src/version2/parameters/findUsersWithBrowsePermission.mts similarity index 100% rename from src/version2/parameters/findUsersWithBrowsePermission.ts rename to src/version2/parameters/findUsersWithBrowsePermission.mts diff --git a/src/version2/parameters/fullyUpdateProjectRole.mts b/src/version2/parameters/fullyUpdateProjectRole.mts new file mode 100644 index 0000000000..ecf84fea50 --- /dev/null +++ b/src/version2/parameters/fullyUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * 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. + */ + id: number; +} diff --git a/src/version2/parameters/fullyUpdateProjectRole.ts b/src/version2/parameters/fullyUpdateProjectRole.ts deleted file mode 100644 index 12b370b226..0000000000 --- a/src/version2/parameters/fullyUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CreateUpdateRoleRequest } from '../models'; - -export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * 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. - */ - id: number; -} diff --git a/src/version2/parameters/getAccessibleProjectTypeByKey.ts b/src/version2/parameters/getAccessibleProjectTypeByKey.mts similarity index 100% rename from src/version2/parameters/getAccessibleProjectTypeByKey.ts rename to src/version2/parameters/getAccessibleProjectTypeByKey.mts diff --git a/src/version2/parameters/getAddonProperties.ts b/src/version2/parameters/getAddonProperties.mts similarity index 100% rename from src/version2/parameters/getAddonProperties.ts rename to src/version2/parameters/getAddonProperties.mts diff --git a/src/version2/parameters/getAddonProperty.ts b/src/version2/parameters/getAddonProperty.mts similarity index 100% rename from src/version2/parameters/getAddonProperty.ts rename to src/version2/parameters/getAddonProperty.mts diff --git a/src/version2/parameters/getAllDashboards.ts b/src/version2/parameters/getAllDashboards.mts similarity index 100% rename from src/version2/parameters/getAllDashboards.ts rename to src/version2/parameters/getAllDashboards.mts diff --git a/src/version2/parameters/getAllFieldConfigurationSchemes.ts b/src/version2/parameters/getAllFieldConfigurationSchemes.mts similarity index 100% rename from src/version2/parameters/getAllFieldConfigurationSchemes.ts rename to src/version2/parameters/getAllFieldConfigurationSchemes.mts diff --git a/src/version2/parameters/getAllFieldConfigurations.ts b/src/version2/parameters/getAllFieldConfigurations.mts similarity index 100% rename from src/version2/parameters/getAllFieldConfigurations.ts rename to src/version2/parameters/getAllFieldConfigurations.mts diff --git a/src/version2/parameters/getAllGadgets.ts b/src/version2/parameters/getAllGadgets.mts similarity index 100% rename from src/version2/parameters/getAllGadgets.ts rename to src/version2/parameters/getAllGadgets.mts diff --git a/src/version2/parameters/getAllIssueFieldOptions.ts b/src/version2/parameters/getAllIssueFieldOptions.mts similarity index 100% rename from src/version2/parameters/getAllIssueFieldOptions.ts rename to src/version2/parameters/getAllIssueFieldOptions.mts diff --git a/src/version2/parameters/getAllIssueTypeSchemes.ts b/src/version2/parameters/getAllIssueTypeSchemes.mts similarity index 100% rename from src/version2/parameters/getAllIssueTypeSchemes.ts rename to src/version2/parameters/getAllIssueTypeSchemes.mts diff --git a/src/version2/parameters/getAllLabels.ts b/src/version2/parameters/getAllLabels.mts similarity index 100% rename from src/version2/parameters/getAllLabels.ts rename to src/version2/parameters/getAllLabels.mts diff --git a/src/version2/parameters/getAllPermissionSchemes.ts b/src/version2/parameters/getAllPermissionSchemes.mts similarity index 100% rename from src/version2/parameters/getAllPermissionSchemes.ts rename to src/version2/parameters/getAllPermissionSchemes.mts diff --git a/src/version2/parameters/getAllProjectAvatars.ts b/src/version2/parameters/getAllProjectAvatars.mts similarity index 100% rename from src/version2/parameters/getAllProjectAvatars.ts rename to src/version2/parameters/getAllProjectAvatars.mts diff --git a/src/version2/parameters/getAllScreenTabFields.ts b/src/version2/parameters/getAllScreenTabFields.mts similarity index 100% rename from src/version2/parameters/getAllScreenTabFields.ts rename to src/version2/parameters/getAllScreenTabFields.mts diff --git a/src/version2/parameters/getAllScreenTabs.ts b/src/version2/parameters/getAllScreenTabs.mts similarity index 100% rename from src/version2/parameters/getAllScreenTabs.ts rename to src/version2/parameters/getAllScreenTabs.mts diff --git a/src/version2/parameters/getAllStatuses.ts b/src/version2/parameters/getAllStatuses.mts similarity index 100% rename from src/version2/parameters/getAllStatuses.ts rename to src/version2/parameters/getAllStatuses.mts diff --git a/src/version2/parameters/getAllSystemAvatars.ts b/src/version2/parameters/getAllSystemAvatars.mts similarity index 100% rename from src/version2/parameters/getAllSystemAvatars.ts rename to src/version2/parameters/getAllSystemAvatars.mts diff --git a/src/version2/parameters/getAllUsers.ts b/src/version2/parameters/getAllUsers.mts similarity index 100% rename from src/version2/parameters/getAllUsers.ts rename to src/version2/parameters/getAllUsers.mts diff --git a/src/version2/parameters/getAllUsersDefault.ts b/src/version2/parameters/getAllUsersDefault.mts similarity index 100% rename from src/version2/parameters/getAllUsersDefault.ts rename to src/version2/parameters/getAllUsersDefault.mts diff --git a/src/version2/parameters/getAllWorkflowSchemes.ts b/src/version2/parameters/getAllWorkflowSchemes.mts similarity index 100% rename from src/version2/parameters/getAllWorkflowSchemes.ts rename to src/version2/parameters/getAllWorkflowSchemes.mts diff --git a/src/version2/parameters/getAlternativeIssueTypes.ts b/src/version2/parameters/getAlternativeIssueTypes.mts similarity index 100% rename from src/version2/parameters/getAlternativeIssueTypes.ts rename to src/version2/parameters/getAlternativeIssueTypes.mts diff --git a/src/version2/parameters/getApplicationProperty.ts b/src/version2/parameters/getApplicationProperty.mts similarity index 100% rename from src/version2/parameters/getApplicationProperty.ts rename to src/version2/parameters/getApplicationProperty.mts diff --git a/src/version2/parameters/getApplicationRole.ts b/src/version2/parameters/getApplicationRole.mts similarity index 100% rename from src/version2/parameters/getApplicationRole.ts rename to src/version2/parameters/getApplicationRole.mts diff --git a/src/version2/parameters/getAssignedPermissionScheme.ts b/src/version2/parameters/getAssignedPermissionScheme.mts similarity index 100% rename from src/version2/parameters/getAssignedPermissionScheme.ts rename to src/version2/parameters/getAssignedPermissionScheme.mts diff --git a/src/version2/parameters/getAttachment.ts b/src/version2/parameters/getAttachment.mts similarity index 100% rename from src/version2/parameters/getAttachment.ts rename to src/version2/parameters/getAttachment.mts diff --git a/src/version2/parameters/getAttachmentContent.ts b/src/version2/parameters/getAttachmentContent.mts similarity index 100% rename from src/version2/parameters/getAttachmentContent.ts rename to src/version2/parameters/getAttachmentContent.mts diff --git a/src/version2/parameters/getAttachmentThumbnail.ts b/src/version2/parameters/getAttachmentThumbnail.mts similarity index 100% rename from src/version2/parameters/getAttachmentThumbnail.ts rename to src/version2/parameters/getAttachmentThumbnail.mts diff --git a/src/version2/parameters/getAuditRecords.ts b/src/version2/parameters/getAuditRecords.mts similarity index 100% rename from src/version2/parameters/getAuditRecords.ts rename to src/version2/parameters/getAuditRecords.mts diff --git a/src/version2/parameters/getAutoCompletePost.mts b/src/version2/parameters/getAutoCompletePost.mts new file mode 100644 index 0000000000..4128979f52 --- /dev/null +++ b/src/version2/parameters/getAutoCompletePost.mts @@ -0,0 +1,3 @@ +import { SearchAutoComplete } from '../models/index.mjs'; + +export interface GetAutoCompletePost extends SearchAutoComplete {} diff --git a/src/version2/parameters/getAutoCompletePost.ts b/src/version2/parameters/getAutoCompletePost.ts deleted file mode 100644 index c63d67e540..0000000000 --- a/src/version2/parameters/getAutoCompletePost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SearchAutoComplete } from '../models'; - -export interface GetAutoCompletePost extends SearchAutoComplete {} diff --git a/src/version2/parameters/getAvailableScreenFields.ts b/src/version2/parameters/getAvailableScreenFields.mts similarity index 100% rename from src/version2/parameters/getAvailableScreenFields.ts rename to src/version2/parameters/getAvailableScreenFields.mts diff --git a/src/version2/parameters/getAvatarImageByID.ts b/src/version2/parameters/getAvatarImageByID.mts similarity index 100% rename from src/version2/parameters/getAvatarImageByID.ts rename to src/version2/parameters/getAvatarImageByID.mts diff --git a/src/version2/parameters/getAvatarImageByOwner.ts b/src/version2/parameters/getAvatarImageByOwner.mts similarity index 100% rename from src/version2/parameters/getAvatarImageByOwner.ts rename to src/version2/parameters/getAvatarImageByOwner.mts diff --git a/src/version2/parameters/getAvatarImageByType.ts b/src/version2/parameters/getAvatarImageByType.mts similarity index 100% rename from src/version2/parameters/getAvatarImageByType.ts rename to src/version2/parameters/getAvatarImageByType.mts diff --git a/src/version2/parameters/getAvatars.ts b/src/version2/parameters/getAvatars.mts similarity index 100% rename from src/version2/parameters/getAvatars.ts rename to src/version2/parameters/getAvatars.mts diff --git a/src/version2/parameters/getBulkPermissions.mts b/src/version2/parameters/getBulkPermissions.mts new file mode 100644 index 0000000000..e8f2374195 --- /dev/null +++ b/src/version2/parameters/getBulkPermissions.mts @@ -0,0 +1,3 @@ +import { BulkPermissionsRequest } from '../models/index.mjs'; + +export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version2/parameters/getBulkPermissions.ts b/src/version2/parameters/getBulkPermissions.ts deleted file mode 100644 index ea93607d8e..0000000000 --- a/src/version2/parameters/getBulkPermissions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { BulkPermissionsRequest } from '../models'; - -export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version2/parameters/getChangeLogs.ts b/src/version2/parameters/getChangeLogs.mts similarity index 100% rename from src/version2/parameters/getChangeLogs.ts rename to src/version2/parameters/getChangeLogs.mts diff --git a/src/version2/parameters/getChangeLogsByIds.mts b/src/version2/parameters/getChangeLogsByIds.mts new file mode 100644 index 0000000000..873e9d688e --- /dev/null +++ b/src/version2/parameters/getChangeLogsByIds.mts @@ -0,0 +1,6 @@ +import { IssueChangelogIds } from '../models/index.mjs'; + +export interface GetChangeLogsByIds extends IssueChangelogIds { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/getChangeLogsByIds.ts b/src/version2/parameters/getChangeLogsByIds.ts deleted file mode 100644 index 447fc302f6..0000000000 --- a/src/version2/parameters/getChangeLogsByIds.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueChangelogIds } from '../models'; - -export interface GetChangeLogsByIds extends IssueChangelogIds { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/getColumns.ts b/src/version2/parameters/getColumns.mts similarity index 100% rename from src/version2/parameters/getColumns.ts rename to src/version2/parameters/getColumns.mts diff --git a/src/version2/parameters/getComment.ts b/src/version2/parameters/getComment.mts similarity index 100% rename from src/version2/parameters/getComment.ts rename to src/version2/parameters/getComment.mts diff --git a/src/version2/parameters/getCommentProperty.ts b/src/version2/parameters/getCommentProperty.mts similarity index 100% rename from src/version2/parameters/getCommentProperty.ts rename to src/version2/parameters/getCommentProperty.mts diff --git a/src/version2/parameters/getCommentPropertyKeys.ts b/src/version2/parameters/getCommentPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getCommentPropertyKeys.ts rename to src/version2/parameters/getCommentPropertyKeys.mts diff --git a/src/version2/parameters/getComments.ts b/src/version2/parameters/getComments.mts similarity index 100% rename from src/version2/parameters/getComments.ts rename to src/version2/parameters/getComments.mts diff --git a/src/version2/parameters/getCommentsByIds.mts b/src/version2/parameters/getCommentsByIds.mts new file mode 100644 index 0000000000..8fce63f12d --- /dev/null +++ b/src/version2/parameters/getCommentsByIds.mts @@ -0,0 +1,11 @@ +import { IssueCommentListRequest } from '../models/index.mjs'; + +export interface GetCommentsByIds extends IssueCommentListRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `renderedBody` Returns the comment body rendered in HTML. `properties` Returns the comment's properties. + */ + expand?: string; +} diff --git a/src/version2/parameters/getCommentsByIds.ts b/src/version2/parameters/getCommentsByIds.ts deleted file mode 100644 index ac0114f367..0000000000 --- a/src/version2/parameters/getCommentsByIds.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IssueCommentListRequest } from '../models'; - -export interface GetCommentsByIds extends IssueCommentListRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `renderedBody` Returns the comment body rendered in HTML. `properties` Returns the comment's properties. - */ - expand?: string; -} diff --git a/src/version2/parameters/getComponent.ts b/src/version2/parameters/getComponent.mts similarity index 100% rename from src/version2/parameters/getComponent.ts rename to src/version2/parameters/getComponent.mts diff --git a/src/version2/parameters/getComponentRelatedIssues.ts b/src/version2/parameters/getComponentRelatedIssues.mts similarity index 100% rename from src/version2/parameters/getComponentRelatedIssues.ts rename to src/version2/parameters/getComponentRelatedIssues.mts diff --git a/src/version2/parameters/getContextsForField.ts b/src/version2/parameters/getContextsForField.mts similarity index 100% rename from src/version2/parameters/getContextsForField.ts rename to src/version2/parameters/getContextsForField.mts diff --git a/src/version2/parameters/getCreateIssueMeta.ts b/src/version2/parameters/getCreateIssueMeta.mts similarity index 100% rename from src/version2/parameters/getCreateIssueMeta.ts rename to src/version2/parameters/getCreateIssueMeta.mts diff --git a/src/version2/parameters/getCurrentUser.ts b/src/version2/parameters/getCurrentUser.mts similarity index 100% rename from src/version2/parameters/getCurrentUser.ts rename to src/version2/parameters/getCurrentUser.mts diff --git a/src/version2/parameters/getCustomFieldConfiguration.ts b/src/version2/parameters/getCustomFieldConfiguration.mts similarity index 100% rename from src/version2/parameters/getCustomFieldConfiguration.ts rename to src/version2/parameters/getCustomFieldConfiguration.mts diff --git a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts new file mode 100644 index 0000000000..7cd7300856 --- /dev/null +++ b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts @@ -0,0 +1,10 @@ +import { ProjectIssueTypeMappings } from '../models/index.mjs'; + +export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { + /** The ID of the custom field. */ + fieldId: 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/getCustomFieldContextsForProjectsAndIssueTypes.ts b/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts deleted file mode 100644 index 66d6df991e..0000000000 --- a/src/version2/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ProjectIssueTypeMappings } from '../models'; - -export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { - /** The ID of the custom field. */ - fieldId: 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/getCustomFieldOption.ts b/src/version2/parameters/getCustomFieldOption.mts similarity index 100% rename from src/version2/parameters/getCustomFieldOption.ts rename to src/version2/parameters/getCustomFieldOption.mts diff --git a/src/version2/parameters/getDashboard.ts b/src/version2/parameters/getDashboard.mts similarity index 100% rename from src/version2/parameters/getDashboard.ts rename to src/version2/parameters/getDashboard.mts diff --git a/src/version2/parameters/getDashboardItemProperty.ts b/src/version2/parameters/getDashboardItemProperty.mts similarity index 100% rename from src/version2/parameters/getDashboardItemProperty.ts rename to src/version2/parameters/getDashboardItemProperty.mts diff --git a/src/version2/parameters/getDashboardItemPropertyKeys.ts b/src/version2/parameters/getDashboardItemPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getDashboardItemPropertyKeys.ts rename to src/version2/parameters/getDashboardItemPropertyKeys.mts diff --git a/src/version2/parameters/getDashboardsPaginated.ts b/src/version2/parameters/getDashboardsPaginated.mts similarity index 100% rename from src/version2/parameters/getDashboardsPaginated.ts rename to src/version2/parameters/getDashboardsPaginated.mts diff --git a/src/version2/parameters/getDefaultValues.ts b/src/version2/parameters/getDefaultValues.mts similarity index 100% rename from src/version2/parameters/getDefaultValues.ts rename to src/version2/parameters/getDefaultValues.mts diff --git a/src/version2/parameters/getDefaultWorkflow.ts b/src/version2/parameters/getDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/getDefaultWorkflow.ts rename to src/version2/parameters/getDefaultWorkflow.mts diff --git a/src/version2/parameters/getDraftDefaultWorkflow.ts b/src/version2/parameters/getDraftDefaultWorkflow.mts similarity index 100% rename from src/version2/parameters/getDraftDefaultWorkflow.ts rename to src/version2/parameters/getDraftDefaultWorkflow.mts diff --git a/src/version2/parameters/getDraftWorkflow.ts b/src/version2/parameters/getDraftWorkflow.mts similarity index 100% rename from src/version2/parameters/getDraftWorkflow.ts rename to src/version2/parameters/getDraftWorkflow.mts diff --git a/src/version2/parameters/getDynamicWebhooksForApp.ts b/src/version2/parameters/getDynamicWebhooksForApp.mts similarity index 100% rename from src/version2/parameters/getDynamicWebhooksForApp.ts rename to src/version2/parameters/getDynamicWebhooksForApp.mts diff --git a/src/version2/parameters/getEditIssueMeta.ts b/src/version2/parameters/getEditIssueMeta.mts similarity index 100% rename from src/version2/parameters/getEditIssueMeta.ts rename to src/version2/parameters/getEditIssueMeta.mts diff --git a/src/version2/parameters/getFailedWebhooks.ts b/src/version2/parameters/getFailedWebhooks.mts similarity index 100% rename from src/version2/parameters/getFailedWebhooks.ts rename to src/version2/parameters/getFailedWebhooks.mts diff --git a/src/version2/parameters/getFavouriteFilters.ts b/src/version2/parameters/getFavouriteFilters.mts similarity index 100% rename from src/version2/parameters/getFavouriteFilters.ts rename to src/version2/parameters/getFavouriteFilters.mts diff --git a/src/version2/parameters/getFeaturesForProject.ts b/src/version2/parameters/getFeaturesForProject.mts similarity index 100% rename from src/version2/parameters/getFeaturesForProject.ts rename to src/version2/parameters/getFeaturesForProject.mts diff --git a/src/version2/parameters/getFieldAutoCompleteForQueryString.ts b/src/version2/parameters/getFieldAutoCompleteForQueryString.mts similarity index 100% rename from src/version2/parameters/getFieldAutoCompleteForQueryString.ts rename to src/version2/parameters/getFieldAutoCompleteForQueryString.mts diff --git a/src/version2/parameters/getFieldConfigurationItems.ts b/src/version2/parameters/getFieldConfigurationItems.mts similarity index 100% rename from src/version2/parameters/getFieldConfigurationItems.ts rename to src/version2/parameters/getFieldConfigurationItems.mts diff --git a/src/version2/parameters/getFieldConfigurationSchemeMappings.ts b/src/version2/parameters/getFieldConfigurationSchemeMappings.mts similarity index 100% rename from src/version2/parameters/getFieldConfigurationSchemeMappings.ts rename to src/version2/parameters/getFieldConfigurationSchemeMappings.mts diff --git a/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.mts similarity index 100% rename from src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts rename to src/version2/parameters/getFieldConfigurationSchemeProjectMapping.mts diff --git a/src/version2/parameters/getFieldsPaginated.ts b/src/version2/parameters/getFieldsPaginated.mts similarity index 100% rename from src/version2/parameters/getFieldsPaginated.ts rename to src/version2/parameters/getFieldsPaginated.mts diff --git a/src/version2/parameters/getFilter.ts b/src/version2/parameters/getFilter.mts similarity index 100% rename from src/version2/parameters/getFilter.ts rename to src/version2/parameters/getFilter.mts diff --git a/src/version2/parameters/getFiltersPaginated.mts b/src/version2/parameters/getFiltersPaginated.mts new file mode 100644 index 0000000000..65299eb85b --- /dev/null +++ b/src/version2/parameters/getFiltersPaginated.mts @@ -0,0 +1,115 @@ +export interface GetFiltersPaginated { + /** String used to perform a case-insensitive partial match with `name`. */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with + * `owner`. + */ + accountId?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns + * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used + * with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This + * parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to + * display the description field is in use. + * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * - `is_favourite` Sorts by whether the filter is marked as a favorite. + * - `id` Sorts by filter ID. + * - `name` Sorts by filter name. + * - `owner` Sorts by the ID of the filter owner. + * - `is_shared` Sorts by whether the filter is shared. + */ + orderBy?: + | 'description' + | '-description' + | '+description' + | 'favourite_count' + | '-favourite_count' + | '+favourite_count' + | 'id' + | '-id' + | '+id' + | 'is_favourite' + | '-is_favourite' + | '+is_favourite' + | 'name' + | '-name' + | '+name' + | 'owner' + | '-owner' + | '+owner' + | 'is_shared' + | '-is_shared' + | '+is_shared' + | 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; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `description` Returns the description of the filter. + * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * - `jql` Returns the Jql query that the filter uses. + * - `owner` Returns the owner of the filter. + * - `searchUrl` Returns a URL to perform the filter's Jql query. + * - `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. + * - `subscriptions` Returns the users that are subscribed to the filter. + * - `viewUrl` Returns a URL to view the filter. + */ + expand?: + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + | ( + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + )[] + | string + | string[]; + + /** + * 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; +} diff --git a/src/version2/parameters/getFiltersPaginated.ts b/src/version2/parameters/getFiltersPaginated.ts deleted file mode 100644 index 8dbaac430c..0000000000 --- a/src/version2/parameters/getFiltersPaginated.ts +++ /dev/null @@ -1,115 +0,0 @@ -export interface GetFiltersPaginated { - /** String used to perform a case-insensitive partial match with `name`. */ - filterName?: string; - /** - * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with - * `owner`. - */ - accountId?: string; - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns - * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used - * with the `groupId` parameter. - */ - groupname?: string; - /** - * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This - * parameter cannot be used with the `groupname` parameter. - */ - groupId?: string; - /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ - projectId?: number; - /** - * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. Do not exceed 200 filter IDs. - */ - id?: number[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: - * - * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to - * display the description field is in use. - * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. - * - `is_favourite` Sorts by whether the filter is marked as a favorite. - * - `id` Sorts by filter ID. - * - `name` Sorts by filter name. - * - `owner` Sorts by the ID of the filter owner. - * - `is_shared` Sorts by whether the filter is shared. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'favourite_count' - | '-favourite_count' - | '+favourite_count' - | 'id' - | '-id' - | '+id' - | 'is_favourite' - | '-is_favourite' - | '+is_favourite' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 'is_shared' - | '-is_shared' - | '+is_shared' - | 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; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `description` Returns the description of the filter. - * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. - * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. - * - `jql` Returns the JQL query that the filter uses. - * - `owner` Returns the owner of the filter. - * - `searchUrl` Returns a URL to perform the filter's JQL query. - * - `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. - * - `subscriptions` Returns the users that are subscribed to the filter. - * - `viewUrl` Returns a URL to view the filter. - */ - expand?: - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - | ( - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - )[] - | string - | string[]; - - /** - * 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; -} diff --git a/src/version2/parameters/getHierarchy.ts b/src/version2/parameters/getHierarchy.mts similarity index 100% rename from src/version2/parameters/getHierarchy.ts rename to src/version2/parameters/getHierarchy.mts diff --git a/src/version2/parameters/getIdsOfWorklogsDeletedSince.ts b/src/version2/parameters/getIdsOfWorklogsDeletedSince.mts similarity index 100% rename from src/version2/parameters/getIdsOfWorklogsDeletedSince.ts rename to src/version2/parameters/getIdsOfWorklogsDeletedSince.mts diff --git a/src/version2/parameters/getIdsOfWorklogsModifiedSince.ts b/src/version2/parameters/getIdsOfWorklogsModifiedSince.mts similarity index 100% rename from src/version2/parameters/getIdsOfWorklogsModifiedSince.ts rename to src/version2/parameters/getIdsOfWorklogsModifiedSince.mts diff --git a/src/version2/parameters/getIsWatchingIssueBulk.mts b/src/version2/parameters/getIsWatchingIssueBulk.mts new file mode 100644 index 0000000000..3616bfd382 --- /dev/null +++ b/src/version2/parameters/getIsWatchingIssueBulk.mts @@ -0,0 +1,3 @@ +import { IssueList } from '../models/index.mjs'; + +export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version2/parameters/getIsWatchingIssueBulk.ts b/src/version2/parameters/getIsWatchingIssueBulk.ts deleted file mode 100644 index dfa25fdf72..0000000000 --- a/src/version2/parameters/getIsWatchingIssueBulk.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueList } from '../models'; - -export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version2/parameters/getIssue.mts b/src/version2/parameters/getIssue.mts new file mode 100644 index 0000000000..2d598a493b --- /dev/null +++ b/src/version2/parameters/getIssue.mts @@ -0,0 +1,70 @@ +export interface GetIssue { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a + * subset of fields. Allowed values: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except + * description. `*navigable,-comment` Returns all navigable fields except comment. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + * + * Note: All fields are returned by default. This differs from [Search for issues using Jql + * (GET)](#api-rest-api-2-search-get) and [Search for issues using Jql (POST)](#api-rest-api-2-search-post) where the + * default is all navigable fields. + */ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been + * added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about the 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. + * - `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` Returns a JSON array for each version of a field's value, with the highest number + * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. + */ + expand?: + | 'renderedFields' + | 'names' + | 'transitions' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ('renderedFields' | 'names' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] + | string + | string[]; + /** + * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + * + * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. + * + * Examples: + * + * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` + * and `prop2` properties. + * + * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. + */ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. This also populates the [Jql issues search](#api-rest-api-2-search-get) `lastViewed` + * field. + */ + updateHistory?: boolean; +} diff --git a/src/version2/parameters/getIssue.ts b/src/version2/parameters/getIssue.ts deleted file mode 100644 index 683b429396..0000000000 --- a/src/version2/parameters/getIssue.ts +++ /dev/null @@ -1,70 +0,0 @@ -export interface GetIssue { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a - * subset of fields. Allowed values: - * - * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to - * exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except - * description. `*navigable,-comment` Returns all navigable fields except comment. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. - * - * Note: All fields are returned by default. This differs from [Search for issues using JQL - * (GET)](#api-rest-api-2-search-get) and [Search for issues using JQL (POST)](#api-rest-api-2-search-post) where the - * default is all navigable fields. - */ - fields?: string[]; - /** - * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been - * added by a connect app and a field's key may differ from its ID. - */ - fieldsByKeys?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about the 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. - * - `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` Returns a JSON array for each version of a field's value, with the highest number - * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. - */ - expand?: - | 'renderedFields' - | 'names' - | 'transitions' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ('renderedFields' | 'names' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] - | string - | string[]; - /** - * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: - * - * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. - * - * Examples: - * - * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` - * and `prop2` properties. - * - * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. - */ - properties?: string[]; - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-2-search-get) `lastViewed` - * field. - */ - updateHistory?: boolean; -} diff --git a/src/version2/parameters/getIssueFieldOption.ts b/src/version2/parameters/getIssueFieldOption.mts similarity index 100% rename from src/version2/parameters/getIssueFieldOption.ts rename to src/version2/parameters/getIssueFieldOption.mts diff --git a/src/version2/parameters/getIssueLink.ts b/src/version2/parameters/getIssueLink.mts similarity index 100% rename from src/version2/parameters/getIssueLink.ts rename to src/version2/parameters/getIssueLink.mts diff --git a/src/version2/parameters/getIssueLinkType.ts b/src/version2/parameters/getIssueLinkType.mts similarity index 100% rename from src/version2/parameters/getIssueLinkType.ts rename to src/version2/parameters/getIssueLinkType.mts diff --git a/src/version2/parameters/getIssuePickerResource.mts b/src/version2/parameters/getIssuePickerResource.mts new file mode 100644 index 0000000000..aed2154c1f --- /dev/null +++ b/src/version2/parameters/getIssuePickerResource.mts @@ -0,0 +1,23 @@ +export interface GetIssuePickerResource { + /** A string to match against text fields in the issue such as title, description, or comments. */ + query?: string; + /** + * A Jql query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be + * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform + * this query. + */ + currentIssueKey?: string; + /** The ID of a project that suggested issues must belong to. */ + currentProjectId?: string; + /** Indicate whether to include subtasks in the suggestions list. */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the + * query. + */ + showSubTaskParent?: boolean; +} diff --git a/src/version2/parameters/getIssuePickerResource.ts b/src/version2/parameters/getIssuePickerResource.ts deleted file mode 100644 index 762048d325..0000000000 --- a/src/version2/parameters/getIssuePickerResource.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetIssuePickerResource { - /** A string to match against text fields in the issue such as title, description, or comments. */ - query?: string; - /** - * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be - * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. - */ - currentJQL?: string; - /** - * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform - * this query. - */ - currentIssueKey?: string; - /** The ID of a project that suggested issues must belong to. */ - currentProjectId?: string; - /** Indicate whether to include subtasks in the suggestions list. */ - showSubTasks?: boolean; - /** - * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the - * query. - */ - showSubTaskParent?: boolean; -} diff --git a/src/version2/parameters/getIssueProperty.ts b/src/version2/parameters/getIssueProperty.mts similarity index 100% rename from src/version2/parameters/getIssueProperty.ts rename to src/version2/parameters/getIssueProperty.mts diff --git a/src/version2/parameters/getIssuePropertyKeys.ts b/src/version2/parameters/getIssuePropertyKeys.mts similarity index 100% rename from src/version2/parameters/getIssuePropertyKeys.ts rename to src/version2/parameters/getIssuePropertyKeys.mts diff --git a/src/version2/parameters/getIssueSecurityLevel.ts b/src/version2/parameters/getIssueSecurityLevel.mts similarity index 100% rename from src/version2/parameters/getIssueSecurityLevel.ts rename to src/version2/parameters/getIssueSecurityLevel.mts diff --git a/src/version2/parameters/getIssueSecurityLevelMembers.ts b/src/version2/parameters/getIssueSecurityLevelMembers.mts similarity index 100% rename from src/version2/parameters/getIssueSecurityLevelMembers.ts rename to src/version2/parameters/getIssueSecurityLevelMembers.mts diff --git a/src/version2/parameters/getIssueSecurityScheme.ts b/src/version2/parameters/getIssueSecurityScheme.mts similarity index 100% rename from src/version2/parameters/getIssueSecurityScheme.ts rename to src/version2/parameters/getIssueSecurityScheme.mts diff --git a/src/version2/parameters/getIssueType.ts b/src/version2/parameters/getIssueType.mts similarity index 100% rename from src/version2/parameters/getIssueType.ts rename to src/version2/parameters/getIssueType.mts diff --git a/src/version2/parameters/getIssueTypeMappingsForContexts.ts b/src/version2/parameters/getIssueTypeMappingsForContexts.mts similarity index 100% rename from src/version2/parameters/getIssueTypeMappingsForContexts.ts rename to src/version2/parameters/getIssueTypeMappingsForContexts.mts diff --git a/src/version2/parameters/getIssueTypeProperty.ts b/src/version2/parameters/getIssueTypeProperty.mts similarity index 100% rename from src/version2/parameters/getIssueTypeProperty.ts rename to src/version2/parameters/getIssueTypeProperty.mts diff --git a/src/version2/parameters/getIssueTypePropertyKeys.ts b/src/version2/parameters/getIssueTypePropertyKeys.mts similarity index 100% rename from src/version2/parameters/getIssueTypePropertyKeys.ts rename to src/version2/parameters/getIssueTypePropertyKeys.mts diff --git a/src/version2/parameters/getIssueTypeSchemeForProjects.ts b/src/version2/parameters/getIssueTypeSchemeForProjects.mts similarity index 100% rename from src/version2/parameters/getIssueTypeSchemeForProjects.ts rename to src/version2/parameters/getIssueTypeSchemeForProjects.mts diff --git a/src/version2/parameters/getIssueTypeSchemesMapping.ts b/src/version2/parameters/getIssueTypeSchemesMapping.mts similarity index 100% rename from src/version2/parameters/getIssueTypeSchemesMapping.ts rename to src/version2/parameters/getIssueTypeSchemesMapping.mts diff --git a/src/version2/parameters/getIssueTypeScreenSchemeMappings.ts b/src/version2/parameters/getIssueTypeScreenSchemeMappings.mts similarity index 100% rename from src/version2/parameters/getIssueTypeScreenSchemeMappings.ts rename to src/version2/parameters/getIssueTypeScreenSchemeMappings.mts diff --git a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.mts similarity index 100% rename from src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts rename to src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.mts diff --git a/src/version2/parameters/getIssueTypeScreenSchemes.ts b/src/version2/parameters/getIssueTypeScreenSchemes.mts similarity index 100% rename from src/version2/parameters/getIssueTypeScreenSchemes.ts rename to src/version2/parameters/getIssueTypeScreenSchemes.mts diff --git a/src/version2/parameters/getIssueTypesForProject.ts b/src/version2/parameters/getIssueTypesForProject.mts similarity index 100% rename from src/version2/parameters/getIssueTypesForProject.ts rename to src/version2/parameters/getIssueTypesForProject.mts diff --git a/src/version2/parameters/getIssueWatchers.ts b/src/version2/parameters/getIssueWatchers.mts similarity index 100% rename from src/version2/parameters/getIssueWatchers.ts rename to src/version2/parameters/getIssueWatchers.mts diff --git a/src/version2/parameters/getIssueWorklog.ts b/src/version2/parameters/getIssueWorklog.mts similarity index 100% rename from src/version2/parameters/getIssueWorklog.ts rename to src/version2/parameters/getIssueWorklog.mts diff --git a/src/version2/parameters/getMyFilters.ts b/src/version2/parameters/getMyFilters.mts similarity index 100% rename from src/version2/parameters/getMyFilters.ts rename to src/version2/parameters/getMyFilters.mts diff --git a/src/version2/parameters/getMyPermissions.ts b/src/version2/parameters/getMyPermissions.mts similarity index 100% rename from src/version2/parameters/getMyPermissions.ts rename to src/version2/parameters/getMyPermissions.mts diff --git a/src/version2/parameters/getNotificationScheme.ts b/src/version2/parameters/getNotificationScheme.mts similarity index 100% rename from src/version2/parameters/getNotificationScheme.ts rename to src/version2/parameters/getNotificationScheme.mts diff --git a/src/version2/parameters/getNotificationSchemeForProject.ts b/src/version2/parameters/getNotificationSchemeForProject.mts similarity index 100% rename from src/version2/parameters/getNotificationSchemeForProject.ts rename to src/version2/parameters/getNotificationSchemeForProject.mts diff --git a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts b/src/version2/parameters/getNotificationSchemeToProjectMappings.mts similarity index 100% rename from src/version2/parameters/getNotificationSchemeToProjectMappings.ts rename to src/version2/parameters/getNotificationSchemeToProjectMappings.mts diff --git a/src/version2/parameters/getNotificationSchemes.ts b/src/version2/parameters/getNotificationSchemes.mts similarity index 100% rename from src/version2/parameters/getNotificationSchemes.ts rename to src/version2/parameters/getNotificationSchemes.mts diff --git a/src/version2/parameters/getOptionsForContext.ts b/src/version2/parameters/getOptionsForContext.mts similarity index 100% rename from src/version2/parameters/getOptionsForContext.ts rename to src/version2/parameters/getOptionsForContext.mts diff --git a/src/version2/parameters/getPermissionScheme.ts b/src/version2/parameters/getPermissionScheme.mts similarity index 100% rename from src/version2/parameters/getPermissionScheme.ts rename to src/version2/parameters/getPermissionScheme.mts diff --git a/src/version2/parameters/getPermissionSchemeGrant.ts b/src/version2/parameters/getPermissionSchemeGrant.mts similarity index 100% rename from src/version2/parameters/getPermissionSchemeGrant.ts rename to src/version2/parameters/getPermissionSchemeGrant.mts diff --git a/src/version2/parameters/getPermissionSchemeGrants.ts b/src/version2/parameters/getPermissionSchemeGrants.mts similarity index 100% rename from src/version2/parameters/getPermissionSchemeGrants.ts rename to src/version2/parameters/getPermissionSchemeGrants.mts diff --git a/src/version2/parameters/getPermittedProjects.mts b/src/version2/parameters/getPermittedProjects.mts new file mode 100644 index 0000000000..8f40964759 --- /dev/null +++ b/src/version2/parameters/getPermittedProjects.mts @@ -0,0 +1,3 @@ +import { PermissionsKeys } from '../models/index.mjs'; + +export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version2/parameters/getPermittedProjects.ts b/src/version2/parameters/getPermittedProjects.ts deleted file mode 100644 index 828831afb8..0000000000 --- a/src/version2/parameters/getPermittedProjects.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { PermissionsKeys } from '../models'; - -export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version2/parameters/getPrecomputations.ts b/src/version2/parameters/getPrecomputations.mts similarity index 100% rename from src/version2/parameters/getPrecomputations.ts rename to src/version2/parameters/getPrecomputations.mts diff --git a/src/version2/parameters/getPreference.ts b/src/version2/parameters/getPreference.mts similarity index 100% rename from src/version2/parameters/getPreference.ts rename to src/version2/parameters/getPreference.mts diff --git a/src/version2/parameters/getPriority.ts b/src/version2/parameters/getPriority.mts similarity index 100% rename from src/version2/parameters/getPriority.ts rename to src/version2/parameters/getPriority.mts diff --git a/src/version2/parameters/getProject.ts b/src/version2/parameters/getProject.mts similarity index 100% rename from src/version2/parameters/getProject.ts rename to src/version2/parameters/getProject.mts diff --git a/src/version2/parameters/getProjectCategoryById.ts b/src/version2/parameters/getProjectCategoryById.mts similarity index 100% rename from src/version2/parameters/getProjectCategoryById.ts rename to src/version2/parameters/getProjectCategoryById.mts diff --git a/src/version2/parameters/getProjectComponents.ts b/src/version2/parameters/getProjectComponents.mts similarity index 100% rename from src/version2/parameters/getProjectComponents.ts rename to src/version2/parameters/getProjectComponents.mts diff --git a/src/version2/parameters/getProjectComponentsPaginated.ts b/src/version2/parameters/getProjectComponentsPaginated.mts similarity index 100% rename from src/version2/parameters/getProjectComponentsPaginated.ts rename to src/version2/parameters/getProjectComponentsPaginated.mts diff --git a/src/version2/parameters/getProjectContextMapping.ts b/src/version2/parameters/getProjectContextMapping.mts similarity index 100% rename from src/version2/parameters/getProjectContextMapping.ts rename to src/version2/parameters/getProjectContextMapping.mts diff --git a/src/version2/parameters/getProjectEmail.ts b/src/version2/parameters/getProjectEmail.mts similarity index 100% rename from src/version2/parameters/getProjectEmail.ts rename to src/version2/parameters/getProjectEmail.mts diff --git a/src/version2/parameters/getProjectIssueSecurityScheme.ts b/src/version2/parameters/getProjectIssueSecurityScheme.mts similarity index 100% rename from src/version2/parameters/getProjectIssueSecurityScheme.ts rename to src/version2/parameters/getProjectIssueSecurityScheme.mts diff --git a/src/version2/parameters/getProjectProperty.ts b/src/version2/parameters/getProjectProperty.mts similarity index 100% rename from src/version2/parameters/getProjectProperty.ts rename to src/version2/parameters/getProjectProperty.mts diff --git a/src/version2/parameters/getProjectPropertyKeys.ts b/src/version2/parameters/getProjectPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getProjectPropertyKeys.ts rename to src/version2/parameters/getProjectPropertyKeys.mts diff --git a/src/version2/parameters/getProjectRole.ts b/src/version2/parameters/getProjectRole.mts similarity index 100% rename from src/version2/parameters/getProjectRole.ts rename to src/version2/parameters/getProjectRole.mts diff --git a/src/version2/parameters/getProjectRoleActorsForRole.ts b/src/version2/parameters/getProjectRoleActorsForRole.mts similarity index 100% rename from src/version2/parameters/getProjectRoleActorsForRole.ts rename to src/version2/parameters/getProjectRoleActorsForRole.mts diff --git a/src/version2/parameters/getProjectRoleById.ts b/src/version2/parameters/getProjectRoleById.mts similarity index 100% rename from src/version2/parameters/getProjectRoleById.ts rename to src/version2/parameters/getProjectRoleById.mts diff --git a/src/version2/parameters/getProjectRoleDetails.ts b/src/version2/parameters/getProjectRoleDetails.mts similarity index 100% rename from src/version2/parameters/getProjectRoleDetails.ts rename to src/version2/parameters/getProjectRoleDetails.mts diff --git a/src/version2/parameters/getProjectRoles.ts b/src/version2/parameters/getProjectRoles.mts similarity index 100% rename from src/version2/parameters/getProjectRoles.ts rename to src/version2/parameters/getProjectRoles.mts diff --git a/src/version2/parameters/getProjectTypeByKey.ts b/src/version2/parameters/getProjectTypeByKey.mts similarity index 100% rename from src/version2/parameters/getProjectTypeByKey.ts rename to src/version2/parameters/getProjectTypeByKey.mts diff --git a/src/version2/parameters/getProjectVersions.ts b/src/version2/parameters/getProjectVersions.mts similarity index 100% rename from src/version2/parameters/getProjectVersions.ts rename to src/version2/parameters/getProjectVersions.mts diff --git a/src/version2/parameters/getProjectVersionsPaginated.ts b/src/version2/parameters/getProjectVersionsPaginated.mts similarity index 100% rename from src/version2/parameters/getProjectVersionsPaginated.ts rename to src/version2/parameters/getProjectVersionsPaginated.mts diff --git a/src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts b/src/version2/parameters/getProjectsForIssueTypeScreenScheme.mts similarity index 100% rename from src/version2/parameters/getProjectsForIssueTypeScreenScheme.ts rename to src/version2/parameters/getProjectsForIssueTypeScreenScheme.mts diff --git a/src/version2/parameters/getRecent.ts b/src/version2/parameters/getRecent.mts similarity index 100% rename from src/version2/parameters/getRecent.ts rename to src/version2/parameters/getRecent.mts diff --git a/src/version2/parameters/getRemoteIssueLinkById.ts b/src/version2/parameters/getRemoteIssueLinkById.mts similarity index 100% rename from src/version2/parameters/getRemoteIssueLinkById.ts rename to src/version2/parameters/getRemoteIssueLinkById.mts diff --git a/src/version2/parameters/getRemoteIssueLinks.ts b/src/version2/parameters/getRemoteIssueLinks.mts similarity index 100% rename from src/version2/parameters/getRemoteIssueLinks.ts rename to src/version2/parameters/getRemoteIssueLinks.mts diff --git a/src/version2/parameters/getScreenSchemes.ts b/src/version2/parameters/getScreenSchemes.mts similarity index 100% rename from src/version2/parameters/getScreenSchemes.ts rename to src/version2/parameters/getScreenSchemes.mts diff --git a/src/version2/parameters/getScreens.ts b/src/version2/parameters/getScreens.mts similarity index 100% rename from src/version2/parameters/getScreens.ts rename to src/version2/parameters/getScreens.mts diff --git a/src/version2/parameters/getScreensForField.ts b/src/version2/parameters/getScreensForField.mts similarity index 100% rename from src/version2/parameters/getScreensForField.ts rename to src/version2/parameters/getScreensForField.mts diff --git a/src/version2/parameters/getSecurityLevelMembers.ts b/src/version2/parameters/getSecurityLevelMembers.mts similarity index 100% rename from src/version2/parameters/getSecurityLevelMembers.ts rename to src/version2/parameters/getSecurityLevelMembers.mts diff --git a/src/version2/parameters/getSecurityLevels.ts b/src/version2/parameters/getSecurityLevels.mts similarity index 100% rename from src/version2/parameters/getSecurityLevels.ts rename to src/version2/parameters/getSecurityLevels.mts diff --git a/src/version2/parameters/getSecurityLevelsForProject.ts b/src/version2/parameters/getSecurityLevelsForProject.mts similarity index 100% rename from src/version2/parameters/getSecurityLevelsForProject.ts rename to src/version2/parameters/getSecurityLevelsForProject.mts diff --git a/src/version2/parameters/getSelectableIssueFieldOptions.ts b/src/version2/parameters/getSelectableIssueFieldOptions.mts similarity index 100% rename from src/version2/parameters/getSelectableIssueFieldOptions.ts rename to src/version2/parameters/getSelectableIssueFieldOptions.mts diff --git a/src/version2/parameters/getSharePermission.ts b/src/version2/parameters/getSharePermission.mts similarity index 100% rename from src/version2/parameters/getSharePermission.ts rename to src/version2/parameters/getSharePermission.mts diff --git a/src/version2/parameters/getSharePermissions.ts b/src/version2/parameters/getSharePermissions.mts similarity index 100% rename from src/version2/parameters/getSharePermissions.ts rename to src/version2/parameters/getSharePermissions.mts diff --git a/src/version2/parameters/getStatus.ts b/src/version2/parameters/getStatus.mts similarity index 100% rename from src/version2/parameters/getStatus.ts rename to src/version2/parameters/getStatus.mts diff --git a/src/version2/parameters/getStatusCategory.ts b/src/version2/parameters/getStatusCategory.mts similarity index 100% rename from src/version2/parameters/getStatusCategory.ts rename to src/version2/parameters/getStatusCategory.mts diff --git a/src/version2/parameters/getStatusesById.ts b/src/version2/parameters/getStatusesById.mts similarity index 100% rename from src/version2/parameters/getStatusesById.ts rename to src/version2/parameters/getStatusesById.mts diff --git a/src/version2/parameters/getTask.ts b/src/version2/parameters/getTask.mts similarity index 100% rename from src/version2/parameters/getTask.ts rename to src/version2/parameters/getTask.mts diff --git a/src/version2/parameters/getTransitions.ts b/src/version2/parameters/getTransitions.mts similarity index 100% rename from src/version2/parameters/getTransitions.ts rename to src/version2/parameters/getTransitions.mts diff --git a/src/version2/parameters/getTrashedFieldsPaginated.ts b/src/version2/parameters/getTrashedFieldsPaginated.mts similarity index 100% rename from src/version2/parameters/getTrashedFieldsPaginated.ts rename to src/version2/parameters/getTrashedFieldsPaginated.mts diff --git a/src/version2/parameters/getUiModifications.ts b/src/version2/parameters/getUiModifications.mts similarity index 100% rename from src/version2/parameters/getUiModifications.ts rename to src/version2/parameters/getUiModifications.mts diff --git a/src/version2/parameters/getUser.ts b/src/version2/parameters/getUser.mts similarity index 100% rename from src/version2/parameters/getUser.ts rename to src/version2/parameters/getUser.mts diff --git a/src/version2/parameters/getUserDefaultColumns.ts b/src/version2/parameters/getUserDefaultColumns.mts similarity index 100% rename from src/version2/parameters/getUserDefaultColumns.ts rename to src/version2/parameters/getUserDefaultColumns.mts diff --git a/src/version2/parameters/getUserEmail.ts b/src/version2/parameters/getUserEmail.mts similarity index 100% rename from src/version2/parameters/getUserEmail.ts rename to src/version2/parameters/getUserEmail.mts diff --git a/src/version2/parameters/getUserEmailBulk.ts b/src/version2/parameters/getUserEmailBulk.mts similarity index 100% rename from src/version2/parameters/getUserEmailBulk.ts rename to src/version2/parameters/getUserEmailBulk.mts diff --git a/src/version2/parameters/getUserGroups.ts b/src/version2/parameters/getUserGroups.mts similarity index 100% rename from src/version2/parameters/getUserGroups.ts rename to src/version2/parameters/getUserGroups.mts diff --git a/src/version2/parameters/getUserProperty.ts b/src/version2/parameters/getUserProperty.mts similarity index 100% rename from src/version2/parameters/getUserProperty.ts rename to src/version2/parameters/getUserProperty.mts diff --git a/src/version2/parameters/getUserPropertyKeys.ts b/src/version2/parameters/getUserPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getUserPropertyKeys.ts rename to src/version2/parameters/getUserPropertyKeys.mts diff --git a/src/version2/parameters/getUsersFromGroup.ts b/src/version2/parameters/getUsersFromGroup.mts similarity index 100% rename from src/version2/parameters/getUsersFromGroup.ts rename to src/version2/parameters/getUsersFromGroup.mts diff --git a/src/version2/parameters/getValidProjectKey.ts b/src/version2/parameters/getValidProjectKey.mts similarity index 100% rename from src/version2/parameters/getValidProjectKey.ts rename to src/version2/parameters/getValidProjectKey.mts diff --git a/src/version2/parameters/getValidProjectName.ts b/src/version2/parameters/getValidProjectName.mts similarity index 100% rename from src/version2/parameters/getValidProjectName.ts rename to src/version2/parameters/getValidProjectName.mts diff --git a/src/version2/parameters/getVersion.ts b/src/version2/parameters/getVersion.mts similarity index 100% rename from src/version2/parameters/getVersion.ts rename to src/version2/parameters/getVersion.mts diff --git a/src/version2/parameters/getVersionRelatedIssues.ts b/src/version2/parameters/getVersionRelatedIssues.mts similarity index 100% rename from src/version2/parameters/getVersionRelatedIssues.ts rename to src/version2/parameters/getVersionRelatedIssues.mts diff --git a/src/version2/parameters/getVersionUnresolvedIssues.ts b/src/version2/parameters/getVersionUnresolvedIssues.mts similarity index 100% rename from src/version2/parameters/getVersionUnresolvedIssues.ts rename to src/version2/parameters/getVersionUnresolvedIssues.mts diff --git a/src/version2/parameters/getVisibleIssueFieldOptions.ts b/src/version2/parameters/getVisibleIssueFieldOptions.mts similarity index 100% rename from src/version2/parameters/getVisibleIssueFieldOptions.ts rename to src/version2/parameters/getVisibleIssueFieldOptions.mts diff --git a/src/version2/parameters/getVotes.ts b/src/version2/parameters/getVotes.mts similarity index 100% rename from src/version2/parameters/getVotes.ts rename to src/version2/parameters/getVotes.mts diff --git a/src/version2/parameters/getWorkflow.ts b/src/version2/parameters/getWorkflow.mts similarity index 100% rename from src/version2/parameters/getWorkflow.ts rename to src/version2/parameters/getWorkflow.mts diff --git a/src/version2/parameters/getWorkflowScheme.ts b/src/version2/parameters/getWorkflowScheme.mts similarity index 100% rename from src/version2/parameters/getWorkflowScheme.ts rename to src/version2/parameters/getWorkflowScheme.mts diff --git a/src/version2/parameters/getWorkflowSchemeDraft.ts b/src/version2/parameters/getWorkflowSchemeDraft.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeDraft.ts rename to src/version2/parameters/getWorkflowSchemeDraft.mts diff --git a/src/version2/parameters/getWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/getWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeDraftIssueType.ts rename to src/version2/parameters/getWorkflowSchemeDraftIssueType.mts diff --git a/src/version2/parameters/getWorkflowSchemeIssueType.ts b/src/version2/parameters/getWorkflowSchemeIssueType.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeIssueType.ts rename to src/version2/parameters/getWorkflowSchemeIssueType.mts diff --git a/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version2/parameters/getWorkflowSchemeProjectAssociations.mts similarity index 100% rename from src/version2/parameters/getWorkflowSchemeProjectAssociations.ts rename to src/version2/parameters/getWorkflowSchemeProjectAssociations.mts diff --git a/src/version2/parameters/getWorkflowTransitionProperties.ts b/src/version2/parameters/getWorkflowTransitionProperties.mts similarity index 100% rename from src/version2/parameters/getWorkflowTransitionProperties.ts rename to src/version2/parameters/getWorkflowTransitionProperties.mts diff --git a/src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/getWorkflowTransitionRuleConfigurations.mts similarity index 100% rename from src/version2/parameters/getWorkflowTransitionRuleConfigurations.ts rename to src/version2/parameters/getWorkflowTransitionRuleConfigurations.mts diff --git a/src/version2/parameters/getWorkflowsPaginated.ts b/src/version2/parameters/getWorkflowsPaginated.mts similarity index 100% rename from src/version2/parameters/getWorkflowsPaginated.ts rename to src/version2/parameters/getWorkflowsPaginated.mts diff --git a/src/version2/parameters/getWorklog.ts b/src/version2/parameters/getWorklog.mts similarity index 100% rename from src/version2/parameters/getWorklog.ts rename to src/version2/parameters/getWorklog.mts diff --git a/src/version2/parameters/getWorklogProperty.ts b/src/version2/parameters/getWorklogProperty.mts similarity index 100% rename from src/version2/parameters/getWorklogProperty.ts rename to src/version2/parameters/getWorklogProperty.mts diff --git a/src/version2/parameters/getWorklogPropertyKeys.ts b/src/version2/parameters/getWorklogPropertyKeys.mts similarity index 100% rename from src/version2/parameters/getWorklogPropertyKeys.ts rename to src/version2/parameters/getWorklogPropertyKeys.mts diff --git a/src/version2/parameters/getWorklogsForIds.mts b/src/version2/parameters/getWorklogsForIds.mts new file mode 100644 index 0000000000..71ef38dab7 --- /dev/null +++ b/src/version2/parameters/getWorklogsForIds.mts @@ -0,0 +1,10 @@ +import { WorklogIdsRequest } from '../models/index.mjs'; + +export interface GetWorklogsForIds extends WorklogIdsRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each + * worklog. + */ + expand?: string; +} diff --git a/src/version2/parameters/getWorklogsForIds.ts b/src/version2/parameters/getWorklogsForIds.ts deleted file mode 100644 index e3bedee7d3..0000000000 --- a/src/version2/parameters/getWorklogsForIds.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { WorklogIdsRequest } from '../models'; - -export interface GetWorklogsForIds extends WorklogIdsRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each - * worklog. - */ - expand?: string; -} diff --git a/src/version2/parameters/index.mts b/src/version2/parameters/index.mts new file mode 100644 index 0000000000..67909c4aa3 --- /dev/null +++ b/src/version2/parameters/index.mts @@ -0,0 +1,469 @@ +export * from './addActorUsers.mjs'; +export * from './addAttachment.mjs'; +export * from './addComment.mjs'; +export * from './addFieldToDefaultScreen.mjs'; +export * from './addGadget.mjs'; +export * from './addIssueTypesToContext.mjs'; +export * from './addIssueTypesToIssueTypeScheme.mjs'; +export * from './addProjectRoleActorsToRole.mjs'; +export * from './addScreenTab.mjs'; +export * from './addScreenTabField.mjs'; +export * from './addSecurityLevel.mjs'; +export * from './addSecurityLevelMembers.mjs'; +export * from './addSharePermission.mjs'; +export * from './addUserToGroup.mjs'; +export * from './addVote.mjs'; +export * from './addWatcher.mjs'; +export * from './addWorklog.mjs'; +export * from './analyseExpression.mjs'; +export * from './appendMappingsForIssueTypeScreenScheme.mjs'; +export * from './archiveIssues.mjs'; +export * from './archiveIssuesAsync.mjs'; +export * from './archiveProject.mjs'; +export * from './assignFieldConfigurationSchemeToProject.mjs'; +export * from './assignIssue.mjs'; +export * from './assignIssueTypeSchemeToProject.mjs'; +export * from './assignIssueTypeScreenSchemeToProject.mjs'; +export * from './assignPermissionScheme.mjs'; +export * from './assignProjectsToCustomFieldContext.mjs'; +export * from './assignSchemeToProject.mjs'; +export * from './associateSchemesToProjects.mjs'; +export * from './bulkDeleteIssueProperty.mjs'; +export * from './bulkEditDashboards.mjs'; +export * from './bulkGetGroups.mjs'; +export * from './bulkGetUsers.mjs'; +export * from './bulkGetUsersMigration.mjs'; +export * from './bulkSetIssuePropertiesByIssue.mjs'; +export * from './bulkSetIssueProperty.mjs'; +export * from './bulkSetIssuesProperties.mjs'; +export * from './cancelTask.mjs'; +export * from './changeFilterOwner.mjs'; +export * from './copyDashboard.mjs'; +export * from './createComponent.mjs'; +export * from './createCustomField.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createCustomFieldOption.mjs'; +export * from './createDashboard.mjs'; +export * from './createFieldConfiguration.mjs'; +export * from './createFieldConfigurationScheme.mjs'; +export * from './createFilter.mjs'; +export * from './createGroup.mjs'; +export * from './createIssue.mjs'; +export * from './createIssueFieldOption.mjs'; +export * from './createIssueLinkType.mjs'; +export * from './createIssues.mjs'; +export * from './createIssueSecurityScheme.mjs'; +export * from './createIssueType.mjs'; +export * from './createIssueTypeAvatar.mjs'; +export * from './createIssueTypeScheme.mjs'; +export * from './createIssueTypeScreenScheme.mjs'; +export * from './createNotificationScheme.mjs'; +export * from './createOrUpdateRemoteIssueLink.mjs'; +export * from './createPermissionGrant.mjs'; +export * from './createPermissionScheme.mjs'; +export * from './createPriority.mjs'; +export * from './createProject.mjs'; +export * from './createProjectAvatar.mjs'; +export * from './createProjectCategory.mjs'; +export * from './createProjectRole.mjs'; +export * from './createResolution.mjs'; +export * from './createScreen.mjs'; +export * from './createScreenScheme.mjs'; +export * from './createStatuses.mjs'; +export * from './createUiModification.mjs'; +export * from './createUser.mjs'; +export * from './createVersion.mjs'; +export * from './createWorkflow.mjs'; +export * from './createWorkflows.mjs'; +export * from './createWorkflowScheme.mjs'; +export * from './createWorkflowSchemeDraftFromParent.mjs'; +export * from './createWorkflowTransitionProperty.mjs'; +export * from './deleteActor.mjs'; +export * from './deleteAddonProperty.mjs'; +export * from './deleteAndReplaceVersion.mjs'; +export * from './deleteAppProperty.mjs'; +export * from './deleteAvatar.mjs'; +export * from './deleteComment.mjs'; +export * from './deleteCommentProperty.mjs'; +export * from './deleteComponent.mjs'; +export * from './deleteCustomField.mjs'; +export * from './deleteCustomFieldContext.mjs'; +export * from './deleteCustomFieldOption.mjs'; +export * from './deleteDashboard.mjs'; +export * from './deleteDashboardItemProperty.mjs'; +export * from './deleteDefaultWorkflow.mjs'; +export * from './deleteDraftDefaultWorkflow.mjs'; +export * from './deleteDraftWorkflowMapping.mjs'; +export * from './deleteFavouriteForFilter.mjs'; +export * from './deleteFieldConfiguration.mjs'; +export * from './deleteFieldConfigurationScheme.mjs'; +export * from './deleteFilter.mjs'; +export * from './deleteInactiveWorkflow.mjs'; +export * from './deleteIssue.mjs'; +export * from './deleteIssueFieldOption.mjs'; +export * from './deleteIssueLink.mjs'; +export * from './deleteIssueLinkType.mjs'; +export * from './deleteIssueProperty.mjs'; +export * from './deleteIssueType.mjs'; +export * from './deleteIssueTypeProperty.mjs'; +export * from './deleteIssueTypeScheme.mjs'; +export * from './deleteIssueTypeScreenScheme.mjs'; +export * from './deleteNotificationScheme.mjs'; +export * from './deletePermissionScheme.mjs'; +export * from './deletePermissionSchemeEntity.mjs'; +export * from './deleteProject.mjs'; +export * from './deleteProjectAsynchronously.mjs'; +export * from './deleteProjectAvatar.mjs'; +export * from './deleteProjectProperty.mjs'; +export * from './deleteProjectRole.mjs'; +export * from './deleteProjectRoleActorsFromRole.mjs'; +export * from './deleteRemoteIssueLinkByGlobalId.mjs'; +export * from './deleteRemoteIssueLinkById.mjs'; +export * from './deleteResolution.mjs'; +export * from './deleteScreen.mjs'; +export * from './deleteScreenScheme.mjs'; +export * from './deleteScreenTab.mjs'; +export * from './deleteSecurityScheme.mjs'; +export * from './deleteSharePermission.mjs'; +export * from './deleteStatusesById.mjs'; +export * from './deleteUiModification.mjs'; +export * from './deleteUserProperty.mjs'; +export * from './deleteWebhookById.mjs'; +export * from './deleteWorkflowMapping.mjs'; +export * from './deleteWorkflowScheme.mjs'; +export * from './deleteWorkflowSchemeDraft.mjs'; +export * from './deleteWorkflowSchemeDraftIssueType.mjs'; +export * from './deleteWorkflowSchemeIssueType.mjs'; +export * from './deleteWorkflowTransitionProperty.mjs'; +export * from './deleteWorkflowTransitionRuleConfigurations.mjs'; +export * from './deleteWorklog.mjs'; +export * from './deleteWorklogProperty.mjs'; +export * from './doTransition.mjs'; +export * from './editIssue.mjs'; +export * from './evaluateJiraExpression.mjs'; +export * from './expandAttachmentForHumans.mjs'; +export * from './expandAttachmentForMachines.mjs'; +export * from './exportArchivedIssues.mjs'; +export * from './findAssignableUsers.mjs'; +export * from './findBulkAssignableUsers.mjs'; +export * from './findGroups.mjs'; +export * from './findUserKeysByQuery.mjs'; +export * from './findUsers.mjs'; +export * from './findUsersAndGroups.mjs'; +export * from './findUsersByQuery.mjs'; +export * from './findUsersForPicker.mjs'; +export * from './findUsersWithAllPermissions.mjs'; +export * from './findUsersWithBrowsePermission.mjs'; +export * from './fullyUpdateProjectRole.mjs'; +export * from './getAccessibleProjectTypeByKey.mjs'; +export * from './getAddonProperties.mjs'; +export * from './getAddonProperty.mjs'; +export * from './getAllDashboards.mjs'; +export * from './getAllFieldConfigurations.mjs'; +export * from './getAllFieldConfigurationSchemes.mjs'; +export * from './getAllGadgets.mjs'; +export * from './getAllIssueFieldOptions.mjs'; +export * from './getAllIssueTypeSchemes.mjs'; +export * from './getAllLabels.mjs'; +export * from './getAllPermissionSchemes.mjs'; +export * from './getAllProjectAvatars.mjs'; +export * from './getAllScreenTabFields.mjs'; +export * from './getAllScreenTabs.mjs'; +export * from './getAllStatuses.mjs'; +export * from './getAllSystemAvatars.mjs'; +export * from './getAllUsers.mjs'; +export * from './getAllUsersDefault.mjs'; +export * from './getAllWorkflowSchemes.mjs'; +export * from './getAlternativeIssueTypes.mjs'; +export * from './getApplicationProperty.mjs'; +export * from './getApplicationRole.mjs'; +export * from './getAssignedPermissionScheme.mjs'; +export * from './getAttachment.mjs'; +export * from './getAttachmentContent.mjs'; +export * from './getAttachmentThumbnail.mjs'; +export * from './getAuditRecords.mjs'; +export * from './getAutoCompletePost.mjs'; +export * from './getAvailableScreenFields.mjs'; +export * from './getAvatarImageByID.mjs'; +export * from './getAvatarImageByOwner.mjs'; +export * from './getAvatarImageByType.mjs'; +export * from './getAvatars.mjs'; +export * from './getBulkPermissions.mjs'; +export * from './getChangeLogs.mjs'; +export * from './getChangeLogsByIds.mjs'; +export * from './getColumns.mjs'; +export * from './getComment.mjs'; +export * from './getCommentProperty.mjs'; +export * from './getCommentPropertyKeys.mjs'; +export * from './getComments.mjs'; +export * from './getCommentsByIds.mjs'; +export * from './getComponent.mjs'; +export * from './getComponentRelatedIssues.mjs'; +export * from './getContextsForField.mjs'; +export * from './getCreateIssueMeta.mjs'; +export * from './getCurrentUser.mjs'; +export * from './getCustomFieldConfiguration.mjs'; +export * from './getCustomFieldContextsForProjectsAndIssueTypes.mjs'; +export * from './getCustomFieldOption.mjs'; +export * from './getDashboard.mjs'; +export * from './getDashboardItemProperty.mjs'; +export * from './getDashboardItemPropertyKeys.mjs'; +export * from './getDashboardsPaginated.mjs'; +export * from './getDefaultValues.mjs'; +export * from './getDefaultWorkflow.mjs'; +export * from './getDraftDefaultWorkflow.mjs'; +export * from './getDraftWorkflow.mjs'; +export * from './getDynamicWebhooksForApp.mjs'; +export * from './getEditIssueMeta.mjs'; +export * from './getFailedWebhooks.mjs'; +export * from './getFavouriteFilters.mjs'; +export * from './getFeaturesForProject.mjs'; +export * from './getFieldAutoCompleteForQueryString.mjs'; +export * from './getFieldConfigurationItems.mjs'; +export * from './getFieldConfigurationSchemeMappings.mjs'; +export * from './getFieldConfigurationSchemeProjectMapping.mjs'; +export * from './getFieldsPaginated.mjs'; +export * from './getFilter.mjs'; +export * from './getFiltersPaginated.mjs'; +export * from './getHierarchy.mjs'; +export * from './getIdsOfWorklogsDeletedSince.mjs'; +export * from './getIdsOfWorklogsModifiedSince.mjs'; +export * from './getIssue.mjs'; +export * from './getIssueFieldOption.mjs'; +export * from './getIssueLink.mjs'; +export * from './getIssueLinkType.mjs'; +export * from './getIssuePickerResource.mjs'; +export * from './getIssueProperty.mjs'; +export * from './getIssuePropertyKeys.mjs'; +export * from './getIssueSecurityLevel.mjs'; +export * from './getIssueSecurityLevelMembers.mjs'; +export * from './getIssueSecurityScheme.mjs'; +export * from './getIssueType.mjs'; +export * from './getIssueTypeMappingsForContexts.mjs'; +export * from './getIssueTypeProperty.mjs'; +export * from './getIssueTypePropertyKeys.mjs'; +export * from './getIssueTypeSchemeForProjects.mjs'; +export * from './getIssueTypeSchemesMapping.mjs'; +export * from './getIssueTypeScreenSchemeMappings.mjs'; +export * from './getIssueTypeScreenSchemeProjectAssociations.mjs'; +export * from './getIssueTypeScreenSchemes.mjs'; +export * from './getIssueTypesForProject.mjs'; +export * from './getIssueWatchers.mjs'; +export * from './getIssueWorklog.mjs'; +export * from './getIsWatchingIssueBulk.mjs'; +export * from './getMyFilters.mjs'; +export * from './getMyPermissions.mjs'; +export * from './getNotificationScheme.mjs'; +export * from './getNotificationSchemeForProject.mjs'; +export * from './getNotificationSchemes.mjs'; +export * from './getNotificationSchemeToProjectMappings.mjs'; +export * from './getOptionsForContext.mjs'; +export * from './getPermissionScheme.mjs'; +export * from './getPermissionSchemeGrant.mjs'; +export * from './getPermissionSchemeGrants.mjs'; +export * from './getPermittedProjects.mjs'; +export * from './getPrecomputations.mjs'; +export * from './getPreference.mjs'; +export * from './getPriority.mjs'; +export * from './getProject.mjs'; +export * from './getProjectCategoryById.mjs'; +export * from './getProjectComponents.mjs'; +export * from './getProjectComponentsPaginated.mjs'; +export * from './getProjectContextMapping.mjs'; +export * from './getProjectEmail.mjs'; +export * from './getProjectIssueSecurityScheme.mjs'; +export * from './getProjectProperty.mjs'; +export * from './getProjectPropertyKeys.mjs'; +export * from './getProjectRole.mjs'; +export * from './getProjectRoleActorsForRole.mjs'; +export * from './getProjectRoleById.mjs'; +export * from './getProjectRoleDetails.mjs'; +export * from './getProjectRoles.mjs'; +export * from './getProjectsForIssueTypeScreenScheme.mjs'; +export * from './getProjectTypeByKey.mjs'; +export * from './getProjectVersions.mjs'; +export * from './getProjectVersionsPaginated.mjs'; +export * from './getRecent.mjs'; +export * from './getRemoteIssueLinkById.mjs'; +export * from './getRemoteIssueLinks.mjs'; +export * from './getScreens.mjs'; +export * from './getScreenSchemes.mjs'; +export * from './getScreensForField.mjs'; +export * from './getSecurityLevelMembers.mjs'; +export * from './getSecurityLevels.mjs'; +export * from './getSecurityLevelsForProject.mjs'; +export * from './getSelectableIssueFieldOptions.mjs'; +export * from './getSharePermission.mjs'; +export * from './getSharePermissions.mjs'; +export * from './getStatus.mjs'; +export * from './getStatusCategory.mjs'; +export * from './getStatusesById.mjs'; +export * from './getTask.mjs'; +export * from './getTransitions.mjs'; +export * from './getTrashedFieldsPaginated.mjs'; +export * from './getUiModifications.mjs'; +export * from './getUser.mjs'; +export * from './getUserDefaultColumns.mjs'; +export * from './getUserEmail.mjs'; +export * from './getUserEmailBulk.mjs'; +export * from './getUserGroups.mjs'; +export * from './getUserProperty.mjs'; +export * from './getUserPropertyKeys.mjs'; +export * from './getUsersFromGroup.mjs'; +export * from './getValidProjectKey.mjs'; +export * from './getValidProjectName.mjs'; +export * from './getVersion.mjs'; +export * from './getVersionRelatedIssues.mjs'; +export * from './getVersionUnresolvedIssues.mjs'; +export * from './getVisibleIssueFieldOptions.mjs'; +export * from './getVotes.mjs'; +export * from './getWorkflow.mjs'; +export * from './getWorkflowScheme.mjs'; +export * from './getWorkflowSchemeDraft.mjs'; +export * from './getWorkflowSchemeDraftIssueType.mjs'; +export * from './getWorkflowSchemeIssueType.mjs'; +export * from './getWorkflowSchemeProjectAssociations.mjs'; +export * from './getWorkflowsPaginated.mjs'; +export * from './getWorkflowTransitionProperties.mjs'; +export * from './getWorkflowTransitionRuleConfigurations.mjs'; +export * from './getWorklog.mjs'; +export * from './getWorklogProperty.mjs'; +export * from './getWorklogPropertyKeys.mjs'; +export * from './getWorklogsForIds.mjs'; +export * from './linkIssues.mjs'; +export * from './matchIssues.mjs'; +export * from './mergeVersions.mjs'; +export * from './migrateQueries.mjs'; +export * from './movePriorities.mjs'; +export * from './moveResolutions.mjs'; +export * from './moveScreenTab.mjs'; +export * from './moveScreenTabField.mjs'; +export * from './moveVersion.mjs'; +export * from './notify.mjs'; +export * from './parseJqlQueries.mjs'; +export * from './partialUpdateProjectRole.mjs'; +export * from './publishDraftWorkflowScheme.mjs'; +export * from './putAddonProperty.mjs'; +export * from './putAppProperty.mjs'; +export * from './readWorkflows.mjs'; +export * from './refreshWebhooks.mjs'; +export * from './registerDynamicWebhooks.mjs'; +export * from './registerModules.mjs'; +export * from './removeAttachment.mjs'; +export * from './removeCustomFieldContextFromProjects.mjs'; +export * from './removeGadget.mjs'; +export * from './removeGroup.mjs'; +export * from './removeIssueTypeFromIssueTypeScheme.mjs'; +export * from './removeIssueTypesFromContext.mjs'; +export * from './removeIssueTypesFromGlobalFieldConfigurationScheme.mjs'; +export * from './removeLevel.mjs'; +export * from './removeMappingsFromIssueTypeScreenScheme.mjs'; +export * from './removeMemberFromSecurityLevel.mjs'; +export * from './removeModules.mjs'; +export * from './removeNotificationFromNotificationScheme.mjs'; +export * from './removePreference.mjs'; +export * from './removeProjectCategory.mjs'; +export * from './removeScreenTabField.mjs'; +export * from './removeUser.mjs'; +export * from './removeUserFromGroup.mjs'; +export * from './removeVote.mjs'; +export * from './removeWatcher.mjs'; +export * from './renameScreenTab.mjs'; +export * from './reorderCustomFieldOptions.mjs'; +export * from './reorderIssueTypesInIssueTypeScheme.mjs'; +export * from './replaceIssueFieldOption.mjs'; +export * from './resetColumns.mjs'; +export * from './resetUserColumns.mjs'; +export * from './restore.mjs'; +export * from './restoreCustomField.mjs'; +export * from './sanitiseJqlQueries.mjs'; +export * from './search.mjs'; +export * from './searchForIssuesUsingJql.mjs'; +export * from './searchForIssuesUsingJqlPost.mjs'; +export * from './searchPriorities.mjs'; +export * from './searchProjects.mjs'; +export * from './searchProjectsUsingSecuritySchemes.mjs'; +export * from './searchResolutions.mjs'; +export * from './searchSecuritySchemes.mjs'; +export * from './selectTimeTrackingImplementation.mjs'; +export * from './setActors.mjs'; +export * from './setApplicationProperty.mjs'; +export * from './setBanner.mjs'; +export * from './setColumns.mjs'; +export * from './setCommentProperty.mjs'; +export * from './setDashboardItemProperty.mjs'; +export * from './setDefaultLevels.mjs'; +export * from './setDefaultPriority.mjs'; +export * from './setDefaultResolution.mjs'; +export * from './setDefaultShareScope.mjs'; +export * from './setDefaultValues.mjs'; +export * from './setFavouriteForFilter.mjs'; +export * from './setFieldConfigurationSchemeMapping.mjs'; +export * from './setIssueProperty.mjs'; +export * from './setIssueTypeProperty.mjs'; +export * from './setPreference.mjs'; +export * from './setProjectProperty.mjs'; +export * from './setSharedTimeTrackingConfiguration.mjs'; +export * from './setUserColumns.mjs'; +export * from './setUserProperty.mjs'; +export * from './setWorkflowSchemeDraftIssueType.mjs'; +export * from './setWorkflowSchemeIssueType.mjs'; +export * from './setWorklogProperty.mjs'; +export * from './storeAvatar.mjs'; +export * from './toggleFeatureForProject.mjs'; +export * from './trashCustomField.mjs'; +export * from './unarchiveIssues.mjs'; +export * from './updateComment.mjs'; +export * from './updateComponent.mjs'; +export * from './updateCustomField.mjs'; +export * from './updateCustomFieldConfiguration.mjs'; +export * from './updateCustomFieldContext.mjs'; +export * from './updateCustomFieldOption.mjs'; +export * from './updateCustomFieldValue.mjs'; +export * from './updateDashboard.mjs'; +export * from './updateDefaultScreenScheme.mjs'; +export * from './updateDefaultWorkflow.mjs'; +export * from './updateDraftDefaultWorkflow.mjs'; +export * from './updateDraftWorkflowMapping.mjs'; +export * from './updateEntityPropertiesValue.mjs'; +export * from './updateFieldConfiguration.mjs'; +export * from './updateFieldConfigurationItems.mjs'; +export * from './updateFieldConfigurationScheme.mjs'; +export * from './updateFilter.mjs'; +export * from './updateGadget.mjs'; +export * from './updateIssueFieldOption.mjs'; +export * from './updateIssueFields.mjs'; +export * from './updateIssueLinkType.mjs'; +export * from './updateIssueSecurityScheme.mjs'; +export * from './updateIssueType.mjs'; +export * from './updateIssueTypeScheme.mjs'; +export * from './updateIssueTypeScreenScheme.mjs'; +export * from './updateMultipleCustomFieldValues.mjs'; +export * from './updateNotificationScheme.mjs'; +export * from './updatePermissionScheme.mjs'; +export * from './updatePrecomputations.mjs'; +export * from './updatePriority.mjs'; +export * from './updateProject.mjs'; +export * from './updateProjectAvatar.mjs'; +export * from './updateProjectCategory.mjs'; +export * from './updateProjectEmail.mjs'; +export * from './updateRemoteIssueLink.mjs'; +export * from './updateResolution.mjs'; +export * from './updateScreen.mjs'; +export * from './updateScreenScheme.mjs'; +export * from './updateSecurityLevel.mjs'; +export * from './updateStatuses.mjs'; +export * from './updateUiModification.mjs'; +export * from './updateVersion.mjs'; +export * from './updateWorkflowMapping.mjs'; +export * from './updateWorkflows.mjs'; +export * from './updateWorkflowScheme.mjs'; +export * from './updateWorkflowSchemeDraft.mjs'; +export * from './updateWorkflowTransitionProperty.mjs'; +export * from './updateWorkflowTransitionRuleConfigurations.mjs'; +export * from './updateWorklog.mjs'; +export * from './validateCreateWorkflows.mjs'; +export * from './validateProjectKey.mjs'; +export * from './validateUpdateWorkflows.mjs'; +export * from './workflowCapabilities.mjs'; +export * from './workflowRuleSearch.mjs'; diff --git a/src/version2/parameters/index.ts b/src/version2/parameters/index.ts deleted file mode 100644 index a008d2208b..0000000000 --- a/src/version2/parameters/index.ts +++ /dev/null @@ -1,469 +0,0 @@ -export * from './addActorUsers'; -export * from './addAttachment'; -export * from './addComment'; -export * from './addFieldToDefaultScreen'; -export * from './addGadget'; -export * from './addIssueTypesToContext'; -export * from './addIssueTypesToIssueTypeScheme'; -export * from './addProjectRoleActorsToRole'; -export * from './addScreenTab'; -export * from './addScreenTabField'; -export * from './addSecurityLevel'; -export * from './addSecurityLevelMembers'; -export * from './addSharePermission'; -export * from './addUserToGroup'; -export * from './addVote'; -export * from './addWatcher'; -export * from './addWorklog'; -export * from './analyseExpression'; -export * from './appendMappingsForIssueTypeScreenScheme'; -export * from './archiveIssues'; -export * from './archiveIssuesAsync'; -export * from './archiveProject'; -export * from './assignFieldConfigurationSchemeToProject'; -export * from './assignIssue'; -export * from './assignIssueTypeSchemeToProject'; -export * from './assignIssueTypeScreenSchemeToProject'; -export * from './assignPermissionScheme'; -export * from './assignProjectsToCustomFieldContext'; -export * from './assignSchemeToProject'; -export * from './associateSchemesToProjects'; -export * from './bulkDeleteIssueProperty'; -export * from './bulkEditDashboards'; -export * from './bulkGetGroups'; -export * from './bulkGetUsers'; -export * from './bulkGetUsersMigration'; -export * from './bulkSetIssuePropertiesByIssue'; -export * from './bulkSetIssueProperty'; -export * from './bulkSetIssuesProperties'; -export * from './cancelTask'; -export * from './changeFilterOwner'; -export * from './copyDashboard'; -export * from './createComponent'; -export * from './createCustomField'; -export * from './createCustomFieldContext'; -export * from './createCustomFieldOption'; -export * from './createDashboard'; -export * from './createFieldConfiguration'; -export * from './createFieldConfigurationScheme'; -export * from './createFilter'; -export * from './createGroup'; -export * from './createIssue'; -export * from './createIssueFieldOption'; -export * from './createIssueLinkType'; -export * from './createIssues'; -export * from './createIssueSecurityScheme'; -export * from './createIssueType'; -export * from './createIssueTypeAvatar'; -export * from './createIssueTypeScheme'; -export * from './createIssueTypeScreenScheme'; -export * from './createNotificationScheme'; -export * from './createOrUpdateRemoteIssueLink'; -export * from './createPermissionGrant'; -export * from './createPermissionScheme'; -export * from './createPriority'; -export * from './createProject'; -export * from './createProjectAvatar'; -export * from './createProjectCategory'; -export * from './createProjectRole'; -export * from './createResolution'; -export * from './createScreen'; -export * from './createScreenScheme'; -export * from './createStatuses'; -export * from './createUiModification'; -export * from './createUser'; -export * from './createVersion'; -export * from './createWorkflow'; -export * from './createWorkflows'; -export * from './createWorkflowScheme'; -export * from './createWorkflowSchemeDraftFromParent'; -export * from './createWorkflowTransitionProperty'; -export * from './deleteActor'; -export * from './deleteAddonProperty'; -export * from './deleteAndReplaceVersion'; -export * from './deleteAppProperty'; -export * from './deleteAvatar'; -export * from './deleteComment'; -export * from './deleteCommentProperty'; -export * from './deleteComponent'; -export * from './deleteCustomField'; -export * from './deleteCustomFieldContext'; -export * from './deleteCustomFieldOption'; -export * from './deleteDashboard'; -export * from './deleteDashboardItemProperty'; -export * from './deleteDefaultWorkflow'; -export * from './deleteDraftDefaultWorkflow'; -export * from './deleteDraftWorkflowMapping'; -export * from './deleteFavouriteForFilter'; -export * from './deleteFieldConfiguration'; -export * from './deleteFieldConfigurationScheme'; -export * from './deleteFilter'; -export * from './deleteInactiveWorkflow'; -export * from './deleteIssue'; -export * from './deleteIssueFieldOption'; -export * from './deleteIssueLink'; -export * from './deleteIssueLinkType'; -export * from './deleteIssueProperty'; -export * from './deleteIssueType'; -export * from './deleteIssueTypeProperty'; -export * from './deleteIssueTypeScheme'; -export * from './deleteIssueTypeScreenScheme'; -export * from './deleteNotificationScheme'; -export * from './deletePermissionScheme'; -export * from './deletePermissionSchemeEntity'; -export * from './deleteProject'; -export * from './deleteProjectAsynchronously'; -export * from './deleteProjectAvatar'; -export * from './deleteProjectProperty'; -export * from './deleteProjectRole'; -export * from './deleteProjectRoleActorsFromRole'; -export * from './deleteRemoteIssueLinkByGlobalId'; -export * from './deleteRemoteIssueLinkById'; -export * from './deleteResolution'; -export * from './deleteScreen'; -export * from './deleteScreenScheme'; -export * from './deleteScreenTab'; -export * from './deleteSecurityScheme'; -export * from './deleteSharePermission'; -export * from './deleteStatusesById'; -export * from './deleteUiModification'; -export * from './deleteUserProperty'; -export * from './deleteWebhookById'; -export * from './deleteWorkflowMapping'; -export * from './deleteWorkflowScheme'; -export * from './deleteWorkflowSchemeDraft'; -export * from './deleteWorkflowSchemeDraftIssueType'; -export * from './deleteWorkflowSchemeIssueType'; -export * from './deleteWorkflowTransitionProperty'; -export * from './deleteWorkflowTransitionRuleConfigurations'; -export * from './deleteWorklog'; -export * from './deleteWorklogProperty'; -export * from './doTransition'; -export * from './editIssue'; -export * from './evaluateJiraExpression'; -export * from './expandAttachmentForHumans'; -export * from './expandAttachmentForMachines'; -export * from './exportArchivedIssues'; -export * from './findAssignableUsers'; -export * from './findBulkAssignableUsers'; -export * from './findGroups'; -export * from './findUserKeysByQuery'; -export * from './findUsers'; -export * from './findUsersAndGroups'; -export * from './findUsersByQuery'; -export * from './findUsersForPicker'; -export * from './findUsersWithAllPermissions'; -export * from './findUsersWithBrowsePermission'; -export * from './fullyUpdateProjectRole'; -export * from './getAccessibleProjectTypeByKey'; -export * from './getAddonProperties'; -export * from './getAddonProperty'; -export * from './getAllDashboards'; -export * from './getAllFieldConfigurations'; -export * from './getAllFieldConfigurationSchemes'; -export * from './getAllGadgets'; -export * from './getAllIssueFieldOptions'; -export * from './getAllIssueTypeSchemes'; -export * from './getAllLabels'; -export * from './getAllPermissionSchemes'; -export * from './getAllProjectAvatars'; -export * from './getAllScreenTabFields'; -export * from './getAllScreenTabs'; -export * from './getAllStatuses'; -export * from './getAllSystemAvatars'; -export * from './getAllUsers'; -export * from './getAllUsersDefault'; -export * from './getAllWorkflowSchemes'; -export * from './getAlternativeIssueTypes'; -export * from './getApplicationProperty'; -export * from './getApplicationRole'; -export * from './getAssignedPermissionScheme'; -export * from './getAttachment'; -export * from './getAttachmentContent'; -export * from './getAttachmentThumbnail'; -export * from './getAuditRecords'; -export * from './getAutoCompletePost'; -export * from './getAvailableScreenFields'; -export * from './getAvatarImageByID'; -export * from './getAvatarImageByOwner'; -export * from './getAvatarImageByType'; -export * from './getAvatars'; -export * from './getBulkPermissions'; -export * from './getChangeLogs'; -export * from './getChangeLogsByIds'; -export * from './getColumns'; -export * from './getComment'; -export * from './getCommentProperty'; -export * from './getCommentPropertyKeys'; -export * from './getComments'; -export * from './getCommentsByIds'; -export * from './getComponent'; -export * from './getComponentRelatedIssues'; -export * from './getContextsForField'; -export * from './getCreateIssueMeta'; -export * from './getCurrentUser'; -export * from './getCustomFieldConfiguration'; -export * from './getCustomFieldContextsForProjectsAndIssueTypes'; -export * from './getCustomFieldOption'; -export * from './getDashboard'; -export * from './getDashboardItemProperty'; -export * from './getDashboardItemPropertyKeys'; -export * from './getDashboardsPaginated'; -export * from './getDefaultValues'; -export * from './getDefaultWorkflow'; -export * from './getDraftDefaultWorkflow'; -export * from './getDraftWorkflow'; -export * from './getDynamicWebhooksForApp'; -export * from './getEditIssueMeta'; -export * from './getFailedWebhooks'; -export * from './getFavouriteFilters'; -export * from './getFeaturesForProject'; -export * from './getFieldAutoCompleteForQueryString'; -export * from './getFieldConfigurationItems'; -export * from './getFieldConfigurationSchemeMappings'; -export * from './getFieldConfigurationSchemeProjectMapping'; -export * from './getFieldsPaginated'; -export * from './getFilter'; -export * from './getFiltersPaginated'; -export * from './getHierarchy'; -export * from './getIdsOfWorklogsDeletedSince'; -export * from './getIdsOfWorklogsModifiedSince'; -export * from './getIssue'; -export * from './getIssueFieldOption'; -export * from './getIssueLink'; -export * from './getIssueLinkType'; -export * from './getIssuePickerResource'; -export * from './getIssueProperty'; -export * from './getIssuePropertyKeys'; -export * from './getIssueSecurityLevel'; -export * from './getIssueSecurityLevelMembers'; -export * from './getIssueSecurityScheme'; -export * from './getIssueType'; -export * from './getIssueTypeMappingsForContexts'; -export * from './getIssueTypeProperty'; -export * from './getIssueTypePropertyKeys'; -export * from './getIssueTypeSchemeForProjects'; -export * from './getIssueTypeSchemesMapping'; -export * from './getIssueTypeScreenSchemeMappings'; -export * from './getIssueTypeScreenSchemeProjectAssociations'; -export * from './getIssueTypeScreenSchemes'; -export * from './getIssueTypesForProject'; -export * from './getIssueWatchers'; -export * from './getIssueWorklog'; -export * from './getIsWatchingIssueBulk'; -export * from './getMyFilters'; -export * from './getMyPermissions'; -export * from './getNotificationScheme'; -export * from './getNotificationSchemeForProject'; -export * from './getNotificationSchemes'; -export * from './getNotificationSchemeToProjectMappings'; -export * from './getOptionsForContext'; -export * from './getPermissionScheme'; -export * from './getPermissionSchemeGrant'; -export * from './getPermissionSchemeGrants'; -export * from './getPermittedProjects'; -export * from './getPrecomputations'; -export * from './getPreference'; -export * from './getPriority'; -export * from './getProject'; -export * from './getProjectCategoryById'; -export * from './getProjectComponents'; -export * from './getProjectComponentsPaginated'; -export * from './getProjectContextMapping'; -export * from './getProjectEmail'; -export * from './getProjectIssueSecurityScheme'; -export * from './getProjectProperty'; -export * from './getProjectPropertyKeys'; -export * from './getProjectRole'; -export * from './getProjectRoleActorsForRole'; -export * from './getProjectRoleById'; -export * from './getProjectRoleDetails'; -export * from './getProjectRoles'; -export * from './getProjectsForIssueTypeScreenScheme'; -export * from './getProjectTypeByKey'; -export * from './getProjectVersions'; -export * from './getProjectVersionsPaginated'; -export * from './getRecent'; -export * from './getRemoteIssueLinkById'; -export * from './getRemoteIssueLinks'; -export * from './getScreens'; -export * from './getScreenSchemes'; -export * from './getScreensForField'; -export * from './getSecurityLevelMembers'; -export * from './getSecurityLevels'; -export * from './getSecurityLevelsForProject'; -export * from './getSelectableIssueFieldOptions'; -export * from './getSharePermission'; -export * from './getSharePermissions'; -export * from './getStatus'; -export * from './getStatusCategory'; -export * from './getStatusesById'; -export * from './getTask'; -export * from './getTransitions'; -export * from './getTrashedFieldsPaginated'; -export * from './getUiModifications'; -export * from './getUser'; -export * from './getUserDefaultColumns'; -export * from './getUserEmail'; -export * from './getUserEmailBulk'; -export * from './getUserGroups'; -export * from './getUserProperty'; -export * from './getUserPropertyKeys'; -export * from './getUsersFromGroup'; -export * from './getValidProjectKey'; -export * from './getValidProjectName'; -export * from './getVersion'; -export * from './getVersionRelatedIssues'; -export * from './getVersionUnresolvedIssues'; -export * from './getVisibleIssueFieldOptions'; -export * from './getVotes'; -export * from './getWorkflow'; -export * from './getWorkflowScheme'; -export * from './getWorkflowSchemeDraft'; -export * from './getWorkflowSchemeDraftIssueType'; -export * from './getWorkflowSchemeIssueType'; -export * from './getWorkflowSchemeProjectAssociations'; -export * from './getWorkflowsPaginated'; -export * from './getWorkflowTransitionProperties'; -export * from './getWorkflowTransitionRuleConfigurations'; -export * from './getWorklog'; -export * from './getWorklogProperty'; -export * from './getWorklogPropertyKeys'; -export * from './getWorklogsForIds'; -export * from './linkIssues'; -export * from './matchIssues'; -export * from './mergeVersions'; -export * from './migrateQueries'; -export * from './movePriorities'; -export * from './moveResolutions'; -export * from './moveScreenTab'; -export * from './moveScreenTabField'; -export * from './moveVersion'; -export * from './notify'; -export * from './parseJqlQueries'; -export * from './partialUpdateProjectRole'; -export * from './publishDraftWorkflowScheme'; -export * from './putAddonProperty'; -export * from './putAppProperty'; -export * from './readWorkflows'; -export * from './refreshWebhooks'; -export * from './registerDynamicWebhooks'; -export * from './registerModules'; -export * from './removeAttachment'; -export * from './removeCustomFieldContextFromProjects'; -export * from './removeGadget'; -export * from './removeGroup'; -export * from './removeIssueTypeFromIssueTypeScheme'; -export * from './removeIssueTypesFromContext'; -export * from './removeIssueTypesFromGlobalFieldConfigurationScheme'; -export * from './removeLevel'; -export * from './removeMappingsFromIssueTypeScreenScheme'; -export * from './removeMemberFromSecurityLevel'; -export * from './removeModules'; -export * from './removeNotificationFromNotificationScheme'; -export * from './removePreference'; -export * from './removeProjectCategory'; -export * from './removeScreenTabField'; -export * from './removeUser'; -export * from './removeUserFromGroup'; -export * from './removeVote'; -export * from './removeWatcher'; -export * from './renameScreenTab'; -export * from './reorderCustomFieldOptions'; -export * from './reorderIssueTypesInIssueTypeScheme'; -export * from './replaceIssueFieldOption'; -export * from './resetColumns'; -export * from './resetUserColumns'; -export * from './restore'; -export * from './restoreCustomField'; -export * from './sanitiseJqlQueries'; -export * from './search'; -export * from './searchForIssuesUsingJql'; -export * from './searchForIssuesUsingJqlPost'; -export * from './searchPriorities'; -export * from './searchProjects'; -export * from './searchProjectsUsingSecuritySchemes'; -export * from './searchResolutions'; -export * from './searchSecuritySchemes'; -export * from './selectTimeTrackingImplementation'; -export * from './setActors'; -export * from './setApplicationProperty'; -export * from './setBanner'; -export * from './setColumns'; -export * from './setCommentProperty'; -export * from './setDashboardItemProperty'; -export * from './setDefaultLevels'; -export * from './setDefaultPriority'; -export * from './setDefaultResolution'; -export * from './setDefaultShareScope'; -export * from './setDefaultValues'; -export * from './setFavouriteForFilter'; -export * from './setFieldConfigurationSchemeMapping'; -export * from './setIssueProperty'; -export * from './setIssueTypeProperty'; -export * from './setPreference'; -export * from './setProjectProperty'; -export * from './setSharedTimeTrackingConfiguration'; -export * from './setUserColumns'; -export * from './setUserProperty'; -export * from './setWorkflowSchemeDraftIssueType'; -export * from './setWorkflowSchemeIssueType'; -export * from './setWorklogProperty'; -export * from './storeAvatar'; -export * from './toggleFeatureForProject'; -export * from './trashCustomField'; -export * from './unarchiveIssues'; -export * from './updateComment'; -export * from './updateComponent'; -export * from './updateCustomField'; -export * from './updateCustomFieldConfiguration'; -export * from './updateCustomFieldContext'; -export * from './updateCustomFieldOption'; -export * from './updateCustomFieldValue'; -export * from './updateDashboard'; -export * from './updateDefaultScreenScheme'; -export * from './updateDefaultWorkflow'; -export * from './updateDraftDefaultWorkflow'; -export * from './updateDraftWorkflowMapping'; -export * from './updateEntityPropertiesValue'; -export * from './updateFieldConfiguration'; -export * from './updateFieldConfigurationItems'; -export * from './updateFieldConfigurationScheme'; -export * from './updateFilter'; -export * from './updateGadget'; -export * from './updateIssueFieldOption'; -export * from './updateIssueFields'; -export * from './updateIssueLinkType'; -export * from './updateIssueSecurityScheme'; -export * from './updateIssueType'; -export * from './updateIssueTypeScheme'; -export * from './updateIssueTypeScreenScheme'; -export * from './updateMultipleCustomFieldValues'; -export * from './updateNotificationScheme'; -export * from './updatePermissionScheme'; -export * from './updatePrecomputations'; -export * from './updatePriority'; -export * from './updateProject'; -export * from './updateProjectAvatar'; -export * from './updateProjectCategory'; -export * from './updateProjectEmail'; -export * from './updateRemoteIssueLink'; -export * from './updateResolution'; -export * from './updateScreen'; -export * from './updateScreenScheme'; -export * from './updateSecurityLevel'; -export * from './updateStatuses'; -export * from './updateUiModification'; -export * from './updateVersion'; -export * from './updateWorkflowMapping'; -export * from './updateWorkflows'; -export * from './updateWorkflowScheme'; -export * from './updateWorkflowSchemeDraft'; -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/version2/parameters/linkIssues.mts b/src/version2/parameters/linkIssues.mts new file mode 100644 index 0000000000..5b913d2465 --- /dev/null +++ b/src/version2/parameters/linkIssues.mts @@ -0,0 +1,3 @@ +import { LinkIssueRequestJson } from '../models/index.mjs'; + +export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version2/parameters/linkIssues.ts b/src/version2/parameters/linkIssues.ts deleted file mode 100644 index 97b98bdab9..0000000000 --- a/src/version2/parameters/linkIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { LinkIssueRequestJson } from '../models'; - -export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version2/parameters/matchIssues.mts b/src/version2/parameters/matchIssues.mts new file mode 100644 index 0000000000..10f28eb7ef --- /dev/null +++ b/src/version2/parameters/matchIssues.mts @@ -0,0 +1,3 @@ +import { IssuesAndJQLQueries } from '../models/index.mjs'; + +export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version2/parameters/matchIssues.ts b/src/version2/parameters/matchIssues.ts deleted file mode 100644 index d8f0f3cc07..0000000000 --- a/src/version2/parameters/matchIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssuesAndJQLQueries } from '../models'; - -export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version2/parameters/mergeVersions.ts b/src/version2/parameters/mergeVersions.mts similarity index 100% rename from src/version2/parameters/mergeVersions.ts rename to src/version2/parameters/mergeVersions.mts diff --git a/src/version2/parameters/migrateQueries.mts b/src/version2/parameters/migrateQueries.mts new file mode 100644 index 0000000000..6a6dd34d72 --- /dev/null +++ b/src/version2/parameters/migrateQueries.mts @@ -0,0 +1,3 @@ +import { JQLPersonalDataMigrationRequest } from '../models/index.mjs'; + +export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version2/parameters/migrateQueries.ts b/src/version2/parameters/migrateQueries.ts deleted file mode 100644 index c6c7aac9ce..0000000000 --- a/src/version2/parameters/migrateQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JQLPersonalDataMigrationRequest } from '../models'; - -export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version2/parameters/movePriorities.mts b/src/version2/parameters/movePriorities.mts new file mode 100644 index 0000000000..f9e8521f84 --- /dev/null +++ b/src/version2/parameters/movePriorities.mts @@ -0,0 +1,3 @@ +import { ReorderIssuePriorities } from '../models/index.mjs'; + +export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version2/parameters/movePriorities.ts b/src/version2/parameters/movePriorities.ts deleted file mode 100644 index 34061dae91..0000000000 --- a/src/version2/parameters/movePriorities.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ReorderIssuePriorities } from '../models'; - -export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version2/parameters/moveResolutions.mts b/src/version2/parameters/moveResolutions.mts new file mode 100644 index 0000000000..0e1d9a829d --- /dev/null +++ b/src/version2/parameters/moveResolutions.mts @@ -0,0 +1,3 @@ +import { ReorderIssueResolutionsRequest } from '../models/index.mjs'; + +export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version2/parameters/moveResolutions.ts b/src/version2/parameters/moveResolutions.ts deleted file mode 100644 index 9935490feb..0000000000 --- a/src/version2/parameters/moveResolutions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ReorderIssueResolutionsRequest } from '../models'; - -export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version2/parameters/moveScreenTab.ts b/src/version2/parameters/moveScreenTab.mts similarity index 100% rename from src/version2/parameters/moveScreenTab.ts rename to src/version2/parameters/moveScreenTab.mts diff --git a/src/version2/parameters/moveScreenTabField.mts b/src/version2/parameters/moveScreenTabField.mts new file mode 100644 index 0000000000..0ed677e4e5 --- /dev/null +++ b/src/version2/parameters/moveScreenTabField.mts @@ -0,0 +1,10 @@ +import { MoveField } from '../models/index.mjs'; + +export interface MoveScreenTabField extends MoveField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; + /** The ID of the field. */ + id: string; +} diff --git a/src/version2/parameters/moveScreenTabField.ts b/src/version2/parameters/moveScreenTabField.ts deleted file mode 100644 index 7ef37bff6a..0000000000 --- a/src/version2/parameters/moveScreenTabField.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MoveField } from '../models'; - -export interface MoveScreenTabField extends MoveField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The ID of the field. */ - id: string; -} diff --git a/src/version2/parameters/moveVersion.mts b/src/version2/parameters/moveVersion.mts new file mode 100644 index 0000000000..406cf9055f --- /dev/null +++ b/src/version2/parameters/moveVersion.mts @@ -0,0 +1,6 @@ +import { VersionMove } from '../models/index.mjs'; + +export interface MoveVersion extends VersionMove { + /** The ID of the version to be moved. */ + id: string; +} diff --git a/src/version2/parameters/moveVersion.ts b/src/version2/parameters/moveVersion.ts deleted file mode 100644 index bba5c554ad..0000000000 --- a/src/version2/parameters/moveVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { VersionMove } from '../models'; - -export interface MoveVersion extends VersionMove { - /** The ID of the version to be moved. */ - id: string; -} diff --git a/src/version2/parameters/notify.mts b/src/version2/parameters/notify.mts new file mode 100644 index 0000000000..1485a42062 --- /dev/null +++ b/src/version2/parameters/notify.mts @@ -0,0 +1,6 @@ +import { Notification } from '../models/index.mjs'; + +export interface Notify extends Notification { + /** ID or key of the issue that the notification is sent for. */ + issueIdOrKey: string; +} diff --git a/src/version2/parameters/notify.ts b/src/version2/parameters/notify.ts deleted file mode 100644 index a14c2dc095..0000000000 --- a/src/version2/parameters/notify.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Notification } from '../models'; - -export interface Notify extends Notification { - /** ID or key of the issue that the notification is sent for. */ - issueIdOrKey: string; -} diff --git a/src/version2/parameters/parseJqlQueries.mts b/src/version2/parameters/parseJqlQueries.mts new file mode 100644 index 0000000000..5f8584cb29 --- /dev/null +++ b/src/version2/parameters/parseJqlQueries.mts @@ -0,0 +1,13 @@ +import { JqlQueriesToParse } from '../models/index.mjs'; + +export interface ParseJqlQueries extends JqlQueriesToParse { + /** + * How to validate the Jql query and treat the validation results. Validation options include: + * + * - `strict` Returns all errors. If validation fails, the query structure is not returned. + * - `warn` Returns all errors. If validation fails but the Jql query is correctly formed, the query structure is + * returned. + * - `none` No validation is performed. If Jql query is correctly formed, the query structure is returned. + */ + validation?: 'strict' | 'warn' | 'none' | string; +} diff --git a/src/version2/parameters/parseJqlQueries.ts b/src/version2/parameters/parseJqlQueries.ts deleted file mode 100644 index 13445147e3..0000000000 --- a/src/version2/parameters/parseJqlQueries.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JqlQueriesToParse } from '../models'; - -export interface ParseJqlQueries extends JqlQueriesToParse { - /** - * How to validate the JQL query and treat the validation results. Validation options include: - * - * - `strict` Returns all errors. If validation fails, the query structure is not returned. - * - `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is - * returned. - * - `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. - */ - validation?: 'strict' | 'warn' | 'none' | string; -} diff --git a/src/version2/parameters/partialUpdateProjectRole.mts b/src/version2/parameters/partialUpdateProjectRole.mts new file mode 100644 index 0000000000..d254d6b185 --- /dev/null +++ b/src/version2/parameters/partialUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * 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. + */ + id: number; +} diff --git a/src/version2/parameters/partialUpdateProjectRole.ts b/src/version2/parameters/partialUpdateProjectRole.ts deleted file mode 100644 index 4757a5fc58..0000000000 --- a/src/version2/parameters/partialUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CreateUpdateRoleRequest } from '../models'; - -export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * 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. - */ - id: number; -} diff --git a/src/version2/parameters/publishDraftWorkflowScheme.mts b/src/version2/parameters/publishDraftWorkflowScheme.mts new file mode 100644 index 0000000000..4befa82a0c --- /dev/null +++ b/src/version2/parameters/publishDraftWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { StatusMapping } from '../models/index.mjs'; + +export interface PublishDraftWorkflowScheme { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** Whether the request only performs a validation. */ + validateOnly?: boolean; + statusMappings?: StatusMapping[]; +} diff --git a/src/version2/parameters/publishDraftWorkflowScheme.ts b/src/version2/parameters/publishDraftWorkflowScheme.ts deleted file mode 100644 index 683095758e..0000000000 --- a/src/version2/parameters/publishDraftWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { StatusMapping } from '../models'; - -export interface PublishDraftWorkflowScheme { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** Whether the request only performs a validation. */ - validateOnly?: boolean; - statusMappings?: StatusMapping[]; -} diff --git a/src/version2/parameters/putAddonProperty.ts b/src/version2/parameters/putAddonProperty.mts similarity index 100% rename from src/version2/parameters/putAddonProperty.ts rename to src/version2/parameters/putAddonProperty.mts diff --git a/src/version2/parameters/putAppProperty.ts b/src/version2/parameters/putAppProperty.mts similarity index 100% rename from src/version2/parameters/putAppProperty.ts rename to src/version2/parameters/putAppProperty.mts diff --git a/src/version2/parameters/readWorkflows.mts b/src/version2/parameters/readWorkflows.mts new file mode 100644 index 0000000000..c88f2e3734 --- /dev/null +++ b/src/version2/parameters/readWorkflows.mts @@ -0,0 +1,18 @@ +import { ProjectAndIssueTypePair } from '../models/index.mjs'; + +export interface ReadWorkflows { + /** 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/readWorkflows.ts b/src/version2/parameters/readWorkflows.ts deleted file mode 100644 index c1248108f5..0000000000 --- a/src/version2/parameters/readWorkflows.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { ProjectAndIssueTypePair } from '../models'; - -export interface ReadWorkflows { - /** 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/refreshWebhooks.mts b/src/version2/parameters/refreshWebhooks.mts new file mode 100644 index 0000000000..33d4bceaa1 --- /dev/null +++ b/src/version2/parameters/refreshWebhooks.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/refreshWebhooks.ts b/src/version2/parameters/refreshWebhooks.ts deleted file mode 100644 index b1b130af0d..0000000000 --- a/src/version2/parameters/refreshWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ContainerForWebhookIDs } from '../models'; - -export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version2/parameters/registerDynamicWebhooks.mts b/src/version2/parameters/registerDynamicWebhooks.mts new file mode 100644 index 0000000000..b88825dc52 --- /dev/null +++ b/src/version2/parameters/registerDynamicWebhooks.mts @@ -0,0 +1,3 @@ +import { WebhookRegistrationDetails } from '../models/index.mjs'; + +export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version2/parameters/registerDynamicWebhooks.ts b/src/version2/parameters/registerDynamicWebhooks.ts deleted file mode 100644 index 3cf5329e12..0000000000 --- a/src/version2/parameters/registerDynamicWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WebhookRegistrationDetails } from '../models'; - -export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version2/parameters/registerModules.mts b/src/version2/parameters/registerModules.mts new file mode 100644 index 0000000000..3d88a2183b --- /dev/null +++ b/src/version2/parameters/registerModules.mts @@ -0,0 +1,3 @@ +import { ConnectModules } from '../models/index.mjs'; + +export interface RegisterModules extends ConnectModules {} diff --git a/src/version2/parameters/registerModules.ts b/src/version2/parameters/registerModules.ts deleted file mode 100644 index 6ae8188408..0000000000 --- a/src/version2/parameters/registerModules.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ConnectModules } from '../models'; - -export interface RegisterModules extends ConnectModules {} diff --git a/src/version2/parameters/removeAttachment.ts b/src/version2/parameters/removeAttachment.mts similarity index 100% rename from src/version2/parameters/removeAttachment.ts rename to src/version2/parameters/removeAttachment.mts diff --git a/src/version2/parameters/removeCustomFieldContextFromProjects.mts b/src/version2/parameters/removeCustomFieldContextFromProjects.mts new file mode 100644 index 0000000000..b1c3958a0c --- /dev/null +++ b/src/version2/parameters/removeCustomFieldContextFromProjects.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface RemoveCustomFieldContextFromProjects extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/removeCustomFieldContextFromProjects.ts b/src/version2/parameters/removeCustomFieldContextFromProjects.ts deleted file mode 100644 index 73b0cf9ba4..0000000000 --- a/src/version2/parameters/removeCustomFieldContextFromProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectIds } from '../models'; - -export interface RemoveCustomFieldContextFromProjects extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/removeGadget.ts b/src/version2/parameters/removeGadget.mts similarity index 100% rename from src/version2/parameters/removeGadget.ts rename to src/version2/parameters/removeGadget.mts diff --git a/src/version2/parameters/removeGroup.ts b/src/version2/parameters/removeGroup.mts similarity index 100% rename from src/version2/parameters/removeGroup.ts rename to src/version2/parameters/removeGroup.mts diff --git a/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts b/src/version2/parameters/removeIssueTypeFromIssueTypeScheme.mts similarity index 100% rename from src/version2/parameters/removeIssueTypeFromIssueTypeScheme.ts rename to src/version2/parameters/removeIssueTypeFromIssueTypeScheme.mts diff --git a/src/version2/parameters/removeIssueTypesFromContext.mts b/src/version2/parameters/removeIssueTypesFromContext.mts new file mode 100644 index 0000000000..cc50dcd40f --- /dev/null +++ b/src/version2/parameters/removeIssueTypesFromContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/removeIssueTypesFromContext.ts b/src/version2/parameters/removeIssueTypesFromContext.ts deleted file mode 100644 index f8e821cc15..0000000000 --- a/src/version2/parameters/removeIssueTypesFromContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface RemoveIssueTypesFromContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts new file mode 100644 index 0000000000..f78e9be219 --- /dev/null +++ b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIdsToRemove } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts b/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts deleted file mode 100644 index fc0fc1cdd0..0000000000 --- a/src/version2/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeIdsToRemove } from '../models'; - -export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/removeLevel.ts b/src/version2/parameters/removeLevel.mts similarity index 100% rename from src/version2/parameters/removeLevel.ts rename to src/version2/parameters/removeLevel.mts diff --git a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..117d550ce6 --- /dev/null +++ b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts b/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts deleted file mode 100644 index bcf8aa10d1..0000000000 --- a/src/version2/parameters/removeMappingsFromIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/removeMemberFromSecurityLevel.ts b/src/version2/parameters/removeMemberFromSecurityLevel.mts similarity index 100% rename from src/version2/parameters/removeMemberFromSecurityLevel.ts rename to src/version2/parameters/removeMemberFromSecurityLevel.mts diff --git a/src/version2/parameters/removeModules.ts b/src/version2/parameters/removeModules.mts similarity index 100% rename from src/version2/parameters/removeModules.ts rename to src/version2/parameters/removeModules.mts diff --git a/src/version2/parameters/removeNotificationFromNotificationScheme.ts b/src/version2/parameters/removeNotificationFromNotificationScheme.mts similarity index 100% rename from src/version2/parameters/removeNotificationFromNotificationScheme.ts rename to src/version2/parameters/removeNotificationFromNotificationScheme.mts diff --git a/src/version2/parameters/removePreference.ts b/src/version2/parameters/removePreference.mts similarity index 100% rename from src/version2/parameters/removePreference.ts rename to src/version2/parameters/removePreference.mts diff --git a/src/version2/parameters/removeProjectCategory.ts b/src/version2/parameters/removeProjectCategory.mts similarity index 100% rename from src/version2/parameters/removeProjectCategory.ts rename to src/version2/parameters/removeProjectCategory.mts diff --git a/src/version2/parameters/removeScreenTabField.ts b/src/version2/parameters/removeScreenTabField.mts similarity index 100% rename from src/version2/parameters/removeScreenTabField.ts rename to src/version2/parameters/removeScreenTabField.mts diff --git a/src/version2/parameters/removeUser.ts b/src/version2/parameters/removeUser.mts similarity index 100% rename from src/version2/parameters/removeUser.ts rename to src/version2/parameters/removeUser.mts diff --git a/src/version2/parameters/removeUserFromGroup.ts b/src/version2/parameters/removeUserFromGroup.mts similarity index 100% rename from src/version2/parameters/removeUserFromGroup.ts rename to src/version2/parameters/removeUserFromGroup.mts diff --git a/src/version2/parameters/removeVote.ts b/src/version2/parameters/removeVote.mts similarity index 100% rename from src/version2/parameters/removeVote.ts rename to src/version2/parameters/removeVote.mts diff --git a/src/version2/parameters/removeWatcher.ts b/src/version2/parameters/removeWatcher.mts similarity index 100% rename from src/version2/parameters/removeWatcher.ts rename to src/version2/parameters/removeWatcher.mts diff --git a/src/version2/parameters/renameScreenTab.mts b/src/version2/parameters/renameScreenTab.mts new file mode 100644 index 0000000000..593fc37053 --- /dev/null +++ b/src/version2/parameters/renameScreenTab.mts @@ -0,0 +1,8 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface RenameScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version2/parameters/renameScreenTab.ts b/src/version2/parameters/renameScreenTab.ts deleted file mode 100644 index e9323d559c..0000000000 --- a/src/version2/parameters/renameScreenTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ScreenableTab } from '../models'; - -export interface RenameScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version2/parameters/reorderCustomFieldOptions.mts b/src/version2/parameters/reorderCustomFieldOptions.mts new file mode 100644 index 0000000000..9d2f7ff590 --- /dev/null +++ b/src/version2/parameters/reorderCustomFieldOptions.mts @@ -0,0 +1,8 @@ +import { OrderOfCustomFieldOptions } from '../models/index.mjs'; + +export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/reorderCustomFieldOptions.ts b/src/version2/parameters/reorderCustomFieldOptions.ts deleted file mode 100644 index 4e96129be5..0000000000 --- a/src/version2/parameters/reorderCustomFieldOptions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { OrderOfCustomFieldOptions } from '../models'; - -export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts new file mode 100644 index 0000000000..d9f4c60612 --- /dev/null +++ b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { OrderOfIssueTypes } from '../models/index.mjs'; + +export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts b/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts deleted file mode 100644 index 86bfa584e5..0000000000 --- a/src/version2/parameters/reorderIssueTypesInIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { OrderOfIssueTypes } from '../models'; - -export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/replaceIssueFieldOption.mts b/src/version2/parameters/replaceIssueFieldOption.mts new file mode 100644 index 0000000000..b4ea74aa71 --- /dev/null +++ b/src/version2/parameters/replaceIssueFieldOption.mts @@ -0,0 +1,28 @@ +export interface ReplaceIssueFieldOption { + /** 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; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app + * users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be deselected. */ + optionId: number; +} diff --git a/src/version2/parameters/replaceIssueFieldOption.ts b/src/version2/parameters/replaceIssueFieldOption.ts deleted file mode 100644 index f184891952..0000000000 --- a/src/version2/parameters/replaceIssueFieldOption.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ReplaceIssueFieldOption { - /** 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; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app - * users with admin permission. - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be deselected. */ - optionId: number; -} diff --git a/src/version2/parameters/resetColumns.ts b/src/version2/parameters/resetColumns.mts similarity index 100% rename from src/version2/parameters/resetColumns.ts rename to src/version2/parameters/resetColumns.mts diff --git a/src/version2/parameters/resetUserColumns.ts b/src/version2/parameters/resetUserColumns.mts similarity index 100% rename from src/version2/parameters/resetUserColumns.ts rename to src/version2/parameters/resetUserColumns.mts diff --git a/src/version2/parameters/restore.ts b/src/version2/parameters/restore.mts similarity index 100% rename from src/version2/parameters/restore.ts rename to src/version2/parameters/restore.mts diff --git a/src/version2/parameters/restoreCustomField.ts b/src/version2/parameters/restoreCustomField.mts similarity index 100% rename from src/version2/parameters/restoreCustomField.ts rename to src/version2/parameters/restoreCustomField.mts diff --git a/src/version2/parameters/sanitiseJqlQueries.mts b/src/version2/parameters/sanitiseJqlQueries.mts new file mode 100644 index 0000000000..d9517074f2 --- /dev/null +++ b/src/version2/parameters/sanitiseJqlQueries.mts @@ -0,0 +1,3 @@ +import { JqlQueriesToSanitize } from '../models/index.mjs'; + +export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version2/parameters/sanitiseJqlQueries.ts b/src/version2/parameters/sanitiseJqlQueries.ts deleted file mode 100644 index e37ef32274..0000000000 --- a/src/version2/parameters/sanitiseJqlQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JqlQueriesToSanitize } from '../models'; - -export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version2/parameters/search.ts b/src/version2/parameters/search.mts similarity index 100% rename from src/version2/parameters/search.ts rename to src/version2/parameters/search.mts diff --git a/src/version2/parameters/searchForIssuesUsingJql.mts b/src/version2/parameters/searchForIssuesUsingJql.mts new file mode 100644 index 0000000000..9b15598d8f --- /dev/null +++ b/src/version2/parameters/searchForIssuesUsingJql.mts @@ -0,0 +1,79 @@ +export interface SearchForIssuesUsingJql { + /** + * The [Jql](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + * + * If no Jql expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms + * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, + * partial matches of the email address will not find the user. An exact match is required. + */ + jql?: 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. To manage page size, Jira 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. + */ + maxResults?: number; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values are: + * + * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: 'strict' | 'warn' | 'none' | 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. + * + * 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. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + * + * 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[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + | 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, + * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** Reference fields by their key (rather than ID). */ + fieldsByKeys?: boolean; +} diff --git a/src/version2/parameters/searchForIssuesUsingJql.ts b/src/version2/parameters/searchForIssuesUsingJql.ts deleted file mode 100644 index bb85f45aeb..0000000000 --- a/src/version2/parameters/searchForIssuesUsingJql.ts +++ /dev/null @@ -1,79 +0,0 @@ -export interface SearchForIssuesUsingJql { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: - * - * If no JQL expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms - * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, - * partial matches of the email address will not find the user. An exact match is required. - */ - jql?: 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. To manage page size, Jira 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. - */ - maxResults?: number; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values are: - * - * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: 'strict' | 'warn' | 'none' | 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. - * - * 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. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. - * - * 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[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - */ - expand?: - | 'renderedFields' - | 'names' - | 'schema' - | 'transitions' - | 'operations' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | string - | 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, - * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. - */ - properties?: string[]; - /** Reference fields by their key (rather than ID). */ - fieldsByKeys?: boolean; -} diff --git a/src/version2/parameters/searchForIssuesUsingJqlPost.mts b/src/version2/parameters/searchForIssuesUsingJqlPost.mts new file mode 100644 index 0000000000..d087fe6389 --- /dev/null +++ b/src/version2/parameters/searchForIssuesUsingJqlPost.mts @@ -0,0 +1,3 @@ +import { SearchRequest } from '../models/index.mjs'; + +export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version2/parameters/searchForIssuesUsingJqlPost.ts b/src/version2/parameters/searchForIssuesUsingJqlPost.ts deleted file mode 100644 index 0ffdf3cd98..0000000000 --- a/src/version2/parameters/searchForIssuesUsingJqlPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SearchRequest } from '../models'; - -export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version2/parameters/searchPriorities.ts b/src/version2/parameters/searchPriorities.mts similarity index 100% rename from src/version2/parameters/searchPriorities.ts rename to src/version2/parameters/searchPriorities.mts diff --git a/src/version2/parameters/searchProjects.ts b/src/version2/parameters/searchProjects.mts similarity index 100% rename from src/version2/parameters/searchProjects.ts rename to src/version2/parameters/searchProjects.mts diff --git a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version2/parameters/searchProjectsUsingSecuritySchemes.mts similarity index 100% rename from src/version2/parameters/searchProjectsUsingSecuritySchemes.ts rename to src/version2/parameters/searchProjectsUsingSecuritySchemes.mts diff --git a/src/version2/parameters/searchResolutions.ts b/src/version2/parameters/searchResolutions.mts similarity index 100% rename from src/version2/parameters/searchResolutions.ts rename to src/version2/parameters/searchResolutions.mts diff --git a/src/version2/parameters/searchSecuritySchemes.ts b/src/version2/parameters/searchSecuritySchemes.mts similarity index 100% rename from src/version2/parameters/searchSecuritySchemes.ts rename to src/version2/parameters/searchSecuritySchemes.mts diff --git a/src/version2/parameters/selectTimeTrackingImplementation.mts b/src/version2/parameters/selectTimeTrackingImplementation.mts new file mode 100644 index 0000000000..bc2fb949f5 --- /dev/null +++ b/src/version2/parameters/selectTimeTrackingImplementation.mts @@ -0,0 +1,3 @@ +import { TimeTrackingProvider } from '../models/index.mjs'; + +export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version2/parameters/selectTimeTrackingImplementation.ts b/src/version2/parameters/selectTimeTrackingImplementation.ts deleted file mode 100644 index 59c88b5c88..0000000000 --- a/src/version2/parameters/selectTimeTrackingImplementation.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TimeTrackingProvider } from '../models'; - -export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version2/parameters/setActors.mts b/src/version2/parameters/setActors.mts new file mode 100644 index 0000000000..195f1ba560 --- /dev/null +++ b/src/version2/parameters/setActors.mts @@ -0,0 +1,11 @@ +import { ProjectRoleActorsUpdate } from '../models/index.mjs'; + +export interface SetActors extends ProjectRoleActorsUpdate { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * 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. + */ + id: number; +} diff --git a/src/version2/parameters/setActors.ts b/src/version2/parameters/setActors.ts deleted file mode 100644 index 9fe40f868e..0000000000 --- a/src/version2/parameters/setActors.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ProjectRoleActorsUpdate } from '../models'; - -export interface SetActors extends ProjectRoleActorsUpdate { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * 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. - */ - id: number; -} diff --git a/src/version2/parameters/setApplicationProperty.mts b/src/version2/parameters/setApplicationProperty.mts new file mode 100644 index 0000000000..a729fce3b4 --- /dev/null +++ b/src/version2/parameters/setApplicationProperty.mts @@ -0,0 +1,14 @@ +import { SimpleApplicationProperty } from '../models/index.mjs'; + +export interface SetApplicationProperty extends SimpleApplicationProperty { + /** The key of the application property to update. */ + id: string; + + body?: { + /** The ID of the application property. */ + id?: string; + + /** The new value. */ + value?: string; + }; +} diff --git a/src/version2/parameters/setApplicationProperty.ts b/src/version2/parameters/setApplicationProperty.ts deleted file mode 100644 index d10031a5c0..0000000000 --- a/src/version2/parameters/setApplicationProperty.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { SimpleApplicationProperty } from '../models'; - -export interface SetApplicationProperty extends SimpleApplicationProperty { - /** The key of the application property to update. */ - id: string; - - body?: { - /** The ID of the application property. */ - id?: string; - - /** The new value. */ - value?: string; - }; -} diff --git a/src/version2/parameters/setBanner.mts b/src/version2/parameters/setBanner.mts new file mode 100644 index 0000000000..29ff18a397 --- /dev/null +++ b/src/version2/parameters/setBanner.mts @@ -0,0 +1,3 @@ +import { AnnouncementBannerConfigurationUpdate } from '../models/index.mjs'; + +export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version2/parameters/setBanner.ts b/src/version2/parameters/setBanner.ts deleted file mode 100644 index 7cb120c52a..0000000000 --- a/src/version2/parameters/setBanner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { AnnouncementBannerConfigurationUpdate } from '../models'; - -export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version2/parameters/setColumns.ts b/src/version2/parameters/setColumns.mts similarity index 100% rename from src/version2/parameters/setColumns.ts rename to src/version2/parameters/setColumns.mts diff --git a/src/version2/parameters/setCommentProperty.ts b/src/version2/parameters/setCommentProperty.mts similarity index 100% rename from src/version2/parameters/setCommentProperty.ts rename to src/version2/parameters/setCommentProperty.mts diff --git a/src/version2/parameters/setDashboardItemProperty.ts b/src/version2/parameters/setDashboardItemProperty.mts similarity index 100% rename from src/version2/parameters/setDashboardItemProperty.ts rename to src/version2/parameters/setDashboardItemProperty.mts diff --git a/src/version2/parameters/setDefaultLevels.mts b/src/version2/parameters/setDefaultLevels.mts new file mode 100644 index 0000000000..34c8ce77b0 --- /dev/null +++ b/src/version2/parameters/setDefaultLevels.mts @@ -0,0 +1,3 @@ +import { SetDefaultLevelsRequest } from '../models/index.mjs'; + +export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version2/parameters/setDefaultLevels.ts b/src/version2/parameters/setDefaultLevels.ts deleted file mode 100644 index 5162dac472..0000000000 --- a/src/version2/parameters/setDefaultLevels.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SetDefaultLevelsRequest } from '../models'; - -export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version2/parameters/setDefaultPriority.mts b/src/version2/parameters/setDefaultPriority.mts new file mode 100644 index 0000000000..c21ba5cc6b --- /dev/null +++ b/src/version2/parameters/setDefaultPriority.mts @@ -0,0 +1,3 @@ +import { SetDefaultPriorityRequest } from '../models/index.mjs'; + +export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version2/parameters/setDefaultPriority.ts b/src/version2/parameters/setDefaultPriority.ts deleted file mode 100644 index d93aa5f6fc..0000000000 --- a/src/version2/parameters/setDefaultPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SetDefaultPriorityRequest } from '../models'; - -export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version2/parameters/setDefaultResolution.mts b/src/version2/parameters/setDefaultResolution.mts new file mode 100644 index 0000000000..7231abde60 --- /dev/null +++ b/src/version2/parameters/setDefaultResolution.mts @@ -0,0 +1,3 @@ +import { SetDefaultResolutionRequest } from '../models/index.mjs'; + +export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version2/parameters/setDefaultResolution.ts b/src/version2/parameters/setDefaultResolution.ts deleted file mode 100644 index bbf4f9259a..0000000000 --- a/src/version2/parameters/setDefaultResolution.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SetDefaultResolutionRequest } from '../models'; - -export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version2/parameters/setDefaultShareScope.mts b/src/version2/parameters/setDefaultShareScope.mts new file mode 100644 index 0000000000..f915d2df56 --- /dev/null +++ b/src/version2/parameters/setDefaultShareScope.mts @@ -0,0 +1,3 @@ +import { DefaultShareScope } from '../models/index.mjs'; + +export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version2/parameters/setDefaultShareScope.ts b/src/version2/parameters/setDefaultShareScope.ts deleted file mode 100644 index e7cb2056fb..0000000000 --- a/src/version2/parameters/setDefaultShareScope.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DefaultShareScope } from '../models'; - -export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version2/parameters/setDefaultValues.mts b/src/version2/parameters/setDefaultValues.mts new file mode 100644 index 0000000000..9359c4d779 --- /dev/null +++ b/src/version2/parameters/setDefaultValues.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValueUpdate } from '../models/index.mjs'; + +export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version2/parameters/setDefaultValues.ts b/src/version2/parameters/setDefaultValues.ts deleted file mode 100644 index 146ee52b27..0000000000 --- a/src/version2/parameters/setDefaultValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomFieldContextDefaultValueUpdate } from '../models'; - -export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version2/parameters/setFavouriteForFilter.ts b/src/version2/parameters/setFavouriteForFilter.mts similarity index 100% rename from src/version2/parameters/setFavouriteForFilter.ts rename to src/version2/parameters/setFavouriteForFilter.mts diff --git a/src/version2/parameters/setFieldConfigurationSchemeMapping.mts b/src/version2/parameters/setFieldConfigurationSchemeMapping.mts new file mode 100644 index 0000000000..a782ef41dd --- /dev/null +++ b/src/version2/parameters/setFieldConfigurationSchemeMapping.mts @@ -0,0 +1,6 @@ +import { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models/index.mjs'; + +export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version2/parameters/setFieldConfigurationSchemeMapping.ts b/src/version2/parameters/setFieldConfigurationSchemeMapping.ts deleted file mode 100644 index bcb01324a7..0000000000 --- a/src/version2/parameters/setFieldConfigurationSchemeMapping.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models'; - -export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/setIssueProperty.ts b/src/version2/parameters/setIssueProperty.mts similarity index 100% rename from src/version2/parameters/setIssueProperty.ts rename to src/version2/parameters/setIssueProperty.mts diff --git a/src/version2/parameters/setIssueTypeProperty.ts b/src/version2/parameters/setIssueTypeProperty.mts similarity index 100% rename from src/version2/parameters/setIssueTypeProperty.ts rename to src/version2/parameters/setIssueTypeProperty.mts diff --git a/src/version2/parameters/setPreference.ts b/src/version2/parameters/setPreference.mts similarity index 100% rename from src/version2/parameters/setPreference.ts rename to src/version2/parameters/setPreference.mts diff --git a/src/version2/parameters/setProjectProperty.ts b/src/version2/parameters/setProjectProperty.mts similarity index 100% rename from src/version2/parameters/setProjectProperty.ts rename to src/version2/parameters/setProjectProperty.mts diff --git a/src/version2/parameters/setSharedTimeTrackingConfiguration.mts b/src/version2/parameters/setSharedTimeTrackingConfiguration.mts new file mode 100644 index 0000000000..e97c080ff1 --- /dev/null +++ b/src/version2/parameters/setSharedTimeTrackingConfiguration.mts @@ -0,0 +1,3 @@ +import { TimeTrackingConfiguration } from '../models/index.mjs'; + +export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version2/parameters/setSharedTimeTrackingConfiguration.ts b/src/version2/parameters/setSharedTimeTrackingConfiguration.ts deleted file mode 100644 index 042570cb83..0000000000 --- a/src/version2/parameters/setSharedTimeTrackingConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TimeTrackingConfiguration } from '../models'; - -export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version2/parameters/setUserColumns.ts b/src/version2/parameters/setUserColumns.mts similarity index 100% rename from src/version2/parameters/setUserColumns.ts rename to src/version2/parameters/setUserColumns.mts diff --git a/src/version2/parameters/setUserProperty.ts b/src/version2/parameters/setUserProperty.mts similarity index 100% rename from src/version2/parameters/setUserProperty.ts rename to src/version2/parameters/setUserProperty.mts diff --git a/src/version2/parameters/setWorkflowSchemeDraftIssueType.mts b/src/version2/parameters/setWorkflowSchemeDraftIssueType.mts new file mode 100644 index 0000000000..630b5e1591 --- /dev/null +++ b/src/version2/parameters/setWorkflowSchemeDraftIssueType.mts @@ -0,0 +1,22 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + /** The name of the workflow. */ + workflow?: string; + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts b/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index 37f76bf01a..0000000000 --- a/src/version2/parameters/setWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { IssueTypeWorkflowMapping } from '../models'; - -export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - /** The name of the workflow. */ - workflow?: string; - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version2/parameters/setWorkflowSchemeIssueType.mts b/src/version2/parameters/setWorkflowSchemeIssueType.mts new file mode 100644 index 0000000000..d38a0496d1 --- /dev/null +++ b/src/version2/parameters/setWorkflowSchemeIssueType.mts @@ -0,0 +1,24 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + + /** The name of the workflow. */ + workflow?: string; + + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version2/parameters/setWorkflowSchemeIssueType.ts b/src/version2/parameters/setWorkflowSchemeIssueType.ts deleted file mode 100644 index a0896d190c..0000000000 --- a/src/version2/parameters/setWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IssueTypeWorkflowMapping } from '../models'; - -export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version2/parameters/setWorklogProperty.ts b/src/version2/parameters/setWorklogProperty.mts similarity index 100% rename from src/version2/parameters/setWorklogProperty.ts rename to src/version2/parameters/setWorklogProperty.mts diff --git a/src/version2/parameters/storeAvatar.ts b/src/version2/parameters/storeAvatar.mts similarity index 100% rename from src/version2/parameters/storeAvatar.ts rename to src/version2/parameters/storeAvatar.mts diff --git a/src/version2/parameters/toggleFeatureForProject.mts b/src/version2/parameters/toggleFeatureForProject.mts new file mode 100644 index 0000000000..3bcd5cfab8 --- /dev/null +++ b/src/version2/parameters/toggleFeatureForProject.mts @@ -0,0 +1,8 @@ +import { ProjectFeatureToggleRequest } from '../models/index.mjs'; + +export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; + /** The key of the feature. */ + featureKey: string; +} diff --git a/src/version2/parameters/toggleFeatureForProject.ts b/src/version2/parameters/toggleFeatureForProject.ts deleted file mode 100644 index c5a8fde0f7..0000000000 --- a/src/version2/parameters/toggleFeatureForProject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectFeatureToggleRequest } from '../models'; - -export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; - /** The key of the feature. */ - featureKey: string; -} diff --git a/src/version2/parameters/trashCustomField.ts b/src/version2/parameters/trashCustomField.mts similarity index 100% rename from src/version2/parameters/trashCustomField.ts rename to src/version2/parameters/trashCustomField.mts diff --git a/src/version2/parameters/unarchiveIssues.ts b/src/version2/parameters/unarchiveIssues.mts similarity index 100% rename from src/version2/parameters/unarchiveIssues.ts rename to src/version2/parameters/unarchiveIssues.mts diff --git a/src/version2/parameters/updateComment.mts b/src/version2/parameters/updateComment.mts new file mode 100644 index 0000000000..8f7af1b0f9 --- /dev/null +++ b/src/version2/parameters/updateComment.mts @@ -0,0 +1,22 @@ +import { Comment } from '../models/index.mjs'; + +export interface UpdateComment extends Comment { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the comment. */ + id: string; + /** Whether users are notified when a comment is updated. */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on + * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: 'renderedBody' | ['renderedBody'] | string | string[]; +} diff --git a/src/version2/parameters/updateComment.ts b/src/version2/parameters/updateComment.ts deleted file mode 100644 index ab97803431..0000000000 --- a/src/version2/parameters/updateComment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Comment } from '../models'; - -export interface UpdateComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - /** Whether users are notified when a comment is updated. */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on - * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: 'renderedBody' | ['renderedBody'] | string | string[]; -} diff --git a/src/version2/parameters/updateComponent.mts b/src/version2/parameters/updateComponent.mts new file mode 100644 index 0000000000..83eaa7ed4a --- /dev/null +++ b/src/version2/parameters/updateComponent.mts @@ -0,0 +1,6 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface UpdateComponent extends ProjectComponent { + /** The ID of the component. */ + id: string; +} diff --git a/src/version2/parameters/updateComponent.ts b/src/version2/parameters/updateComponent.ts deleted file mode 100644 index 8104c2388e..0000000000 --- a/src/version2/parameters/updateComponent.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ProjectComponent } from '../models'; - -export interface UpdateComponent extends ProjectComponent { - /** The ID of the component. */ - id: string; -} diff --git a/src/version2/parameters/updateCustomField.mts b/src/version2/parameters/updateCustomField.mts new file mode 100644 index 0000000000..92185635db --- /dev/null +++ b/src/version2/parameters/updateCustomField.mts @@ -0,0 +1,6 @@ +import { UpdateCustomFieldDetails } from '../models/index.mjs'; + +export interface UpdateCustomField extends UpdateCustomFieldDetails { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version2/parameters/updateCustomField.ts b/src/version2/parameters/updateCustomField.ts deleted file mode 100644 index 465a16891d..0000000000 --- a/src/version2/parameters/updateCustomField.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateCustomFieldDetails } from '../models'; - -export interface UpdateCustomField extends UpdateCustomFieldDetails { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version2/parameters/updateCustomFieldConfiguration.mts b/src/version2/parameters/updateCustomFieldConfiguration.mts new file mode 100644 index 0000000000..01de512fb9 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { CustomFieldConfigurations } from '../models/index.mjs'; + +export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { + /** The ID or key of the custom field, for example `customfield_10000`. */ + fieldIdOrKey: string; +} diff --git a/src/version2/parameters/updateCustomFieldConfiguration.ts b/src/version2/parameters/updateCustomFieldConfiguration.ts deleted file mode 100644 index e35b4fe9d3..0000000000 --- a/src/version2/parameters/updateCustomFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomFieldConfigurations } from '../models'; - -export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { - /** The ID or key of the custom field, for example `customfield_10000`. */ - fieldIdOrKey: string; -} diff --git a/src/version2/parameters/updateCustomFieldContext.mts b/src/version2/parameters/updateCustomFieldContext.mts new file mode 100644 index 0000000000..bf7f31a74b --- /dev/null +++ b/src/version2/parameters/updateCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { CustomFieldContextUpdateDetails } from '../models/index.mjs'; + +export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/updateCustomFieldContext.ts b/src/version2/parameters/updateCustomFieldContext.ts deleted file mode 100644 index ec46c0f786..0000000000 --- a/src/version2/parameters/updateCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CustomFieldContextUpdateDetails } from '../models'; - -export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/updateCustomFieldOption.mts b/src/version2/parameters/updateCustomFieldOption.mts new file mode 100644 index 0000000000..65cf799f03 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionUpdateRequest } from '../models/index.mjs'; + +export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/updateCustomFieldOption.ts b/src/version2/parameters/updateCustomFieldOption.ts deleted file mode 100644 index 04ad2a93ce..0000000000 --- a/src/version2/parameters/updateCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BulkCustomFieldOptionUpdateRequest } from '../models'; - -export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version2/parameters/updateCustomFieldValue.mts b/src/version2/parameters/updateCustomFieldValue.mts new file mode 100644 index 0000000000..cb327bfa16 --- /dev/null +++ b/src/version2/parameters/updateCustomFieldValue.mts @@ -0,0 +1,8 @@ +import { CustomFieldValueUpdateDetails } from '../models/index.mjs'; + +export interface UpdateCustomFieldValue extends CustomFieldValueUpdateDetails { + /** The ID or key of the custom field. For example, `customfield_10010`. */ + fieldIdOrKey: string; + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version2/parameters/updateCustomFieldValue.ts b/src/version2/parameters/updateCustomFieldValue.ts deleted file mode 100644 index 4bc28b4b4a..0000000000 --- a/src/version2/parameters/updateCustomFieldValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CustomFieldValueUpdateDetails } from '../models'; - -export interface UpdateCustomFieldValue extends CustomFieldValueUpdateDetails { - /** The ID or key of the custom field. For example, `customfield_10010`. */ - fieldIdOrKey: string; - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version2/parameters/updateDashboard.mts b/src/version2/parameters/updateDashboard.mts new file mode 100644 index 0000000000..e180543c87 --- /dev/null +++ b/src/version2/parameters/updateDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface UpdateDashboard extends DashboardDetails { + /** The ID of the dashboard to update. */ + id: string; +} diff --git a/src/version2/parameters/updateDashboard.ts b/src/version2/parameters/updateDashboard.ts deleted file mode 100644 index 3b01c0c2d9..0000000000 --- a/src/version2/parameters/updateDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DashboardDetails } from '../models'; - -export interface UpdateDashboard extends DashboardDetails { - /** The ID of the dashboard to update. */ - id: string; -} diff --git a/src/version2/parameters/updateDefaultScreenScheme.ts b/src/version2/parameters/updateDefaultScreenScheme.mts similarity index 100% rename from src/version2/parameters/updateDefaultScreenScheme.ts rename to src/version2/parameters/updateDefaultScreenScheme.mts diff --git a/src/version2/parameters/updateDefaultWorkflow.mts b/src/version2/parameters/updateDefaultWorkflow.mts new file mode 100644 index 0000000000..26baa37fe5 --- /dev/null +++ b/src/version2/parameters/updateDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme. */ + id: number; +} diff --git a/src/version2/parameters/updateDefaultWorkflow.ts b/src/version2/parameters/updateDefaultWorkflow.ts deleted file mode 100644 index e621a6b8d8..0000000000 --- a/src/version2/parameters/updateDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultWorkflow } from '../models'; - -export interface UpdateDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; -} diff --git a/src/version2/parameters/updateDraftDefaultWorkflow.mts b/src/version2/parameters/updateDraftDefaultWorkflow.mts new file mode 100644 index 0000000000..7ea28013a2 --- /dev/null +++ b/src/version2/parameters/updateDraftDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; +} diff --git a/src/version2/parameters/updateDraftDefaultWorkflow.ts b/src/version2/parameters/updateDraftDefaultWorkflow.ts deleted file mode 100644 index d46d69a910..0000000000 --- a/src/version2/parameters/updateDraftDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultWorkflow } from '../models'; - -export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version2/parameters/updateDraftWorkflowMapping.mts b/src/version2/parameters/updateDraftWorkflowMapping.mts new file mode 100644 index 0000000000..43a88b8ce4 --- /dev/null +++ b/src/version2/parameters/updateDraftWorkflowMapping.mts @@ -0,0 +1,8 @@ +import { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version2/parameters/updateDraftWorkflowMapping.ts b/src/version2/parameters/updateDraftWorkflowMapping.ts deleted file mode 100644 index fc3b798a72..0000000000 --- a/src/version2/parameters/updateDraftWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypesWorkflowMapping } from '../models'; - -export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/updateEntityPropertiesValue.mts b/src/version2/parameters/updateEntityPropertiesValue.mts new file mode 100644 index 0000000000..286fe02fa5 --- /dev/null +++ b/src/version2/parameters/updateEntityPropertiesValue.mts @@ -0,0 +1,22 @@ +import { EntityPropertyDetails } from '../models/index.mjs'; + +export interface UpdateEntityPropertiesValue { + /** The app migration transfer ID. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; + /** The type indicating the object that contains the entity properties. */ + entityType: + | 'IssueProperty' + | 'CommentProperty' + | 'DashboardItemProperty' + | 'IssueTypeProperty' + | 'ProjectProperty' + | 'UserProperty' + | 'WorklogProperty' + | 'BoardProperty' + | 'SprintProperty' + | string; + + entities?: Array; +} diff --git a/src/version2/parameters/updateEntityPropertiesValue.ts b/src/version2/parameters/updateEntityPropertiesValue.ts deleted file mode 100644 index a77752c863..0000000000 --- a/src/version2/parameters/updateEntityPropertiesValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { EntityPropertyDetails } from '../models'; - -export interface UpdateEntityPropertiesValue { - /** The app migration transfer ID. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; - /** The type indicating the object that contains the entity properties. */ - entityType: - | 'IssueProperty' - | 'CommentProperty' - | 'DashboardItemProperty' - | 'IssueTypeProperty' - | 'ProjectProperty' - | 'UserProperty' - | 'WorklogProperty' - | 'BoardProperty' - | 'SprintProperty' - | string; - - entities?: Array; -} diff --git a/src/version2/parameters/updateFieldConfiguration.mts b/src/version2/parameters/updateFieldConfiguration.mts new file mode 100644 index 0000000000..6c0eebad89 --- /dev/null +++ b/src/version2/parameters/updateFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfiguration extends FieldConfigurationDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version2/parameters/updateFieldConfiguration.ts b/src/version2/parameters/updateFieldConfiguration.ts deleted file mode 100644 index bf2ff15f57..0000000000 --- a/src/version2/parameters/updateFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FieldConfigurationDetails } from '../models'; - -export interface UpdateFieldConfiguration extends FieldConfigurationDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationItems.mts b/src/version2/parameters/updateFieldConfigurationItems.mts new file mode 100644 index 0000000000..da43ec28ad --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationItems.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationItemsDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version2/parameters/updateFieldConfigurationItems.ts b/src/version2/parameters/updateFieldConfigurationItems.ts deleted file mode 100644 index f630610c79..0000000000 --- a/src/version2/parameters/updateFieldConfigurationItems.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FieldConfigurationItemsDetails } from '../models'; - -export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version2/parameters/updateFieldConfigurationScheme.mts b/src/version2/parameters/updateFieldConfigurationScheme.mts new file mode 100644 index 0000000000..da4f130a39 --- /dev/null +++ b/src/version2/parameters/updateFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version2/parameters/updateFieldConfigurationScheme.ts b/src/version2/parameters/updateFieldConfigurationScheme.ts deleted file mode 100644 index 2cf81d6e6c..0000000000 --- a/src/version2/parameters/updateFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateFieldConfigurationSchemeDetails } from '../models'; - -export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version2/parameters/updateFilter.mts b/src/version2/parameters/updateFilter.mts new file mode 100644 index 0000000000..b0951784df --- /dev/null +++ b/src/version2/parameters/updateFilter.mts @@ -0,0 +1,25 @@ +import { Filter } from '../models/index.mjs'; + +export interface UpdateFilter extends Omit { + /** The ID of the filter to update. */ + id: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't + * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of + * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to + * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version2/parameters/updateFilter.ts b/src/version2/parameters/updateFilter.ts deleted file mode 100644 index 2c63d15323..0000000000 --- a/src/version2/parameters/updateFilter.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Filter } from '../models'; - -export interface UpdateFilter extends Omit { - /** The ID of the filter to update. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version2/parameters/updateGadget.mts b/src/version2/parameters/updateGadget.mts new file mode 100644 index 0000000000..f6b2c56f8e --- /dev/null +++ b/src/version2/parameters/updateGadget.mts @@ -0,0 +1,8 @@ +import { DashboardGadgetUpdateRequest } from '../models/index.mjs'; + +export interface UpdateGadget extends DashboardGadgetUpdateRequest { + /** The ID of the dashboard. */ + dashboardId: number; + /** The ID of the gadget. */ + gadgetId: number; +} diff --git a/src/version2/parameters/updateGadget.ts b/src/version2/parameters/updateGadget.ts deleted file mode 100644 index 85df7bdfcf..0000000000 --- a/src/version2/parameters/updateGadget.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { DashboardGadgetUpdateRequest } from '../models'; - -export interface UpdateGadget extends DashboardGadgetUpdateRequest { - /** The ID of the dashboard. */ - dashboardId: number; - /** The ID of the gadget. */ - gadgetId: number; -} diff --git a/src/version2/parameters/updateIssueFieldOption.mts b/src/version2/parameters/updateIssueFieldOption.mts new file mode 100644 index 0000000000..ac4c227db7 --- /dev/null +++ b/src/version2/parameters/updateIssueFieldOption.mts @@ -0,0 +1,16 @@ +import { IssueFieldOption } from '../models/index.mjs'; + +export interface UpdateIssueFieldOption extends IssueFieldOption { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be updated. */ + optionId: number; +} diff --git a/src/version2/parameters/updateIssueFieldOption.ts b/src/version2/parameters/updateIssueFieldOption.ts deleted file mode 100644 index 70f9af5fd6..0000000000 --- a/src/version2/parameters/updateIssueFieldOption.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IssueFieldOption } from '../models'; - -export interface UpdateIssueFieldOption extends IssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-2-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be updated. */ - optionId: number; -} diff --git a/src/version2/parameters/updateIssueFields.mts b/src/version2/parameters/updateIssueFields.mts new file mode 100644 index 0000000000..2928b6b9ba --- /dev/null +++ b/src/version2/parameters/updateIssueFields.mts @@ -0,0 +1,8 @@ +import { ConnectCustomFieldValues } from '../models/index.mjs'; + +export interface UpdateIssueFields extends ConnectCustomFieldValues { + /** The ID of the transfer. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; +} diff --git a/src/version2/parameters/updateIssueFields.ts b/src/version2/parameters/updateIssueFields.ts deleted file mode 100644 index 94f32c8e2d..0000000000 --- a/src/version2/parameters/updateIssueFields.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ConnectCustomFieldValues } from '../models'; - -export interface UpdateIssueFields extends ConnectCustomFieldValues { - /** The ID of the transfer. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; -} diff --git a/src/version2/parameters/updateIssueLinkType.mts b/src/version2/parameters/updateIssueLinkType.mts new file mode 100644 index 0000000000..2dcdc0b236 --- /dev/null +++ b/src/version2/parameters/updateIssueLinkType.mts @@ -0,0 +1,6 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface UpdateIssueLinkType extends IssueLinkType { + /** The ID of the issue link type. */ + issueLinkTypeId: string; +} diff --git a/src/version2/parameters/updateIssueLinkType.ts b/src/version2/parameters/updateIssueLinkType.ts deleted file mode 100644 index be02787442..0000000000 --- a/src/version2/parameters/updateIssueLinkType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueLinkType } from '../models'; - -export interface UpdateIssueLinkType extends IssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version2/parameters/updateIssueSecurityScheme.mts b/src/version2/parameters/updateIssueSecurityScheme.mts new file mode 100644 index 0000000000..d7a3840987 --- /dev/null +++ b/src/version2/parameters/updateIssueSecurityScheme.mts @@ -0,0 +1,6 @@ +import { UpdateIssueSecuritySchemeRequest } from '../models/index.mjs'; + +export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { + /** The ID of the issue security scheme. */ + id: string; +} diff --git a/src/version2/parameters/updateIssueSecurityScheme.ts b/src/version2/parameters/updateIssueSecurityScheme.ts deleted file mode 100644 index a8487768b9..0000000000 --- a/src/version2/parameters/updateIssueSecurityScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateIssueSecuritySchemeRequest } from '../models'; - -export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { - /** The ID of the issue security scheme. */ - id: string; -} diff --git a/src/version2/parameters/updateIssueType.mts b/src/version2/parameters/updateIssueType.mts new file mode 100644 index 0000000000..9346646057 --- /dev/null +++ b/src/version2/parameters/updateIssueType.mts @@ -0,0 +1,6 @@ +import { IssueTypeUpdate } from '../models/index.mjs'; + +export interface UpdateIssueType extends IssueTypeUpdate { + /** The ID of the issue type. */ + id: string; +} diff --git a/src/version2/parameters/updateIssueType.ts b/src/version2/parameters/updateIssueType.ts deleted file mode 100644 index 36c90e58da..0000000000 --- a/src/version2/parameters/updateIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeUpdate } from '../models'; - -export interface UpdateIssueType extends IssueTypeUpdate { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version2/parameters/updateIssueTypeScheme.mts b/src/version2/parameters/updateIssueTypeScheme.mts new file mode 100644 index 0000000000..c968a35bdf --- /dev/null +++ b/src/version2/parameters/updateIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version2/parameters/updateIssueTypeScheme.ts b/src/version2/parameters/updateIssueTypeScheme.ts deleted file mode 100644 index b8113455b8..0000000000 --- a/src/version2/parameters/updateIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeSchemeUpdateDetails } from '../models'; - -export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version2/parameters/updateIssueTypeScreenScheme.mts b/src/version2/parameters/updateIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..c13563a8ad --- /dev/null +++ b/src/version2/parameters/updateIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version2/parameters/updateIssueTypeScreenScheme.ts b/src/version2/parameters/updateIssueTypeScreenScheme.ts deleted file mode 100644 index 80d59930ee..0000000000 --- a/src/version2/parameters/updateIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeScreenSchemeUpdateDetails } from '../models'; - -export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version2/parameters/updateMultipleCustomFieldValues.mts b/src/version2/parameters/updateMultipleCustomFieldValues.mts new file mode 100644 index 0000000000..cc7672a3d4 --- /dev/null +++ b/src/version2/parameters/updateMultipleCustomFieldValues.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdateDetails } from '../models/index.mjs'; + +export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version2/parameters/updateMultipleCustomFieldValues.ts b/src/version2/parameters/updateMultipleCustomFieldValues.ts deleted file mode 100644 index 7bbb86abda..0000000000 --- a/src/version2/parameters/updateMultipleCustomFieldValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MultipleCustomFieldValuesUpdateDetails } from '../models'; - -export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version2/parameters/updateNotificationScheme.mts b/src/version2/parameters/updateNotificationScheme.mts new file mode 100644 index 0000000000..5374c83b01 --- /dev/null +++ b/src/version2/parameters/updateNotificationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { + /** The ID of the notification scheme. */ + id: string; +} diff --git a/src/version2/parameters/updateNotificationScheme.ts b/src/version2/parameters/updateNotificationScheme.ts deleted file mode 100644 index 683066156a..0000000000 --- a/src/version2/parameters/updateNotificationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateNotificationSchemeDetails } from '../models'; - -export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { - /** The ID of the notification scheme. */ - id: string; -} diff --git a/src/version2/parameters/updatePermissionScheme.mts b/src/version2/parameters/updatePermissionScheme.mts new file mode 100644 index 0000000000..0cd431f69c --- /dev/null +++ b/src/version2/parameters/updatePermissionScheme.mts @@ -0,0 +1,16 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface UpdatePermissionScheme extends PermissionScheme { + /** The ID of the permission scheme to update. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `all` Returns all expandable information. `field` Returns information about the custom field granted the + * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all + * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the + * permission. `user` Returns information about the user who is granted the permission. + */ + expand?: string; +} diff --git a/src/version2/parameters/updatePermissionScheme.ts b/src/version2/parameters/updatePermissionScheme.ts deleted file mode 100644 index 18d840a77d..0000000000 --- a/src/version2/parameters/updatePermissionScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PermissionScheme } from '../models'; - -export interface UpdatePermissionScheme extends PermissionScheme { - /** The ID of the permission scheme to update. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version2/parameters/updatePrecomputations.mts b/src/version2/parameters/updatePrecomputations.mts new file mode 100644 index 0000000000..6b7b3a1d47 --- /dev/null +++ b/src/version2/parameters/updatePrecomputations.mts @@ -0,0 +1,3 @@ +import { JqlFunctionPrecomputationUpdateRequest } from '../models/index.mjs'; + +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version2/parameters/updatePrecomputations.ts b/src/version2/parameters/updatePrecomputations.ts deleted file mode 100644 index ecf83b9aaf..0000000000 --- a/src/version2/parameters/updatePrecomputations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JqlFunctionPrecomputationUpdateRequest } from '../models'; - -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version2/parameters/updatePriority.mts b/src/version2/parameters/updatePriority.mts new file mode 100644 index 0000000000..bb6d71864d --- /dev/null +++ b/src/version2/parameters/updatePriority.mts @@ -0,0 +1,6 @@ +import { UpdatePriorityDetails } from '../models/index.mjs'; + +export interface UpdatePriority extends UpdatePriorityDetails { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version2/parameters/updatePriority.ts b/src/version2/parameters/updatePriority.ts deleted file mode 100644 index 40ea2baab0..0000000000 --- a/src/version2/parameters/updatePriority.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdatePriorityDetails } from '../models'; - -export interface UpdatePriority extends UpdatePriorityDetails { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version2/parameters/updateProject.mts b/src/version2/parameters/updateProject.mts new file mode 100644 index 0000000000..22500816d8 --- /dev/null +++ b/src/version2/parameters/updateProject.mts @@ -0,0 +1,57 @@ +import { UpdateProjectDetails } from '../models/index.mjs'; + +export interface UpdateProject extends UpdateProjectDetails { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which + * defines the application-specific feature set. If you don't specify the project template you have to specify the + * project type. + */ + projectTypeKey?: 'business' | 'service_desk' | 'software' | string; + /** + * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the + * `projectTypeKey`. + */ + projectTemplateKey?: + | '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' + | '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-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.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' + | 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. Note that the project description, + * issue types, and project lead are included in all responses by default. Expand options include: + * + * - `description` The project description. + * - `issueTypes` The issue types associated with the project. + * - `lead` The project lead. + * - `projectKeys` All project keys associated with the project. + */ + expand?: + | 'description' + | 'issueTypes' + | 'lead' + | 'projectKeys' + | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] + | string + | string[]; +} diff --git a/src/version2/parameters/updateProject.ts b/src/version2/parameters/updateProject.ts deleted file mode 100644 index 6f4369d9f2..0000000000 --- a/src/version2/parameters/updateProject.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { UpdateProjectDetails } from '../models'; - -export interface UpdateProject extends UpdateProjectDetails { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which - * defines the application-specific feature set. If you don't specify the project template you have to specify the - * project type. - */ - projectTypeKey?: 'business' | 'service_desk' | 'software' | string; - /** - * A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the - * `projectTypeKey`. - */ - projectTemplateKey?: - | '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' - | '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-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.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' - | 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. Note that the project description, - * issue types, and project lead are included in all responses by default. Expand options include: - * - * - `description` The project description. - * - `issueTypes` The issue types associated with the project. - * - `lead` The project lead. - * - `projectKeys` All project keys associated with the project. - */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] - | string - | string[]; -} diff --git a/src/version2/parameters/updateProjectAvatar.mts b/src/version2/parameters/updateProjectAvatar.mts new file mode 100644 index 0000000000..5759946c9e --- /dev/null +++ b/src/version2/parameters/updateProjectAvatar.mts @@ -0,0 +1,6 @@ +import { Avatar } from '../models/index.mjs'; + +export interface UpdateProjectAvatar extends Avatar { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/updateProjectAvatar.ts b/src/version2/parameters/updateProjectAvatar.ts deleted file mode 100644 index d31b4ca4b6..0000000000 --- a/src/version2/parameters/updateProjectAvatar.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Avatar } from '../models'; - -export interface UpdateProjectAvatar extends Avatar { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; -} diff --git a/src/version2/parameters/updateProjectCategory.mts b/src/version2/parameters/updateProjectCategory.mts new file mode 100644 index 0000000000..5518f22fd3 --- /dev/null +++ b/src/version2/parameters/updateProjectCategory.mts @@ -0,0 +1,5 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface UpdateProjectCategory extends Omit { + id: number; +} diff --git a/src/version2/parameters/updateProjectCategory.ts b/src/version2/parameters/updateProjectCategory.ts deleted file mode 100644 index 46ab828509..0000000000 --- a/src/version2/parameters/updateProjectCategory.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ProjectCategory } from '../models'; - -export interface UpdateProjectCategory extends Omit { - id: number; -} diff --git a/src/version2/parameters/updateProjectEmail.mts b/src/version2/parameters/updateProjectEmail.mts new file mode 100644 index 0000000000..fcf15aabbf --- /dev/null +++ b/src/version2/parameters/updateProjectEmail.mts @@ -0,0 +1,6 @@ +import { ProjectEmailAddress } from '../models/index.mjs'; + +export interface UpdateProjectEmail extends ProjectEmailAddress { + /** The project ID. */ + projectId: number; +} diff --git a/src/version2/parameters/updateProjectEmail.ts b/src/version2/parameters/updateProjectEmail.ts deleted file mode 100644 index c3bf7237a2..0000000000 --- a/src/version2/parameters/updateProjectEmail.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ProjectEmailAddress } from '../models'; - -export interface UpdateProjectEmail extends ProjectEmailAddress { - /** The project ID. */ - projectId: number; -} diff --git a/src/version2/parameters/updateRemoteIssueLink.mts b/src/version2/parameters/updateRemoteIssueLink.mts new file mode 100644 index 0000000000..5d0702075a --- /dev/null +++ b/src/version2/parameters/updateRemoteIssueLink.mts @@ -0,0 +1,8 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the remote issue link. */ + linkId: string; +} diff --git a/src/version2/parameters/updateRemoteIssueLink.ts b/src/version2/parameters/updateRemoteIssueLink.ts deleted file mode 100644 index 4faccd1a03..0000000000 --- a/src/version2/parameters/updateRemoteIssueLink.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { RemoteIssueLinkRequest } from '../models'; - -export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the remote issue link. */ - linkId: string; -} diff --git a/src/version2/parameters/updateResolution.mts b/src/version2/parameters/updateResolution.mts new file mode 100644 index 0000000000..0bbc9d1cd1 --- /dev/null +++ b/src/version2/parameters/updateResolution.mts @@ -0,0 +1,6 @@ +import { UpdateResolutionDetails } from '../models/index.mjs'; + +export interface UpdateResolution extends UpdateResolutionDetails { + /** The ID of the issue resolution. */ + id: string; +} diff --git a/src/version2/parameters/updateResolution.ts b/src/version2/parameters/updateResolution.ts deleted file mode 100644 index 678c7cff19..0000000000 --- a/src/version2/parameters/updateResolution.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateResolutionDetails } from '../models'; - -export interface UpdateResolution extends UpdateResolutionDetails { - /** The ID of the issue resolution. */ - id: string; -} diff --git a/src/version2/parameters/updateScreen.mts b/src/version2/parameters/updateScreen.mts new file mode 100644 index 0000000000..70c1100c06 --- /dev/null +++ b/src/version2/parameters/updateScreen.mts @@ -0,0 +1,6 @@ +import { UpdateScreenDetails } from '../models/index.mjs'; + +export interface UpdateScreen extends UpdateScreenDetails { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version2/parameters/updateScreen.ts b/src/version2/parameters/updateScreen.ts deleted file mode 100644 index 64dd0d6e10..0000000000 --- a/src/version2/parameters/updateScreen.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateScreenDetails } from '../models'; - -export interface UpdateScreen extends UpdateScreenDetails { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version2/parameters/updateScreenScheme.mts b/src/version2/parameters/updateScreenScheme.mts new file mode 100644 index 0000000000..023292e8a3 --- /dev/null +++ b/src/version2/parameters/updateScreenScheme.mts @@ -0,0 +1,6 @@ +import { UpdateScreenSchemeDetails } from '../models/index.mjs'; + +export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { + /** The ID of the screen scheme. */ + screenSchemeId: string; +} diff --git a/src/version2/parameters/updateScreenScheme.ts b/src/version2/parameters/updateScreenScheme.ts deleted file mode 100644 index e3048bd29a..0000000000 --- a/src/version2/parameters/updateScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateScreenSchemeDetails } from '../models'; - -export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version2/parameters/updateSecurityLevel.mts b/src/version2/parameters/updateSecurityLevel.mts new file mode 100644 index 0000000000..f7764e51c2 --- /dev/null +++ b/src/version2/parameters/updateSecurityLevel.mts @@ -0,0 +1,8 @@ +import { UpdateIssueSecurityLevelDetails } from '../models/index.mjs'; + +export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { + /** The ID of the issue security scheme level belongs to. */ + schemeId: string; + /** The ID of the issue security level to update. */ + levelId: string; +} diff --git a/src/version2/parameters/updateSecurityLevel.ts b/src/version2/parameters/updateSecurityLevel.ts deleted file mode 100644 index 0ae179629d..0000000000 --- a/src/version2/parameters/updateSecurityLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { UpdateIssueSecurityLevelDetails } from '../models'; - -export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { - /** The ID of the issue security scheme level belongs to. */ - schemeId: string; - /** The ID of the issue security level to update. */ - levelId: string; -} diff --git a/src/version2/parameters/updateStatuses.mts b/src/version2/parameters/updateStatuses.mts new file mode 100644 index 0000000000..7e701dc090 --- /dev/null +++ b/src/version2/parameters/updateStatuses.mts @@ -0,0 +1,3 @@ +import { StatusUpdateRequest } from '../models/index.mjs'; + +export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version2/parameters/updateStatuses.ts b/src/version2/parameters/updateStatuses.ts deleted file mode 100644 index ed7e1b8f9a..0000000000 --- a/src/version2/parameters/updateStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StatusUpdateRequest } from '../models'; - -export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version2/parameters/updateUiModification.mts b/src/version2/parameters/updateUiModification.mts new file mode 100644 index 0000000000..c8610f2855 --- /dev/null +++ b/src/version2/parameters/updateUiModification.mts @@ -0,0 +1,6 @@ +import { UpdateUiModificationDetails } from '../models/index.mjs'; + +export interface UpdateUiModification extends UpdateUiModificationDetails { + /** The ID of the UI modification. */ + uiModificationId: string; +} diff --git a/src/version2/parameters/updateUiModification.ts b/src/version2/parameters/updateUiModification.ts deleted file mode 100644 index 29ccd69c3b..0000000000 --- a/src/version2/parameters/updateUiModification.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateUiModificationDetails } from '../models'; - -export interface UpdateUiModification extends UpdateUiModificationDetails { - /** The ID of the UI modification. */ - uiModificationId: string; -} diff --git a/src/version2/parameters/updateVersion.mts b/src/version2/parameters/updateVersion.mts new file mode 100644 index 0000000000..738c6cd15a --- /dev/null +++ b/src/version2/parameters/updateVersion.mts @@ -0,0 +1,6 @@ +import { Version } from '../models/index.mjs'; + +export interface UpdateVersion extends Version { + /** The ID of the version. */ + id: string; +} diff --git a/src/version2/parameters/updateVersion.ts b/src/version2/parameters/updateVersion.ts deleted file mode 100644 index b455a17fb7..0000000000 --- a/src/version2/parameters/updateVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Version } from '../models'; - -export interface UpdateVersion extends Version { - /** The ID of the version. */ - id: string; -} diff --git a/src/version2/parameters/updateWorkflowMapping.mts b/src/version2/parameters/updateWorkflowMapping.mts new file mode 100644 index 0000000000..5d533f3694 --- /dev/null +++ b/src/version2/parameters/updateWorkflowMapping.mts @@ -0,0 +1,8 @@ +import { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version2/parameters/updateWorkflowMapping.ts b/src/version2/parameters/updateWorkflowMapping.ts deleted file mode 100644 index d8a0642fb1..0000000000 --- a/src/version2/parameters/updateWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypesWorkflowMapping } from '../models'; - -export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version2/parameters/updateWorkflowScheme.mts b/src/version2/parameters/updateWorkflowScheme.mts new file mode 100644 index 0000000000..0311bfff13 --- /dev/null +++ b/src/version2/parameters/updateWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowScheme extends WorkflowScheme { + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: number; +} diff --git a/src/version2/parameters/updateWorkflowScheme.ts b/src/version2/parameters/updateWorkflowScheme.ts deleted file mode 100644 index ba20697efe..0000000000 --- a/src/version2/parameters/updateWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { WorkflowScheme } from '../models'; - -export interface UpdateWorkflowScheme extends WorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; -} diff --git a/src/version2/parameters/updateWorkflowSchemeDraft.mts b/src/version2/parameters/updateWorkflowSchemeDraft.mts new file mode 100644 index 0000000000..ba6eca7275 --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeDraft.mts @@ -0,0 +1,6 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { + /** The ID of the active workflow scheme that the draft was created from. */ + id: number; +} diff --git a/src/version2/parameters/updateWorkflowSchemeDraft.ts b/src/version2/parameters/updateWorkflowSchemeDraft.ts deleted file mode 100644 index 5007161471..0000000000 --- a/src/version2/parameters/updateWorkflowSchemeDraft.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { WorkflowScheme } from '../models'; - -export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version2/parameters/updateWorkflowTransitionProperty.mts b/src/version2/parameters/updateWorkflowTransitionProperty.mts new file mode 100644 index 0000000000..191f633ea2 --- /dev/null +++ b/src/version2/parameters/updateWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version2/parameters/updateWorkflowTransitionProperty.ts b/src/version2/parameters/updateWorkflowTransitionProperty.ts deleted file mode 100644 index 0afd501a38..0000000000 --- a/src/version2/parameters/updateWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { WorkflowTransitionProperty } from '../models'; - -export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being updated, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 0000000000..2aa7613b06 --- /dev/null +++ b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import { WorkflowTransitionRulesUpdate } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts b/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 7db5f74cdd..0000000000 --- a/src/version2/parameters/updateWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowTransitionRulesUpdate } from '../models'; - -export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version2/parameters/updateWorkflows.mts b/src/version2/parameters/updateWorkflows.mts new file mode 100644 index 0000000000..5b8603616d --- /dev/null +++ b/src/version2/parameters/updateWorkflows.mts @@ -0,0 +1,12 @@ +import { WorkflowUpdateRequest } from '../models/index.mjs'; + +export interface UpdateWorkflows extends WorkflowUpdateRequest { + /** + * 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/updateWorkflows.ts b/src/version2/parameters/updateWorkflows.ts deleted file mode 100644 index e569bc2e6b..0000000000 --- a/src/version2/parameters/updateWorkflows.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { WorkflowUpdateRequest } from '../models'; - -export interface UpdateWorkflows extends WorkflowUpdateRequest { - /** - * 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/updateWorklog.mts b/src/version2/parameters/updateWorklog.mts new file mode 100644 index 0000000000..6b94c12a5b --- /dev/null +++ b/src/version2/parameters/updateWorklog.mts @@ -0,0 +1,35 @@ +import { Worklog } from '../models/index.mjs'; + +export interface UpdateWorklog extends Worklog { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** The ID of the worklog. */ + id: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or + * `timeSpentSeconds`. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue + * is closed. Connect and Forge app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/updateWorklog.ts b/src/version2/parameters/updateWorklog.ts deleted file mode 100644 index aa231369bd..0000000000 --- a/src/version2/parameters/updateWorklog.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Worklog } from '../models'; - -export interface UpdateWorklog extends Worklog { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or - * `timeSpentSeconds`. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. - */ - expand?: string; - /** - * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue - * is closed. Connect and Forge app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version2/parameters/validateCreateWorkflows.mts b/src/version2/parameters/validateCreateWorkflows.mts new file mode 100644 index 0000000000..d3483e07cc --- /dev/null +++ b/src/version2/parameters/validateCreateWorkflows.mts @@ -0,0 +1,6 @@ +import { ValidationOptionsForCreate, WorkflowCreateRequest } from '../models/index.mjs'; + +export interface ValidateCreateWorkflows { + payload: WorkflowCreateRequest; + validationOptions?: ValidationOptionsForCreate; +} diff --git a/src/version2/parameters/validateCreateWorkflows.ts b/src/version2/parameters/validateCreateWorkflows.ts deleted file mode 100644 index c8eddb187e..0000000000 --- a/src/version2/parameters/validateCreateWorkflows.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ValidationOptionsForCreate, WorkflowCreateRequest } from '../models'; - -export interface ValidateCreateWorkflows { - payload: WorkflowCreateRequest; - validationOptions?: ValidationOptionsForCreate; -} diff --git a/src/version2/parameters/validateProjectKey.ts b/src/version2/parameters/validateProjectKey.mts similarity index 100% rename from src/version2/parameters/validateProjectKey.ts rename to src/version2/parameters/validateProjectKey.mts diff --git a/src/version2/parameters/validateUpdateWorkflows.mts b/src/version2/parameters/validateUpdateWorkflows.mts new file mode 100644 index 0000000000..17347e2cf5 --- /dev/null +++ b/src/version2/parameters/validateUpdateWorkflows.mts @@ -0,0 +1,6 @@ +import { ValidationOptionsForUpdate, WorkflowUpdateRequest } from '../models/index.mjs'; + +export interface ValidateUpdateWorkflows { + payload: WorkflowUpdateRequest; + validationOptions?: ValidationOptionsForUpdate; +} diff --git a/src/version2/parameters/validateUpdateWorkflows.ts b/src/version2/parameters/validateUpdateWorkflows.ts deleted file mode 100644 index 53e67051f5..0000000000 --- a/src/version2/parameters/validateUpdateWorkflows.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ValidationOptionsForUpdate, WorkflowUpdateRequest } from '../models'; - -export interface ValidateUpdateWorkflows { - payload: WorkflowUpdateRequest; - validationOptions?: ValidationOptionsForUpdate; -} diff --git a/src/version2/parameters/workflowCapabilities.ts b/src/version2/parameters/workflowCapabilities.mts similarity index 100% rename from src/version2/parameters/workflowCapabilities.ts rename to src/version2/parameters/workflowCapabilities.mts diff --git a/src/version2/parameters/workflowRuleSearch.mts b/src/version2/parameters/workflowRuleSearch.mts new file mode 100644 index 0000000000..65b1dc2746 --- /dev/null +++ b/src/version2/parameters/workflowRuleSearch.mts @@ -0,0 +1,6 @@ +import { WorkflowRulesSearch } from '../models/index.mjs'; + +export interface WorkflowRuleSearch extends WorkflowRulesSearch { + /** The app migration transfer ID. */ + transferId: string; +} diff --git a/src/version2/parameters/workflowRuleSearch.ts b/src/version2/parameters/workflowRuleSearch.ts deleted file mode 100644 index 85fbfa37db..0000000000 --- a/src/version2/parameters/workflowRuleSearch.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { WorkflowRulesSearch } from '../models'; - -export interface WorkflowRuleSearch extends WorkflowRulesSearch { - /** The app migration transfer ID. */ - transferId: string; -} diff --git a/src/version2/permissionSchemes.mts b/src/version2/permissionSchemes.mts new file mode 100644 index 0000000000..7a69992463 --- /dev/null +++ b/src/version2/permissionSchemes.mts @@ -0,0 +1,560 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class PermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * 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: + * + * - `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 + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters: Parameters.GetAllPermissionSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * 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: + * + * - `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 + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: never, + ): Promise; + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissionscheme', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters: Parameters.CreatePermissionScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: never, + ): Promise; + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissionscheme', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ...parameters, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme | string, + callback?: never, + ): Promise; + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme | string, + callback?: Callback, + ): Promise { + const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; + + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${schemeId}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback: Callback, + ): Promise; + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: never, + ): Promise; + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + ...parameters, + schemeId: undefined, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission 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 deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback: Callback, + ): Promise; + /** + * Deletes a permission 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 deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; + async deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback: Callback, + ): Promise; + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: never, + ): Promise; + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a permission grant in a permission 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 createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback: Callback, + ): Promise; + /** + * Creates a permission grant in a permission 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 createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: never, + ): Promise; + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + self: parameters.self, + holder: parameters.holder, + permission: parameters.permission, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback: Callback, + ): Promise; + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: never, + ): Promise; + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback: Callback, + ): Promise; + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: never, + ): Promise; + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts deleted file mode 100644 index 631207f262..0000000000 --- a/src/version2/permissionSchemes.ts +++ /dev/null @@ -1,560 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class PermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * 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: - * - * - `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 - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters: Parameters.GetAllPermissionSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * 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: - * - * - `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 - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: never, - ): Promise; - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissionscheme', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters: Parameters.CreatePermissionScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: never, - ): Promise; - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissionscheme', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ...parameters, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback?: never, - ): Promise; - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme | string, - callback?: Callback, - ): Promise { - const schemeId = typeof parameters === 'string' ? parameters : parameters.schemeId; - - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${schemeId}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback: Callback, - ): Promise; - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-2-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-2-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: never, - ): Promise; - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - ...parameters, - schemeId: undefined, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission 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 deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback: Callback, - ): Promise; - /** - * Deletes a permission 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 deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback: Callback, - ): Promise; - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: never, - ): Promise; - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a permission grant in a permission 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 createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback: Callback, - ): Promise; - /** - * Creates a permission grant in a permission 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 createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: never, - ): Promise; - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - self: parameters.self, - holder: parameters.holder, - permission: parameters.permission, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback: Callback, - ): Promise; - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: never, - ): Promise; - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback: Callback, - ): Promise; - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: never, - ): Promise; - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/permissions.mts b/src/version2/permissions.mts new file mode 100644 index 0000000000..9fe49f0634 --- /dev/null +++ b/src/version2/permissions.mts @@ -0,0 +1,236 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Permissions { + constructor(private client: Client) {} + + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * 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. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters: Parameters.GetMyPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * 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. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: never, + ): Promise; + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/mypermissions', + method: 'GET', + params: { + projectKey: parameters?.projectKey, + projectId: parameters?.projectId, + issueKey: parameters?.issueKey, + issueId: parameters?.issueId, + permissions: parameters?.permissions, + projectUuid: parameters?.projectUuid, + projectConfigurationUuid: parameters?.projectConfigurationUuid, + commentId: parameters?.commentId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permissions, including: + * + * - Global 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). + */ + async getAllPermissions(callback: Callback): Promise; + /** + * Returns all permissions, including: + * + * - Global 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). + */ + async getAllPermissions(callback?: never): Promise; + async getAllPermissions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissions', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters: Parameters.GetBulkPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: never, + ): Promise; + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissions/check', + method: 'POST', + data: { + projectPermissions: parameters?.projectPermissions, + globalPermissions: parameters?.globalPermissions, + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters: Parameters.GetPermittedProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: never, + ): Promise; + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/permissions/project', + method: 'POST', + data: { + permissions: parameters?.permissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/permissions.ts b/src/version2/permissions.ts deleted file mode 100644 index d99162674a..0000000000 --- a/src/version2/permissions.ts +++ /dev/null @@ -1,236 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Permissions { - constructor(private client: Client) {} - - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * 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. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters: Parameters.GetMyPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * 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. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: never, - ): Promise; - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/mypermissions', - method: 'GET', - params: { - projectKey: parameters?.projectKey, - projectId: parameters?.projectId, - issueKey: parameters?.issueKey, - issueId: parameters?.issueId, - permissions: parameters?.permissions, - projectUuid: parameters?.projectUuid, - projectConfigurationUuid: parameters?.projectConfigurationUuid, - commentId: parameters?.commentId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permissions, including: - * - * - Global 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). - */ - async getAllPermissions(callback: Callback): Promise; - /** - * Returns all permissions, including: - * - * - Global 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). - */ - async getAllPermissions(callback?: never): Promise; - async getAllPermissions(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissions', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters: Parameters.GetBulkPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: never, - ): Promise; - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissions/check', - method: 'POST', - data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters: Parameters.GetPermittedProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: never, - ): Promise; - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/permissions/project', - method: 'POST', - data: { - permissions: parameters?.permissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectAvatars.mts b/src/version2/projectAvatars.mts new file mode 100644 index 0000000000..2f853f10b6 --- /dev/null +++ b/src/version2/projectAvatars.mts @@ -0,0 +1,180 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectAvatars { + constructor(private client: Client) {} + + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; + async updateProjectAvatar( + parameters: Parameters.UpdateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar`, + method: 'PUT', + data: { + fileName: parameters.fileName, + id: parameters.id, + isDeletable: parameters.isDeletable, + isSelected: parameters.isSelected, + isSystemAvatar: parameters.isSystemAvatar, + owner: parameters.owner, + urls: parameters.urls, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; + async deleteProjectAvatar( + parameters: Parameters.DeleteProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * 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-2-project-projectIdOrKey-avatar-put) to set it as + * the project's displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback: Callback, + ): Promise; + /** + * 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. + * + * 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-2-project-projectIdOrKey-avatar-put) to set it as + * the project's displayed avatar. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: never, + ): Promise; + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * 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 getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars | string, + callback: Callback, + ): Promise; + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * 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 getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars | string, + callback?: never, + ): Promise; + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/avatars`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectAvatars.ts b/src/version2/projectAvatars.ts deleted file mode 100644 index 0fe7bb7c80..0000000000 --- a/src/version2/projectAvatars.ts +++ /dev/null @@ -1,180 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectAvatars { - constructor(private client: Client) {} - - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-2-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; - async updateProjectAvatar( - parameters: Parameters.UpdateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar`, - method: 'PUT', - data: { - fileName: parameters.fileName, - id: parameters.id, - isDeletable: parameters.isDeletable, - isSelected: parameters.isSelected, - isSystemAvatar: parameters.isSystemAvatar, - owner: parameters.owner, - urls: parameters.urls, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; - async deleteProjectAvatar( - parameters: Parameters.DeleteProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * 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-2-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback: Callback, - ): Promise; - /** - * 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. - * - * 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-2-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: never, - ): Promise; - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * 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 getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * 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 getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback?: never, - ): Promise; - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/avatars`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectCategories.mts b/src/version2/projectCategories.mts new file mode 100644 index 0000000000..67bec15db7 --- /dev/null +++ b/src/version2/projectCategories.mts @@ -0,0 +1,174 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectCategories { + constructor(private client: Client) {} + + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback: Callback): Promise; + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback?: never): Promise; + async getAllProjectCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/projectCategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback: Callback, + ): Promise; + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: never, + ): Promise; + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/projectCategory', + method: 'POST', + data: { + description: parameters.description, + id: parameters.id, + name: parameters.name, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById | string, + callback: Callback, + ): Promise; + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById | string, + callback?: never, + ): Promise; + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/projectCategory/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback: Callback, + ): Promise; + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: never, + ): Promise; + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/projectCategory/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory | string, + callback: Callback, + ): Promise; + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory | string, + callback?: never, + ): Promise; + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/projectCategory/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectCategories.ts b/src/version2/projectCategories.ts deleted file mode 100644 index 407ac3636d..0000000000 --- a/src/version2/projectCategories.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectCategories { - constructor(private client: Client) {} - - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback: Callback): Promise; - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback?: never): Promise; - async getAllProjectCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/projectCategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback: Callback, - ): Promise; - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: never, - ): Promise; - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/projectCategory', - method: 'POST', - data: { - description: parameters.description, - id: parameters.id, - name: parameters.name, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback: Callback, - ): Promise; - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback?: never, - ): Promise; - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/projectCategory/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback: Callback, - ): Promise; - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: never, - ): Promise; - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/projectCategory/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback: Callback, - ): Promise; - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback?: never, - ): Promise; - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/projectCategory/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectComponents.mts b/src/version2/projectComponents.mts new file mode 100644 index 0000000000..9291c2637b --- /dev/null +++ b/src/version2/projectComponents.mts @@ -0,0 +1,313 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectComponents { + constructor(private client: Client) {} + + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[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 in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback: Callback, + ): Promise; + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[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 in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback?: never, + ): Promise; + async createComponent( + parameters: Parameters.CreateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a component. + * + * 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 project containing the component. + */ + async getComponent( + parameters: Parameters.GetComponent | string, + callback: Callback, + ): Promise; + /** + * Returns a component. + * + * 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 project containing the component. + */ + async getComponent( + parameters: Parameters.GetComponent | string, + callback?: never, + ): Promise; + async getComponent( + parameters: Parameters.GetComponent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/component/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback: Callback, + ): Promise; + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: never, + ): Promise; + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/component/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + leadUserName: parameters.leadUserName, + leadAccountId: parameters.leadAccountId, + assigneeType: parameters.assigneeType, + project: parameters.project, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent( + parameters: Parameters.DeleteComponent | string, + callback: Callback, + ): Promise; + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent(parameters: Parameters.DeleteComponent | string, callback?: never): Promise; + async deleteComponent( + parameters: Parameters.DeleteComponent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/component/${id}`, + method: 'DELETE', + params: { + moveIssuesTo: typeof parameters !== 'string' && parameters.moveIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues | string, + callback?: never, + ): Promise; + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/component/${id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * 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. + * + * 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 getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * 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. + * + * 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 getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: never, + ): Promise; + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/component`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * 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 getProjectComponents( + parameters: Parameters.GetProjectComponents | string, + callback: Callback, + ): Promise; + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * 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 getProjectComponents( + parameters: Parameters.GetProjectComponents | string, + callback?: never, + ): Promise; + async getProjectComponents( + parameters: Parameters.GetProjectComponents | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/components`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts deleted file mode 100644 index e7e7cee46f..0000000000 --- a/src/version2/projectComponents.ts +++ /dev/null @@ -1,313 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectComponents { - constructor(private client: Client) {} - - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[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 in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback: Callback, - ): Promise; - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[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 in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback?: never, - ): Promise; - async createComponent( - parameters: Parameters.CreateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a component. - * - * 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 project containing the component. - */ - async getComponent( - parameters: Parameters.GetComponent | string, - callback: Callback, - ): Promise; - /** - * Returns a component. - * - * 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 project containing the component. - */ - async getComponent( - parameters: Parameters.GetComponent | string, - callback?: never, - ): Promise; - async getComponent( - parameters: Parameters.GetComponent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/component/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback: Callback, - ): Promise; - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: never, - ): Promise; - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/component/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - leadUserName: parameters.leadUserName, - leadAccountId: parameters.leadAccountId, - assigneeType: parameters.assigneeType, - project: parameters.project, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent( - parameters: Parameters.DeleteComponent | string, - callback: Callback, - ): Promise; - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent | string, callback?: never): Promise; - async deleteComponent( - parameters: Parameters.DeleteComponent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/component/${id}`, - method: 'DELETE', - params: { - moveIssuesTo: typeof parameters !== 'string' && parameters.moveIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - callback?: never, - ): Promise; - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/component/${id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * 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. - * - * 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 getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * 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. - * - * 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 getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: never, - ): Promise; - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/component`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - orderBy: parameters.orderBy, - query: parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * 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 getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - callback: Callback, - ): Promise; - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * 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 getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - callback?: never, - ): Promise; - async getProjectComponents( - parameters: Parameters.GetProjectComponents | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/components`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectEmail.mts b/src/version2/projectEmail.mts new file mode 100644 index 0000000000..a021dda2b9 --- /dev/null +++ b/src/version2/projectEmail.mts @@ -0,0 +1,77 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectEmail { + constructor(private client: Client) {} + + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[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 getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback: Callback, + ): Promise; + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[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 getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: never, + ): Promise; + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectId}/email`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * 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. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * 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. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; + async updateProjectEmail( + parameters: Parameters.UpdateProjectEmail, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectId}/email`, + method: 'PUT', + data: { + emailAddress: parameters.emailAddress, + emailAddressStatus: parameters.emailAddressStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectEmail.ts b/src/version2/projectEmail.ts deleted file mode 100644 index 3caf5917a2..0000000000 --- a/src/version2/projectEmail.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectEmail { - constructor(private client: Client) {} - - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[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 getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback: Callback, - ): Promise; - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[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 getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: never, - ): Promise; - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectId}/email`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * 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. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * 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. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; - async updateProjectEmail( - parameters: Parameters.UpdateProjectEmail, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectId}/email`, - method: 'PUT', - data: { - emailAddress: parameters.emailAddress, - emailAddressStatus: parameters.emailAddressStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectFeatures.mts b/src/version2/projectFeatures.mts new file mode 100644 index 0000000000..6f09dd9a89 --- /dev/null +++ b/src/version2/projectFeatures.mts @@ -0,0 +1,58 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectFeatures { + constructor(private client: Client) {} + + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback: Callback, + ): Promise; + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: never, + ): Promise; + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/features`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback: Callback, + ): Promise; + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: never, + ): Promise; + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, + method: 'PUT', + data: { + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectFeatures.ts b/src/version2/projectFeatures.ts deleted file mode 100644 index 2154dbde01..0000000000 --- a/src/version2/projectFeatures.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectFeatures { - constructor(private client: Client) {} - - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback: Callback, - ): Promise; - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: never, - ): Promise; - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/features`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback: Callback, - ): Promise; - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: never, - ): Promise; - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, - method: 'PUT', - data: { - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectKeyAndNameValidation.mts b/src/version2/projectKeyAndNameValidation.mts new file mode 100644 index 0000000000..b1a8348885 --- /dev/null +++ b/src/version2/projectKeyAndNameValidation.mts @@ -0,0 +1,118 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectKeyAndNameValidation { + constructor(private client: Client) {} + + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters: Parameters.ValidateProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: never, + ): Promise; + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/2/projectvalidate/key', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters: Parameters.GetValidProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: never, + ): Promise; + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/2/projectvalidate/validProjectKey', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback: Callback, + ): Promise; + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: never, + ): Promise; + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/2/projectvalidate/validProjectName', + method: 'GET', + params: { + name, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectKeyAndNameValidation.ts b/src/version2/projectKeyAndNameValidation.ts deleted file mode 100644 index 44de219300..0000000000 --- a/src/version2/projectKeyAndNameValidation.ts +++ /dev/null @@ -1,118 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectKeyAndNameValidation { - constructor(private client: Client) {} - - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters: Parameters.ValidateProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: never, - ): Promise; - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/2/projectvalidate/key', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters: Parameters.GetValidProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: never, - ): Promise; - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/2/projectvalidate/validProjectKey', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback: Callback, - ): Promise; - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: never, - ): Promise; - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/2/projectvalidate/validProjectName', - method: 'GET', - params: { - name, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectPermissionSchemes.mts b/src/version2/projectPermissionSchemes.mts new file mode 100644 index 0000000000..c7301e6da1 --- /dev/null +++ b/src/version2/projectPermissionSchemes.mts @@ -0,0 +1,168 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectPermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with 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 the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback: Callback, + ): Promise; + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with 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 the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: never, + ): Promise; + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/issuesecuritylevelscheme`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with 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 getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback: Callback, + ): Promise; + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with 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 getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: never, + ): Promise; + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/permissionscheme`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback: Callback, + ): Promise; + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: never, + ): Promise; + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectKeyOrId}/permissionscheme`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback: Callback, + ): Promise; + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: never, + ): Promise; + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/securitylevel`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectPermissionSchemes.ts b/src/version2/projectPermissionSchemes.ts deleted file mode 100644 index 6bdf11bb58..0000000000 --- a/src/version2/projectPermissionSchemes.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectPermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with 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 the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with 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 the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/issuesecuritylevelscheme`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with 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 getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with 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 getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: never, - ): Promise; - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/permissionscheme`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback: Callback, - ): Promise; - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: never, - ): Promise; - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectKeyOrId}/permissionscheme`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback: Callback, - ): Promise; - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: never, - ): Promise; - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/securitylevel`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectProperties.mts b/src/version2/projectProperties.mts new file mode 100644 index 0000000000..798e726c57 --- /dev/null +++ b/src/version2/projectProperties.mts @@ -0,0 +1,174 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectProperties { + constructor(private client: Client) {} + + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * 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 getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * 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 getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: never, + ): Promise; + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * 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 property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * 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 property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: never, + ): Promise; + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[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) for the project in which the property is created. + */ + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[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) for the project in which the property is created. + */ + async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[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) for the project containing the property. + */ + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback: Callback, + ): Promise; + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[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) for the project containing the property. + */ + async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectProperties.ts b/src/version2/projectProperties.ts deleted file mode 100644 index d5bba9ec15..0000000000 --- a/src/version2/projectProperties.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectProperties { - constructor(private client: Client) {} - - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * 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 getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * 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 getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: never, - ): Promise; - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * 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 property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * 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 property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: never, - ): Promise; - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[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) for the project in which the property is created. - */ - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[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) for the project in which the property is created. - */ - async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[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) for the project containing the property. - */ - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback: Callback, - ): Promise; - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[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) for the project containing the property. - */ - async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectRoleActors.mts b/src/version2/projectRoleActors.mts new file mode 100644 index 0000000000..4f4fc9ee7d --- /dev/null +++ b/src/version2/projectRoleActors.mts @@ -0,0 +1,249 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectRoleActors { + constructor(private client: Client) {} + + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback: Callback, + ): Promise; + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'POST', + data: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback?: never): Promise; + async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'PUT', + data: { + categorisedActors: parameters.categorisedActors, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-2-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-2-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; + async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'DELETE', + params: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback: Callback, + ): Promise; + /** + * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: never, + ): Promise; + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/role/${id}/actors`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback: Callback, + ): Promise; + /** + * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: never, + ): Promise; + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}/actors`, + method: 'POST', + data: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback: Callback, + ): Promise; + /** + * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: never, + ): Promise; + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}/actors`, + method: 'DELETE', + params: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectRoleActors.ts b/src/version2/projectRoleActors.ts deleted file mode 100644 index 78e26df825..0000000000 --- a/src/version2/projectRoleActors.ts +++ /dev/null @@ -1,249 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectRoleActors { - constructor(private client: Client) {} - - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback: Callback, - ): Promise; - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'POST', - data: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-2-project-projectIdOrKey-role-id-post). - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback?: never): Promise; - async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'PUT', - data: { - categorisedActors: parameters.categorisedActors, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-2-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-2-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; - async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'DELETE', - params: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback: Callback, - ): Promise; - /** - * Returns the [default actors](#api-rest-api-2-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: never, - ): Promise; - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/role/${id}/actors`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback: Callback, - ): Promise; - /** - * Adds [default actors](#api-rest-api-2-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: never, - ): Promise; - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}/actors`, - method: 'POST', - data: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback: Callback, - ): Promise; - /** - * Deletes the [default actors](#api-rest-api-2-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: never, - ): Promise; - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}/actors`, - method: 'DELETE', - params: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectRoles.mts b/src/version2/projectRoles.mts new file mode 100644 index 0000000000..364800cd57 --- /dev/null +++ b/src/version2/projectRoles.mts @@ -0,0 +1,422 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +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. + * + * 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. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + 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. + * + * 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. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: never, + ): Promise; + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/role`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback: Callback, + ): Promise; + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'GET', + params: { + excludeInactiveUsers: parameters.excludeInactiveUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * This operation can be accessed anonymously. + * + * **[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) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + 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. + * + * This operation can be accessed anonymously. + * + * **[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) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: never, + ): Promise; + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, + method: 'GET', + params: { + currentMember: typeof parameters !== 'string' && parameters.currentMember, + excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### 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 are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification + * schemes](#api-rest-api-2-notificationscheme-get), [issue security + * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * 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 + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback: Callback): Promise; + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### 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 are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification + * schemes](#api-rest-api-2-notificationscheme-get), [issue security + * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * 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 + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback?: never): Promise; + async getAllProjectRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/role', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback: Callback, + ): Promise; + /** + * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: never, + ): Promise; + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/role', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback: Callback, + ): Promise; + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: never, + ): Promise; + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/role/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: never, + ): Promise; + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}`, + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: never, + ): Promise; + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/role/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback: Callback, + ): Promise; + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/role/${id}`, + method: 'DELETE', + params: { + swap: typeof parameters !== 'string' && parameters.swap, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts deleted file mode 100644 index ece418fe7f..0000000000 --- a/src/version2/projectRoles.ts +++ /dev/null @@ -1,422 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -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. - * - * 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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - 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. - * - * 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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: never, - ): Promise; - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/role`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback: Callback, - ): Promise; - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-2-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'GET', - params: { - excludeInactiveUsers: parameters.excludeInactiveUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * This operation can be accessed anonymously. - * - * **[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) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - 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. - * - * This operation can be accessed anonymously. - * - * **[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) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: never, - ): Promise; - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, - method: 'GET', - params: { - currentMember: typeof parameters !== 'string' && parameters.currentMember, - excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### 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 are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification - * schemes](#api-rest-api-2-notificationscheme-get), [issue security - * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * 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 - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback: Callback): Promise; - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### 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 are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification - * schemes](#api-rest-api-2-notificationscheme-get), [issue security - * levels](#api-rest-api-2-issuesecurityschemes-get), [comment visibility](#api-rest-api-2-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * 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 - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback?: never): Promise; - async getAllProjectRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/role', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback: Callback, - ): Promise; - /** - * Creates a new project role with no [default actors](#api-rest-api-2-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-2-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: never, - ): Promise; - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/role', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback: Callback, - ): Promise; - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: never, - ): Promise; - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/role/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: never, - ): Promise; - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}`, - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: never, - ): Promise; - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/role/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback: Callback, - ): Promise; - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/role/${id}`, - method: 'DELETE', - params: { - swap: typeof parameters !== 'string' && parameters.swap, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectTypes.mts b/src/version2/projectTypes.mts new file mode 100644 index 0000000000..bd44ec697f --- /dev/null +++ b/src/version2/projectTypes.mts @@ -0,0 +1,119 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectTypes { + constructor(private client: Client) {} + + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback: Callback): Promise; + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback?: never): Promise; + async getAllProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/type', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback: Callback): Promise; + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback?: never): Promise; + async getAllAccessibleProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/type/accessible', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: never, + ): Promise; + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/type/${projectTypeKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: never, + ): Promise; + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/type/${projectTypeKey}/accessible`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectTypes.ts b/src/version2/projectTypes.ts deleted file mode 100644 index 82475d06a6..0000000000 --- a/src/version2/projectTypes.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectTypes { - constructor(private client: Client) {} - - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback: Callback): Promise; - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback?: never): Promise; - async getAllProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/type', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback: Callback): Promise; - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback?: never): Promise; - async getAllAccessibleProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/type/accessible', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: never, - ): Promise; - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/type/${projectTypeKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: never, - ): Promise; - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/type/${projectTypeKey}/accessible`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projectVersions.mts b/src/version2/projectVersions.mts new file mode 100644 index 0000000000..2abd8c9168 --- /dev/null +++ b/src/version2/projectVersions.mts @@ -0,0 +1,439 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectVersions { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * 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 getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * 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 getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: never, + ): Promise; + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * 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 getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback: Callback, + ): Promise; + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * 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 getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: never, + ): Promise; + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/versions`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; + async createVersion( + parameters: Parameters.CreateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/version', + method: 'POST', + data: { + expand: parameters.expand, + self: parameters.self, + id: parameters.id, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project version. + * + * 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 getVersion( + parameters: Parameters.GetVersion | string, + callback: Callback, + ): Promise; + /** + * Returns a project version. + * + * 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 getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; + async getVersion( + parameters: Parameters.GetVersion | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/version/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; + async updateVersion( + parameters: Parameters.UpdateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}`, + method: 'PUT', + data: { + expand: parameters.expand, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + startDate: parameters.startDate, + releaseDate: parameters.releaseDate, + projectId: parameters.projectId, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; + async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; + async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: never, + ): Promise; + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/version/${id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback: Callback, + ): Promise; + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, + method: 'POST', + data: { + moveFixIssuesTo: parameters.moveFixIssuesTo, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + customFieldReplacementList: parameters.customFieldReplacementList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: never, + ): Promise; + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/version/${id}/unresolvedIssueCount`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts deleted file mode 100644 index 4db643ba64..0000000000 --- a/src/version2/projectVersions.ts +++ /dev/null @@ -1,439 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectVersions { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * 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 getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-2-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * 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 getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: never, - ): Promise; - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * 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 getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback: Callback, - ): Promise; - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-2-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * 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 getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: never, - ): Promise; - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/versions`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; - async createVersion( - parameters: Parameters.CreateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/version', - method: 'POST', - data: { - expand: parameters.expand, - self: parameters.self, - id: parameters.id, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project version. - * - * 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 getVersion( - parameters: Parameters.GetVersion | string, - callback: Callback, - ): Promise; - /** - * Returns a project version. - * - * 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 getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; - async getVersion( - parameters: Parameters.GetVersion | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/version/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; - async updateVersion( - parameters: Parameters.UpdateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}`, - method: 'PUT', - data: { - expand: parameters.expand, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-2-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; - async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; - async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: never, - ): Promise; - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/version/${id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback: Callback, - ): Promise; - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, - method: 'POST', - data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, - customFieldReplacementList: parameters.customFieldReplacementList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: never, - ): Promise; - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/version/${id}/unresolvedIssueCount`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/projects.mts b/src/version2/projects.mts new file mode 100644 index 0000000000..543e49554d --- /dev/null +++ b/src/version2/projects.mts @@ -0,0 +1,565 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Projects { + constructor(private client: Client) {} + + /** + * 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` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback: Callback, + ): Promise; + /** + * 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` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback?: never, + ): Promise; + async createProject( + parameters: Parameters.CreateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project', + method: 'POST', + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + fieldConfigurationScheme: parameters.fieldConfigurationScheme, + issueSecurityScheme: parameters.issueSecurityScheme, + issueTypeScheme: parameters.issueTypeScheme, + issueTypeScreenScheme: parameters.issueTypeScreenScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + workflowScheme: parameters.workflowScheme, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 getRecent( + parameters: Parameters.GetRecent | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; + async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/recent', + method: 'GET', + params: { + expand: parameters?.expand, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 searchProjects( + parameters: Parameters.SearchProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; + async searchProjects( + parameters?: Parameters.SearchProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/project/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + id: parameters?.id, + keys: parameters?.keys, + query: parameters?.query, + typeKey: parameters?.typeKey, + categoryId: parameters?.categoryId, + action: parameters?.action, + expand: parameters?.expand, + status: parameters?.status, + properties: parameters?.properties, + propertyQuery: parameters?.propertyQuery, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * 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 getProject( + parameters: Parameters.GetProject | string, + callback: Callback, + ): Promise; + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * 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 getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; + async getProject( + parameters: Parameters.GetProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + properties: typeof parameters !== 'string' && parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. + * + * 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/v2/intro/#permissions) required:** + * _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. 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/v2/intro/#permissions) required:** + * _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( + parameters: Parameters.UpdateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + issueSecurityScheme: parameters.issueSecurityScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; + async deleteProject( + parameters: Parameters.DeleteProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}`, + method: 'DELETE', + params: { + enableUndo: typeof parameters !== 'string' && parameters.enableUndo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; + async archiveProject( + parameters: Parameters.ArchiveProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/archive`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [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 deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback: Callback, + ): Promise; + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [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 deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: never, + ): Promise; + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/delete`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a project that has been archived or placed in the Jira recycle bin. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _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/v2/intro/#permissions) required:** + * + * - _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( + parameters: Parameters.Restore | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * 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 getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback: Callback, + ): Promise; + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * 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 getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: never, + ): Promise; + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectIdOrKey}/statuses`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[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 getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback: Callback, + ): Promise; + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[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 getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: never, + ): Promise; + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectId}/hierarchy`, + method: 'GET', + }; + + 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/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 getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject | string, + 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/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 getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject | string, + callback?: never, + ): Promise; + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projects.ts b/src/version2/projects.ts deleted file mode 100644 index 0ad37105c4..0000000000 --- a/src/version2/projects.ts +++ /dev/null @@ -1,565 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Projects { - constructor(private client: Client) {} - - /** - * 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` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback: Callback, - ): Promise; - /** - * 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` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback?: never, - ): Promise; - async createProject( - parameters: Parameters.CreateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project', - method: 'POST', - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - fieldConfigurationScheme: parameters.fieldConfigurationScheme, - issueSecurityScheme: parameters.issueSecurityScheme, - issueTypeScheme: parameters.issueTypeScheme, - issueTypeScreenScheme: parameters.issueTypeScreenScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - workflowScheme: parameters.workflowScheme, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 getRecent( - parameters: Parameters.GetRecent | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; - async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/recent', - method: 'GET', - params: { - expand: parameters?.expand, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 searchProjects( - parameters: Parameters.SearchProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; - async searchProjects( - parameters?: Parameters.SearchProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/project/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - id: parameters?.id, - keys: parameters?.keys, - query: parameters?.query, - typeKey: parameters?.typeKey, - categoryId: parameters?.categoryId, - action: parameters?.action, - expand: parameters?.expand, - status: parameters?.status, - properties: parameters?.properties, - propertyQuery: parameters?.propertyQuery, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * 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 getProject( - parameters: Parameters.GetProject | string, - callback: Callback, - ): Promise; - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * 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 getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; - async getProject( - parameters: Parameters.GetProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * 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/v2/intro/#permissions) required:** - * _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. 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/v2/intro/#permissions) required:** - * _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( - parameters: Parameters.UpdateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/project/${parameters.projectIdOrKey}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - issueSecurityScheme: parameters.issueSecurityScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; - async deleteProject( - parameters: Parameters.DeleteProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}`, - method: 'DELETE', - params: { - enableUndo: typeof parameters !== 'string' && parameters.enableUndo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; - async archiveProject( - parameters: Parameters.ArchiveProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/archive`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [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 deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback: Callback, - ): Promise; - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [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 deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: never, - ): Promise; - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/delete`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a project that has been archived or placed in the Jira recycle bin. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _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/v2/intro/#permissions) required:** - * - * - _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( - parameters: Parameters.Restore | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * 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 getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback: Callback, - ): Promise; - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * 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 getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: never, - ): Promise; - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectIdOrKey}/statuses`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[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 getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback: Callback, - ): Promise; - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[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 getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: never, - ): Promise; - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectId}/hierarchy`, - method: 'GET', - }; - - 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/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 getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - 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/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 getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback?: never, - ): Promise; - async getNotificationSchemeForProject( - parameters: Parameters.GetNotificationSchemeForProject | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screenSchemes.mts b/src/version2/screenSchemes.mts new file mode 100644 index 0000000000..e61390e4f4 --- /dev/null +++ b/src/version2/screenSchemes.mts @@ -0,0 +1,160 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects 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). + */ + async getScreenSchemes( + parameters: Parameters.GetScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects 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). + */ + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: never, + ): Promise; + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen 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 createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Creates a screen 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 createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: never, + ): Promise; + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/2/screenscheme', + method: 'POST', + data: { + name, + description: typeof parameters !== 'string' && parameters.description, + screens: typeof parameters !== 'string' && parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; + async updateScreenScheme( + parameters: Parameters.UpdateScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screenscheme/${parameters.screenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + screens: parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback?: Callback, + ): Promise { + const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/2/screenscheme/${screenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screenSchemes.ts b/src/version2/screenSchemes.ts deleted file mode 100644 index 15947007af..0000000000 --- a/src/version2/screenSchemes.ts +++ /dev/null @@ -1,160 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects 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). - */ - async getScreenSchemes( - parameters: Parameters.GetScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects 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). - */ - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: never, - ): Promise; - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/screenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen 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 createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Creates a screen 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 createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: never, - ): Promise; - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/2/screenscheme', - method: 'POST', - data: { - name, - description: typeof parameters !== 'string' && parameters.description, - screens: typeof parameters !== 'string' && parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; - async updateScreenScheme( - parameters: Parameters.UpdateScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screenscheme/${parameters.screenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - screens: parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback?: Callback, - ): Promise { - const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/2/screenscheme/${screenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screenTabFields.mts b/src/version2/screenTabFields.mts new file mode 100644 index 0000000000..bb0c9b24d4 --- /dev/null +++ b/src/version2/screenTabFields.mts @@ -0,0 +1,150 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabFields { + constructor(private client: Client) {} + + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback: Callback, + ): Promise; + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: never, + ): Promise; + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'GET', + params: { + projectKey: parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback: Callback, + ): Promise; + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: never, + ): Promise; + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'POST', + data: { + fieldId: parameters.fieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback: Callback, + ): Promise; + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; + async moveScreenTabField( + parameters: Parameters.MoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screenTabFields.ts b/src/version2/screenTabFields.ts deleted file mode 100644 index e92889417c..0000000000 --- a/src/version2/screenTabFields.ts +++ /dev/null @@ -1,150 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ScreenTabFields { - constructor(private client: Client) {} - - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback: Callback, - ): Promise; - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: never, - ): Promise; - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'GET', - params: { - projectKey: parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback: Callback, - ): Promise; - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: never, - ): Promise; - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'POST', - data: { - fieldId: parameters.fieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback: Callback, - ): Promise; - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; - async moveScreenTabField( - parameters: Parameters.MoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screenTabs.mts b/src/version2/screenTabs.mts new file mode 100644 index 0000000000..11e052fed2 --- /dev/null +++ b/src/version2/screenTabs.mts @@ -0,0 +1,166 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabs { + constructor(private client: Client) {} + + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: never, + ): Promise; + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/${screenId}/tabs`, + method: 'GET', + params: { + projectKey: typeof parameters !== 'string' && parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback: Callback, + ): Promise; + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback: Callback, + ): Promise; + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'PUT', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screenTabs.ts b/src/version2/screenTabs.ts deleted file mode 100644 index ce6364cc8e..0000000000 --- a/src/version2/screenTabs.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ScreenTabs { - constructor(private client: Client) {} - - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback: Callback, - ): Promise; - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: never, - ): Promise; - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/${screenId}/tabs`, - method: 'GET', - params: { - projectKey: typeof parameters !== 'string' && parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback: Callback, - ): Promise; - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback: Callback, - ): Promise; - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'PUT', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/screens.mts b/src/version2/screens.mts new file mode 100644 index 0000000000..c7f8b31bbe --- /dev/null +++ b/src/version2/screens.mts @@ -0,0 +1,243 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Screens { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: never, + ): Promise; + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/field/${fieldId}/screens`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens( + parameters: Parameters.GetScreens | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; + async getScreens( + parameters?: Parameters.GetScreens, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screens', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + scope: parameters?.scope, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; + async createScreen( + parameters: Parameters.CreateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screens', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback: Callback, + ): Promise; + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: never, + ): Promise; + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/addToDefault/${fieldId}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; + async updateScreen( + parameters: Parameters.UpdateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/screens/${parameters.screenId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; + async deleteScreen( + parameters: Parameters.DeleteScreen | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/${screenId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback: Callback, + ): Promise; + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: never, + ): Promise; + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/2/screens/${screenId}/availableFields`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/screens.ts b/src/version2/screens.ts deleted file mode 100644 index f48782532e..0000000000 --- a/src/version2/screens.ts +++ /dev/null @@ -1,243 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Screens { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: never, - ): Promise; - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/field/${fieldId}/screens`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens( - parameters: Parameters.GetScreens | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; - async getScreens( - parameters?: Parameters.GetScreens, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/screens', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - scope: parameters?.scope, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; - async createScreen( - parameters: Parameters.CreateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/screens', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback: Callback, - ): Promise; - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: never, - ): Promise; - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/addToDefault/${fieldId}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; - async updateScreen( - parameters: Parameters.UpdateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/screens/${parameters.screenId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; - async deleteScreen( - parameters: Parameters.DeleteScreen | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/${screenId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback: Callback, - ): Promise; - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: never, - ): Promise; - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/2/screens/${screenId}/availableFields`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/serverInfo.mts b/src/version2/serverInfo.mts new file mode 100644 index 0000000000..a6f939d4bb --- /dev/null +++ b/src/version2/serverInfo.mts @@ -0,0 +1,33 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ServerInfo { + constructor(private client: Client) {} + + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getServerInfo(callback: Callback): Promise; + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getServerInfo(callback?: never): Promise; + async getServerInfo(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/serverInfo', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/serverInfo.ts b/src/version2/serverInfo.ts deleted file mode 100644 index cbf18c43ef..0000000000 --- a/src/version2/serverInfo.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ServerInfo { - constructor(private client: Client) {} - - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getServerInfo(callback: Callback): Promise; - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getServerInfo(callback?: never): Promise; - async getServerInfo(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/serverInfo', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/status.mts b/src/version2/status.mts new file mode 100644 index 0000000000..e78dc80f46 --- /dev/null +++ b/src/version2/status.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Status { + constructor(private client: Client) {} + + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback: Callback, + ): Promise; + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: never, + ): Promise; + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'GET', + params: { + id, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses( + parameters: Parameters.CreateStatuses, + callback: Callback, + ): Promise; + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; + async createStatuses( + parameters: Parameters.CreateStatuses, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'POST', + data: { + statuses: parameters.statuses, + scope: parameters.scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'PUT', + data: { + statuses: parameters.statuses, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback: Callback, + ): Promise; + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/2/statuses', + method: 'DELETE', + params: { + id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search( + parameters: Parameters.Search | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search(parameters?: Parameters.Search, callback?: never): Promise; + async search(parameters?: Parameters.Search, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuses/search', + method: 'GET', + params: { + expand: parameters?.expand, + projectId: parameters?.projectId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + searchString: parameters?.searchString, + statusCategory: parameters?.statusCategory, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/status.ts b/src/version2/status.ts deleted file mode 100644 index e42ed19945..0000000000 --- a/src/version2/status.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Status { - constructor(private client: Client) {} - - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback: Callback, - ): Promise; - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: never, - ): Promise; - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'GET', - params: { - id, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses( - parameters: Parameters.CreateStatuses, - callback: Callback, - ): Promise; - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; - async createStatuses( - parameters: Parameters.CreateStatuses, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'POST', - data: { - statuses: parameters.statuses, - scope: parameters.scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'PUT', - data: { - statuses: parameters.statuses, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback: Callback, - ): Promise; - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/2/statuses', - method: 'DELETE', - params: { - id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search( - parameters: Parameters.Search | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search(parameters?: Parameters.Search, callback?: never): Promise; - async search(parameters?: Parameters.Search, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuses/search', - method: 'GET', - params: { - expand: parameters?.expand, - projectId: parameters?.projectId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - searchString: parameters?.searchString, - statusCategory: parameters?.statusCategory, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/tasks.mts b/src/version2/tasks.mts new file mode 100644 index 0000000000..8d7a1f85fa --- /dev/null +++ b/src/version2/tasks.mts @@ -0,0 +1,87 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Tasks { + constructor(private client: Client) {} + + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask( + parameters: Parameters.GetTask | string, + callback: Callback, + ): Promise; + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; + async getTask( + parameters: Parameters.GetTask | string, + callback?: Callback, + ): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/2/task/${taskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; + async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/2/task/${taskId}/cancel`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/tasks.ts b/src/version2/tasks.ts deleted file mode 100644 index a6e0a82943..0000000000 --- a/src/version2/tasks.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Tasks { - constructor(private client: Client) {} - - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask( - parameters: Parameters.GetTask | string, - callback: Callback, - ): Promise; - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; - async getTask( - parameters: Parameters.GetTask | string, - callback?: Callback, - ): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/2/task/${taskId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; - async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/2/task/${taskId}/cancel`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/timeTracking.mts b/src/version2/timeTracking.mts new file mode 100644 index 0000000000..96cbf662d4 --- /dev/null +++ b/src/version2/timeTracking.mts @@ -0,0 +1,169 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class TimeTracking { + constructor(private client: Client) {} + + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback: Callback): Promise; + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback?: never): Promise; + async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters: Parameters.SelectTimeTrackingImplementation | undefined, + callback: Callback, + ): Promise; + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: never, + ): Promise; + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking', + method: 'PUT', + data: { + key: parameters?.key, + name: parameters?.name, + url: parameters?.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations( + callback: Callback, + ): Promise; + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations(callback?: never): Promise; + async getAvailableTimeTrackingImplementations( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking/list', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * 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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback: Callback): Promise; + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * 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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback?: never): Promise; + async getSharedTimeTrackingConfiguration( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/configuration/timetracking/options', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the time tracking 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 setSharedTimeTrackingConfiguration( + parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Sets the time tracking 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 setSharedTimeTrackingConfiguration( + parameters?: Parameters.SetSharedTimeTrackingConfiguration, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/timeTracking.ts b/src/version2/timeTracking.ts deleted file mode 100644 index 87358e0fd4..0000000000 --- a/src/version2/timeTracking.ts +++ /dev/null @@ -1,169 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class TimeTracking { - constructor(private client: Client) {} - - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback: Callback): Promise; - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback?: never): Promise; - async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters: Parameters.SelectTimeTrackingImplementation | undefined, - callback: Callback, - ): Promise; - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: never, - ): Promise; - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking', - method: 'PUT', - data: { - key: parameters?.key, - name: parameters?.name, - url: parameters?.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations( - callback: Callback, - ): Promise; - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations(callback?: never): Promise; - async getAvailableTimeTrackingImplementations( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking/list', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * 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:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback: Callback): Promise; - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * 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:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback?: never): Promise; - async getSharedTimeTrackingConfiguration( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/configuration/timetracking/options', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the time tracking 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 setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Sets the time tracking 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 setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/uIModificationsApps.ts b/src/version2/uIModificationsApps.ts deleted file mode 100644 index c6f69acc54..0000000000 --- a/src/version2/uIModificationsApps.ts +++ /dev/null @@ -1,171 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class UIModificationsApps { - constructor(private client: Client) {} - - /** - * 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. - */ - async getUiModifications( - parameters: Parameters.GetUiModifications | undefined, - callback: Callback, - ): Promise; - /** - * 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. - */ - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: never, - ): Promise; - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/uiModifications', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * **[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. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback: Callback, - ): Promise; - /** - * 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. - * - * **[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. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: never, - ): Promise; - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/uiModifications', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[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. - */ - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback: Callback, - ): Promise; - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[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. - */ - async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback: Callback, - ): Promise; - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: never, - ): Promise; - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: Callback, - ): Promise { - const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; - - const config: RequestConfig = { - url: `/rest/api/2/uiModifications/${uiModificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/uiModificationsApps.mts b/src/version2/uiModificationsApps.mts new file mode 100644 index 0000000000..06bb9bd3cb --- /dev/null +++ b/src/version2/uiModificationsApps.mts @@ -0,0 +1,171 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UiModificationsApps { + constructor(private client: Client) {} + + /** + * 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. + */ + async getUiModifications( + parameters: Parameters.GetUiModifications | undefined, + callback: Callback, + ): Promise; + /** + * 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. + */ + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: never, + ): Promise; + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/uiModifications', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * **[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. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback: Callback, + ): Promise; + /** + * 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. + * + * **[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. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: never, + ): Promise; + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/uiModifications', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[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. + */ + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback: Callback, + ): Promise; + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[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. + */ + async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback: Callback, + ): Promise; + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: never, + ): Promise; + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: Callback, + ): Promise { + const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; + + const config: RequestConfig = { + url: `/rest/api/2/uiModifications/${uiModificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/userProperties.mts b/src/version2/userProperties.mts new file mode 100644 index 0000000000..eac9a71c73 --- /dev/null +++ b/src/version2/userProperties.mts @@ -0,0 +1,190 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UserProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters: Parameters.GetUserPropertyKeys | undefined, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: never, + ): Promise; + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/properties', + method: 'GET', + params: { + accountId: parameters?.accountId, + userKey: parameters?.userKey, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-2-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-2-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: never, + ): Promise; + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/user/properties/${parameters.propertyKey}`, + method: 'GET', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[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 a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[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 a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; + async setUserProperty( + parameters: Parameters.SetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/user/properties/${parameters.propertyKey}`, + method: 'PUT', + params: { + accountId: parameters.accountId, + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; + async deleteUserProperty( + parameters: Parameters.DeleteUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/user/properties/${parameters.propertyKey}`, + method: 'DELETE', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/userProperties.ts b/src/version2/userProperties.ts deleted file mode 100644 index c4a1b1f94c..0000000000 --- a/src/version2/userProperties.ts +++ /dev/null @@ -1,190 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class UserProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters: Parameters.GetUserPropertyKeys | undefined, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: never, - ): Promise; - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/properties', - method: 'GET', - params: { - accountId: parameters?.accountId, - userKey: parameters?.userKey, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-2-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-2-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: never, - ): Promise; - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'GET', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[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 a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[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 a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; - async setUserProperty( - parameters: Parameters.SetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'PUT', - params: { - accountId: parameters.accountId, - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; - async deleteUserProperty( - parameters: Parameters.DeleteUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/user/properties/${parameters.propertyKey}`, - method: 'DELETE', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/userSearch.mts b/src/version2/userSearch.mts new file mode 100644 index 0000000000..b46ed99e50 --- /dev/null +++ b/src/version2/userSearch.mts @@ -0,0 +1,608 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class UserSearch { + constructor(private client: Client) {} + + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback: Callback, + ): Promise; + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: never, + ): Promise; + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/assignable/multiProjectSearch', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + projectKeys: parameters.projectKeys, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * 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 + * 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 + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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. + */ + async findAssignableUsers( + parameters: Parameters.FindAssignableUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * 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 + * 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 + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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. + */ + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: never, + ): Promise; + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/assignable/search', + method: 'GET', + params: { + query: parameters?.query, + sessionId: parameters?.sessionId, + username: parameters?.username, + accountId: parameters?.accountId, + project: parameters?.project, + issueKey: parameters?.issueKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + actionDescriptorId: parameters?.actionDescriptorId, + recommend: parameters?.recommend, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: never, + ): Promise; + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/permission/search', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + permissions: parameters.permissions, + issueKey: parameters.issueKey, + projectKey: parameters.projectKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback: Callback, + ): Promise; + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: never, + ): Promise; + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/picker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), + avatarSize: parameters.avatarSize, + excludeConnectUsers: parameters.excludeConnectUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of 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 + * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers( + parameters: Parameters.FindUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of 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 + * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; + async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + property: parameters?.property, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/search/query', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-2-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: never, + ): Promise; + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/search/query/key', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters: Parameters.FindUsersWithBrowsePermission | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: never, + ): Promise; + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/viewissue/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + issueKey: parameters?.issueKey, + projectKey: parameters?.projectKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/userSearch.ts b/src/version2/userSearch.ts deleted file mode 100644 index 9d7a4ca6dc..0000000000 --- a/src/version2/userSearch.ts +++ /dev/null @@ -1,608 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class UserSearch { - constructor(private client: Client) {} - - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback: Callback, - ): Promise; - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: never, - ): Promise; - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/assignable/multiProjectSearch', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - projectKeys: parameters.projectKeys, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * 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 - * 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 - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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. - */ - async findAssignableUsers( - parameters: Parameters.FindAssignableUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * 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 - * 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 - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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. - */ - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: never, - ): Promise; - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/assignable/search', - method: 'GET', - params: { - query: parameters?.query, - sessionId: parameters?.sessionId, - username: parameters?.username, - accountId: parameters?.accountId, - project: parameters?.project, - issueKey: parameters?.issueKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - actionDescriptorId: parameters?.actionDescriptorId, - recommend: parameters?.recommend, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: never, - ): Promise; - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/permission/search', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - permissions: parameters.permissions, - issueKey: parameters.issueKey, - projectKey: parameters.projectKey, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback: Callback, - ): Promise; - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: never, - ): Promise; - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/picker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), - avatarSize: parameters.avatarSize, - excludeConnectUsers: parameters.excludeConnectUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of 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 - * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers( - parameters: Parameters.FindUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of 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 - * search string and property, use [Get all users](#api-rest-api-2-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; - async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - property: parameters?.property, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/search/query', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-2-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: never, - ): Promise; - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/search/query/key', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters: Parameters.FindUsersWithBrowsePermission | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-2-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: never, - ): Promise; - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/viewissue/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - issueKey: parameters?.issueKey, - projectKey: parameters?.projectKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/users.mts b/src/version2/users.mts new file mode 100644 index 0000000000..9490379011 --- /dev/null +++ b/src/version2/users.mts @@ -0,0 +1,495 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Users { + constructor(private client: Client) {} + + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * 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:** _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 { + const config: RequestConfig = { + url: '/rest/api/2/user', + method: 'GET', + params: { + accountId: parameters?.accountId, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; + async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user', + method: 'POST', + data: { + emailAddress: parameters.emailAddress, + key: parameters.key, + name: parameters.name, + password: parameters.password, + products: parameters.products, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; + async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user', + method: 'DELETE', + params: { + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; + async bulkGetUsers( + parameters: Parameters.BulkGetUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/bulk', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + accountId: paramSerializer('accountId', parameters.accountId), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback: Callback, + ): Promise; + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: never, + ): Promise; + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/bulk/migration', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + username: paramSerializer('username', parameters.username), + key: paramSerializer('key', parameters.key), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters: Parameters.GetUserDefaultColumns | undefined, + callback: Callback, + ): Promise; + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: never, + ): Promise; + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/columns', + method: 'GET', + params: { + accountId: parameters?.accountId, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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 | undefined, + 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 { + const config: RequestConfig = { + url: '/rest/api/2/user/columns', + method: 'PUT', + params: { + accountId: parameters?.accountId, + }, + data: parameters?.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/columns', + method: 'DELETE', + params: { + accountId: parameters.accountId, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. 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). + */ + 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 + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: never, + ): Promise; + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/2/user/email', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. 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). + */ + 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 + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: never, + ): Promise; + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/2/user/email/bulk', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the groups to which a user belongs. + * + * **[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 getUserGroups( + parameters: Parameters.GetUserGroups, + callback: Callback, + ): Promise; + /** + * Returns the groups to which a user belongs. + * + * **[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 getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; + async getUserGroups( + parameters: Parameters.GetUserGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/user/groups', + method: 'GET', + params: { + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault( + parameters: Parameters.GetAllUsersDefault | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; + async getAllUsersDefault( + parameters?: Parameters.GetAllUsersDefault, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/users', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers( + parameters: Parameters.GetAllUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/users/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/users.ts b/src/version2/users.ts deleted file mode 100644 index 623d7be9b0..0000000000 --- a/src/version2/users.ts +++ /dev/null @@ -1,495 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class Users { - constructor(private client: Client) {} - - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * 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:** _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 { - const config: RequestConfig = { - url: '/rest/api/2/user', - method: 'GET', - params: { - accountId: parameters?.accountId, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; - async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user', - method: 'POST', - data: { - emailAddress: parameters.emailAddress, - key: parameters.key, - name: parameters.name, - password: parameters.password, - products: parameters.products, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; - async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user', - method: 'DELETE', - params: { - accountId: parameters.accountId, - username: parameters.username, - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; - async bulkGetUsers( - parameters: Parameters.BulkGetUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/bulk', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - accountId: paramSerializer('accountId', parameters.accountId), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback: Callback, - ): Promise; - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: never, - ): Promise; - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/bulk/migration', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - username: paramSerializer('username', parameters.username), - key: paramSerializer('key', parameters.key), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters: Parameters.GetUserDefaultColumns | undefined, - callback: Callback, - ): Promise; - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: never, - ): Promise; - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/columns', - method: 'GET', - params: { - accountId: parameters?.accountId, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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 | undefined, - 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 { - const config: RequestConfig = { - url: '/rest/api/2/user/columns', - method: 'PUT', - params: { - accountId: parameters?.accountId, - }, - data: parameters?.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/columns', - method: 'DELETE', - params: { - accountId: parameters.accountId, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. 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). - */ - 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 - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: never, - ): Promise; - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/2/user/email', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. 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). - */ - 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 - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: never, - ): Promise; - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/2/user/email/bulk', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the groups to which a user belongs. - * - * **[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 getUserGroups( - parameters: Parameters.GetUserGroups, - callback: Callback, - ): Promise; - /** - * Returns the groups to which a user belongs. - * - * **[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 getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/user/groups', - method: 'GET', - params: { - accountId: parameters.accountId, - username: parameters.username, - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault( - parameters: Parameters.GetAllUsersDefault | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; - async getAllUsersDefault( - parameters?: Parameters.GetAllUsersDefault, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/users', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers( - parameters: Parameters.GetAllUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/users/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/webhooks.mts b/src/version2/webhooks.mts new file mode 100644 index 0000000000..c7ef3dbcf0 --- /dev/null +++ b/src/version2/webhooks.mts @@ -0,0 +1,221 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Webhooks { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters: Parameters.GetDynamicWebhooksForApp | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: never, + ): Promise; + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback: Callback, + ): Promise; + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: never, + ): Promise; + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook', + method: 'POST', + data: { + webhooks: parameters.webhooks, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; + async deleteWebhookById( + parameters: Parameters.DeleteWebhookById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook', + method: 'DELETE', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters: Parameters.GetFailedWebhooks | undefined, + callback: Callback, + ): Promise; + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: never, + ): Promise; + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook/failed', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + after: parameters?.after, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback: Callback, + ): Promise; + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: never, + ): Promise; + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/webhook/refresh', + method: 'PUT', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/webhooks.ts b/src/version2/webhooks.ts deleted file mode 100644 index 1d32412afa..0000000000 --- a/src/version2/webhooks.ts +++ /dev/null @@ -1,221 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Webhooks { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters: Parameters.GetDynamicWebhooksForApp | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: never, - ): Promise; - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback: Callback, - ): Promise; - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: never, - ): Promise; - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook', - method: 'POST', - data: { - webhooks: parameters.webhooks, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; - async deleteWebhookById( - parameters: Parameters.DeleteWebhookById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook', - method: 'DELETE', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters: Parameters.GetFailedWebhooks | undefined, - callback: Callback, - ): Promise; - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: never, - ): Promise; - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook/failed', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - after: parameters?.after, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback: Callback, - ): Promise; - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: never, - ): Promise; - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/webhook/refresh', - method: 'PUT', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowSchemeDrafts.mts b/src/version2/workflowSchemeDrafts.mts new file mode 100644 index 0000000000..0a22b1b680 --- /dev/null +++ b/src/version2/workflowSchemeDrafts.mts @@ -0,0 +1,542 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeDrafts { + constructor(private client: Client) {} + + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback: Callback, + ): Promise; + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: never, + ): Promise; + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/createdraft`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * 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: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback: Callback, + ): Promise; + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: never, + ): Promise; + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: never, + ): Promise; + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, + method: 'PUT', + data: { + workflow: parameters.workflow, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * 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 + * `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 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 publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * 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 + * `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 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 publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: never, + ): Promise; + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/draft/publish`, + method: 'POST', + params: { + validateOnly: typeof parameters !== 'string' && parameters.validateOnly, + }, + data: { + statusMappings: typeof parameters !== 'string' && parameters.statusMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: never, + ): Promise; + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'GET', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: never, + ): Promise; + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + workflow: parameters.workflow, + issueTypes: parameters.issueTypes, + defaultMapping: parameters.defaultMapping, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: never, + ): Promise; + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, + method: 'DELETE', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowSchemeDrafts.ts b/src/version2/workflowSchemeDrafts.ts deleted file mode 100644 index 2a6a38cb1b..0000000000 --- a/src/version2/workflowSchemeDrafts.ts +++ /dev/null @@ -1,542 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowSchemeDrafts { - constructor(private client: Client) {} - - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback: Callback, - ): Promise; - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: never, - ): Promise; - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/createdraft`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * 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: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback: Callback, - ): Promise; - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: never, - ): Promise; - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft/default`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: never, - ): Promise; - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/default`, - method: 'PUT', - data: { - workflow: parameters.workflow, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft/default`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * 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 - * `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 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 publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * 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 - * `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 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 publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: never, - ): Promise; - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/draft/publish`, - method: 'POST', - params: { - validateOnly: typeof parameters !== 'string' && parameters.validateOnly, - }, - data: { - statusMappings: typeof parameters !== 'string' && parameters.statusMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: never, - ): Promise; - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'GET', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: never, - ): Promise; - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, - defaultMapping: parameters.defaultMapping, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: never, - ): Promise; - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/draft/workflow`, - method: 'DELETE', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowSchemeProjectAssociations.mts b/src/version2/workflowSchemeProjectAssociations.mts new file mode 100644 index 0000000000..a76793af54 --- /dev/null +++ b/src/version2/workflowSchemeProjectAssociations.mts @@ -0,0 +1,91 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeProjectAssociations { + constructor(private client: Client) {} + + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: never, + ): Promise; + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/project', + method: 'GET', + params: { + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[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 | undefined, + callback: Callback, + ): Promise; + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[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?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/project', + method: 'PUT', + data: { + workflowSchemeId: parameters?.workflowSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowSchemeProjectAssociations.ts b/src/version2/workflowSchemeProjectAssociations.ts deleted file mode 100644 index cda7595756..0000000000 --- a/src/version2/workflowSchemeProjectAssociations.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowSchemeProjectAssociations { - constructor(private client: Client) {} - - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: never, - ): Promise; - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme/project', - method: 'GET', - params: { - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[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 | undefined, - callback: Callback, - ): Promise; - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[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?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme/project', - method: 'PUT', - data: { - workflowSchemeId: parameters?.workflowSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowSchemes.mts b/src/version2/workflowSchemes.mts new file mode 100644 index 0000000000..0ab2d544f4 --- /dev/null +++ b/src/version2/workflowSchemes.mts @@ -0,0 +1,596 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters: Parameters.GetAllWorkflowSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: never, + ): Promise; + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a workflow 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 createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * Creates a workflow 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 createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: never, + ): Promise; + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme', + method: 'POST', + data: { + 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, + self: parameters.self, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a workflow 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 getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a workflow 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 getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: never, + ): Promise; + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * 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/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: never, + ): Promise; + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: never, + ): Promise; + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/default`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: never, + ): Promise; + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/default`, + method: 'PUT', + data: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/default`, + method: 'DELETE', + params: { + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'GET', + params: { + returnDraftIfExists: parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'DELETE', + params: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: never, + ): Promise; + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/workflow`, + method: 'GET', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: never, + ): Promise; + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + defaultMapping: parameters.defaultMapping, + issueTypes: parameters.issueTypes, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: never, + ): Promise; + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${id}/workflow`, + method: 'DELETE', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts deleted file mode 100644 index fa846e60fa..0000000000 --- a/src/version2/workflowSchemes.ts +++ /dev/null @@ -1,596 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters: Parameters.GetAllWorkflowSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: never, - ): Promise; - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a workflow 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 createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Creates a workflow 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 createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: never, - ): Promise; - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflowscheme', - method: 'POST', - data: { - 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, - self: parameters.self, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a workflow 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 getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a workflow 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 getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: never, - ): Promise; - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * 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/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: never, - ): Promise; - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: never, - ): Promise; - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/default`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: never, - ): Promise; - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/default`, - method: 'PUT', - data: { - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - workflow: parameters.workflow, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/default`, - method: 'DELETE', - params: { - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'GET', - params: { - returnDraftIfExists: parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'DELETE', - params: { - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: never, - ): Promise; - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/workflow`, - method: 'GET', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: never, - ): Promise; - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${parameters.id}/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - defaultMapping: parameters.defaultMapping, - issueTypes: parameters.issueTypes, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - workflow: parameters.workflow, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: never, - ): Promise; - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/2/workflowscheme/${id}/workflow`, - method: 'DELETE', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowStatusCategories.mts b/src/version2/workflowStatusCategories.mts new file mode 100644 index 0000000000..86d748c40b --- /dev/null +++ b/src/version2/workflowStatusCategories.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatusCategories { + constructor(private client: Client) {} + + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback: Callback): Promise; + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback?: never): Promise; + async getStatusCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/statuscategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-2-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback: Callback, + ): Promise; + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-2-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: never, + ): Promise; + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: Callback, + ): Promise { + const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; + + const config: RequestConfig = { + url: `/rest/api/2/statuscategory/${idOrKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowStatusCategories.ts b/src/version2/workflowStatusCategories.ts deleted file mode 100644 index 64588da218..0000000000 --- a/src/version2/workflowStatusCategories.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowStatusCategories { - constructor(private client: Client) {} - - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback: Callback): Promise; - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback?: never): Promise; - async getStatusCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/statuscategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-2-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback: Callback, - ): Promise; - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-2-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: never, - ): Promise; - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: Callback, - ): Promise { - const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; - - const config: RequestConfig = { - url: `/rest/api/2/statuscategory/${idOrKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowStatuses.mts b/src/version2/workflowStatuses.mts new file mode 100644 index 0000000000..5dd07f34b7 --- /dev/null +++ b/src/version2/workflowStatuses.mts @@ -0,0 +1,73 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatuses { + constructor(private client: Client) {} + + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getStatuses(callback: Callback): Promise; + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getStatuses(callback?: never): Promise; + async getStatuses(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/status', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. + */ + async getStatus( + parameters: Parameters.GetStatus | string, + callback: Callback, + ): Promise; + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. + */ + async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; + async getStatus( + parameters: Parameters.GetStatus | string, + callback?: Callback, + ): Promise { + const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; + + const config: RequestConfig = { + url: `/rest/api/2/status/${idOrName}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowStatuses.ts b/src/version2/workflowStatuses.ts deleted file mode 100644 index 32d2d469ad..0000000000 --- a/src/version2/workflowStatuses.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowStatuses { - constructor(private client: Client) {} - - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getStatuses(callback: Callback): Promise; - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. - */ - async getStatuses(callback?: never): Promise; - async getStatuses(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/2/status', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. - */ - async getStatus( - parameters: Parameters.GetStatus | string, - callback: Callback, - ): Promise; - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required: None. - */ - async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; - async getStatus( - parameters: Parameters.GetStatus | string, - callback?: Callback, - ): Promise { - const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; - - const config: RequestConfig = { - url: `/rest/api/2/status/${idOrName}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowTransitionProperties.mts b/src/version2/workflowTransitionProperties.mts new file mode 100644 index 0000000000..26a83c9cb9 --- /dev/null +++ b/src/version2/workflowTransitionProperties.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionProperties { + constructor(private client: Client) {} + + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback: Callback, + ): Promise; + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: never, + ): Promise; + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'GET', + params: { + includeReservedKeys: parameters.includeReservedKeys, + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'POST', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'PUT', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: never, + ): Promise; + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, + method: 'DELETE', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowTransitionProperties.ts b/src/version2/workflowTransitionProperties.ts deleted file mode 100644 index 035515a9cc..0000000000 --- a/src/version2/workflowTransitionProperties.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowTransitionProperties { - constructor(private client: Client) {} - - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback: Callback, - ): Promise; - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: never, - ): Promise; - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'GET', - params: { - includeReservedKeys: parameters.includeReservedKeys, - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'POST', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'PUT', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: never, - ): Promise; - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/2/workflow/transitions/${parameters.transitionId}/properties`, - method: 'DELETE', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflowTransitionRules.mts b/src/version2/workflowTransitionRules.mts new file mode 100644 index 0000000000..b2d7d95a37 --- /dev/null +++ b/src/version2/workflowTransitionRules.mts @@ -0,0 +1,195 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '@/clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionRules { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition 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 are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [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 getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition 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 are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [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 getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/rule/config', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + types: parameters.types, + keys: parameters.keys, + workflowNames: parameters.workflowNames, + withTags: parameters.withTags, + draft: parameters.draft, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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](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: + * + * - 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). + * + * Rules are enabled if the `disabled` parameter is not provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [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, + callback: Callback, + ): Promise; + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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](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: + * + * - 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). + * + * Rules are enabled if the `disabled` parameter is not provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * [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, + callback?: never, + ): Promise; + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/rule/config', + method: 'PUT', + data: { + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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 deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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 deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/rule/config/delete', + method: 'PUT', + data: { + workflows: parameters?.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflowTransitionRules.ts b/src/version2/workflowTransitionRules.ts deleted file mode 100644 index ed920a1c35..0000000000 --- a/src/version2/workflowTransitionRules.ts +++ /dev/null @@ -1,195 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowTransitionRules { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition 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 are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [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 getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition 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 are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [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 getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/rule/config', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - types: parameters.types, - keys: parameters.keys, - workflowNames: parameters.workflowNames, - withTags: parameters.withTags, - draft: parameters.draft, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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](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: - * - * - 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). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [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, - callback: Callback, - ): Promise; - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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](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: - * - * - 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). - * - * Rules are enabled if the `disabled` parameter is not provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * [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, - callback?: never, - ): Promise; - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/rule/config', - method: 'PUT', - data: { - workflows: parameters.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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 deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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 deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/rule/config/delete', - method: 'PUT', - data: { - workflows: parameters?.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version2/workflows.mts b/src/version2/workflows.mts new file mode 100644 index 0000000000..81ec8b8ac4 --- /dev/null +++ b/src/version2/workflows.mts @@ -0,0 +1,400 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Workflows { + constructor(private client: Client) {} + + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback: Callback, + ): Promise; + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + statuses: parameters.statuses, + transitions: parameters.transitions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowsPaginated( + parameters: Parameters.GetWorkflowsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: never, + ): Promise; + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflow/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + workflowName: paramSerializer('workflowName', parameters?.workflowName), + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow 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 deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow 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 deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: never, + ): Promise; + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: Callback, + ): Promise { + const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; + + const config: RequestConfig = { + url: `/rest/api/2/workflow/${entityId}`, + method: 'DELETE', + }; + + 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/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 readWorkflows( + parameters: Parameters.ReadWorkflows, + 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/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 readWorkflows(parameters: Parameters.ReadWorkflows, callback?: never): Promise; + async readWorkflows( + parameters: Parameters.ReadWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows', + method: 'POST', + params: { + expand: parameters.expand, + }, + 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 organized 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/v2/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: 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 organized 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/v2/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/2/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/v2/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/v2/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/2/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/v2/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/v2/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/2/workflows/create/validation', + method: 'POST', + data: { + payload: parameters.payload, + validationOptions: parameters.validationOptions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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/v2/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/2/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/v2/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/v2/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/2/workflows/update/validation', + method: 'POST', + data: { + payload: parameters.payload, + validationOptions: parameters.validationOptions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/workflows.ts b/src/version2/workflows.ts deleted file mode 100644 index 8b2729c337..0000000000 --- a/src/version2/workflows.ts +++ /dev/null @@ -1,400 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class Workflows { - constructor(private client: Client) {} - - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback: Callback, - ): Promise; - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - statuses: parameters.statuses, - transitions: parameters.transitions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters: Parameters.GetWorkflowsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen workflows. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: never, - ): Promise; - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflow/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - workflowName: paramSerializer('workflowName', parameters?.workflowName), - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - isActive: parameters?.isActive, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow 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 deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow 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 deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: never, - ): Promise; - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: Callback, - ): Promise { - const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; - - const config: RequestConfig = { - url: `/rest/api/2/workflow/${entityId}`, - method: 'DELETE', - }; - - 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/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 readWorkflows( - parameters: Parameters.ReadWorkflows, - 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/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 readWorkflows(parameters: Parameters.ReadWorkflows, callback?: never): Promise; - async readWorkflows( - parameters: Parameters.ReadWorkflows, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/2/workflows', - method: 'POST', - params: { - expand: parameters.expand, - }, - 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 organized 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/v2/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: 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 organized 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/v2/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/2/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/v2/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/v2/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/2/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/v2/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/v2/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/2/workflows/create/validation', - method: 'POST', - data: { - payload: parameters.payload, - validationOptions: parameters.validationOptions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update workflows and related statuses. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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/v2/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/2/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/v2/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/v2/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/2/workflows/update/validation', - method: 'POST', - data: { - payload: parameters.payload, - validationOptions: parameters.validationOptions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/announcementBanner.mts b/src/version3/announcementBanner.mts new file mode 100644 index 0000000000..9d3e96d137 --- /dev/null +++ b/src/version3/announcementBanner.mts @@ -0,0 +1,61 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AnnouncementBanner { + constructor(private client: Client) {} + + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback: Callback): Promise; + /** + * Returns the current announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBanner(callback?: never): Promise; + async getBanner(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/announcementBanner', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters: Parameters.SetBanner | undefined, callback: Callback): Promise; + /** + * Updates the announcement banner configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setBanner(parameters?: Parameters.SetBanner, callback?: never): Promise; + async setBanner(parameters?: Parameters.SetBanner, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/announcementBanner', + method: 'PUT', + data: { + isDismissible: parameters?.isDismissible, + isEnabled: parameters?.isEnabled, + message: parameters?.message, + visibility: parameters?.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/announcementBanner.ts b/src/version3/announcementBanner.ts deleted file mode 100644 index e0e8ff2b27..0000000000 --- a/src/version3/announcementBanner.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AnnouncementBanner { - constructor(private client: Client) {} - - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback: Callback): Promise; - /** - * Returns the current announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getBanner(callback?: never): Promise; - async getBanner(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/announcementBanner', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters: Parameters.SetBanner | undefined, callback: Callback): Promise; - /** - * Updates the announcement banner configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setBanner(parameters?: Parameters.SetBanner, callback?: never): Promise; - async setBanner(parameters?: Parameters.SetBanner, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/announcementBanner', - method: 'PUT', - data: { - isDismissible: parameters?.isDismissible, - isEnabled: parameters?.isEnabled, - message: parameters?.message, - visibility: parameters?.visibility, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/appMigration.mts b/src/version3/appMigration.mts new file mode 100644 index 0000000000..4ec07537fd --- /dev/null +++ b/src/version3/appMigration.mts @@ -0,0 +1,114 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppMigration { + constructor(private client: Client) {} + + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; + /** + * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom + * fields can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; + async updateIssueFields( + parameters: Parameters.UpdateIssueFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/field', + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + updateValueList: parameters.updateValueList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback: Callback, + ): Promise; + /** + * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for + * use by Connect apps during app migration. + */ + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: never, + ): Promise; + async updateEntityPropertiesValue( + parameters: Parameters.UpdateEntityPropertiesValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, + method: 'PUT', + headers: { + 'Atlassian-Account-Id': parameters.accountId, + 'Atlassian-Transfer-Id': parameters.transferId, + 'Content-Type': 'application/json', + }, + data: parameters.entities, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback: Callback, + ): Promise; + /** + * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect + * app. + */ + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: never, + ): Promise; + async workflowRuleSearch( + parameters: Parameters.WorkflowRuleSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/migration/workflow/rule/search', + method: 'POST', + headers: { + 'Atlassian-Transfer-Id': parameters.transferId, + }, + data: { + expand: parameters.expand, + ruleIds: parameters.ruleIds, + workflowEntityId: parameters.workflowEntityId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/appMigration.ts b/src/version3/appMigration.ts deleted file mode 100644 index cbea50328c..0000000000 --- a/src/version3/appMigration.ts +++ /dev/null @@ -1,114 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AppMigration { - constructor(private client: Client) {} - - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; - /** - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom - * fields can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; - async updateIssueFields( - parameters: Parameters.UpdateIssueFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/field', - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - updateValueList: parameters.updateValueList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback: Callback, - ): Promise; - /** - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for - * use by Connect apps during app migration. - */ - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: never, - ): Promise; - async updateEntityPropertiesValue( - parameters: Parameters.UpdateEntityPropertiesValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, - method: 'PUT', - headers: { - 'Atlassian-Account-Id': parameters.accountId, - 'Atlassian-Transfer-Id': parameters.transferId, - 'Content-Type': 'application/json', - }, - data: parameters.entities, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback: Callback, - ): Promise; - /** - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect - * app. - */ - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: never, - ): Promise; - async workflowRuleSearch( - parameters: Parameters.WorkflowRuleSearch, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/migration/workflow/rule/search', - method: 'POST', - headers: { - 'Atlassian-Transfer-Id': parameters.transferId, - }, - data: { - expand: parameters.expand, - ruleIds: parameters.ruleIds, - workflowEntityId: parameters.workflowEntityId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/appProperties.mts b/src/version3/appProperties.mts new file mode 100644 index 0000000000..5fa02e9376 --- /dev/null +++ b/src/version3/appProperties.mts @@ -0,0 +1,223 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AppProperties { + constructor(private client: Client) {} + + /** + * 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/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback: Callback, + ): Promise; + /** + * 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/). + */ + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: never, + ): Promise; + async getAddonProperties( + parameters: Parameters.GetAddonProperties | string, + callback?: Callback, + ): Promise { + const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; + + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback: Callback, + ): Promise; + /** + * 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/). + */ + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: never, + ): Promise; + async getAddonProperty( + parameters: Parameters.GetAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * 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. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of an app's property. Use this resource to store custom data for your app. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * 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. + */ + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: never, + ): Promise; + async putAddonProperty( + parameters: Parameters.PutAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + */ + 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. + */ + async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; + async deleteAddonProperty( + parameters: Parameters.DeleteAddonProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback: Callback, + ): Promise; + /** + * 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). + * + * For other use cases, use the [Storage + * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: never, + ): Promise; + async putAppProperty( + parameters: Parameters.PutAppProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; + /** + * Deletes a Forge app's property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Forge apps can make this request. + */ + async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; + async deleteAppProperty( + parameters: Parameters.DeleteAppProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/appProperties.ts b/src/version3/appProperties.ts deleted file mode 100644 index 9dd3e5722f..0000000000 --- a/src/version3/appProperties.ts +++ /dev/null @@ -1,223 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AppProperties { - constructor(private client: Client) {} - - /** - * 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/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback: Callback, - ): Promise; - /** - * 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/). - */ - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: never, - ): Promise; - async getAddonProperties( - parameters: Parameters.GetAddonProperties | string, - callback?: Callback, - ): Promise { - const addonKey = typeof parameters === 'string' ? parameters : parameters.addonKey; - - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback: Callback, - ): Promise; - /** - * 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/). - */ - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: never, - ): Promise; - async getAddonProperty( - parameters: Parameters.GetAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * 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. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of an app's property. Use this resource to store custom data for your app. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * 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. - */ - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: never, - ): Promise; - async putAddonProperty( - parameters: Parameters.PutAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - */ - 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. - */ - async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; - async deleteAddonProperty( - parameters: Parameters.DeleteAddonProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/atlassian-connect/1/addons/${parameters.addonKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback: Callback, - ): Promise; - /** - * 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). - * - * For other use cases, use the [Storage - * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: never, - ): Promise; - async putAppProperty( - parameters: Parameters.PutAppProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; - /** - * Deletes a Forge app's property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Forge apps can make this request. - */ - async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; - async deleteAppProperty( - parameters: Parameters.DeleteAppProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/applicationRoles.mts b/src/version3/applicationRoles.mts new file mode 100644 index 0000000000..ec469d2a93 --- /dev/null +++ b/src/version3/applicationRoles.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ApplicationRoles { + constructor(private client: Client) {} + + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback: Callback): Promise; + /** + * Returns all application roles. In Jira, application roles are managed using the [Application access + * configuration](https://confluence.atlassian.com/x/3YxjL) page. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllApplicationRoles(callback?: never): Promise; + async getAllApplicationRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/applicationrole', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback: Callback, + ): Promise; + /** + * Returns an application role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: never, + ): Promise; + async getApplicationRole( + parameters: Parameters.GetApplicationRole | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters.key; + + const config: RequestConfig = { + url: `/rest/api/3/applicationrole/${key}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/applicationRoles.ts b/src/version3/applicationRoles.ts deleted file mode 100644 index 6ffd77f954..0000000000 --- a/src/version3/applicationRoles.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ApplicationRoles { - constructor(private client: Client) {} - - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback: Callback): Promise; - /** - * Returns all application roles. In Jira, application roles are managed using the [Application access - * configuration](https://confluence.atlassian.com/x/3YxjL) page. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllApplicationRoles(callback?: never): Promise; - async getAllApplicationRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/applicationrole', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback: Callback, - ): Promise; - /** - * Returns an application role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: never, - ): Promise; - async getApplicationRole( - parameters: Parameters.GetApplicationRole | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters.key; - - const config: RequestConfig = { - url: `/rest/api/3/applicationrole/${key}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/auditRecords.mts b/src/version3/auditRecords.mts new file mode 100644 index 0000000000..664b4a3e54 --- /dev/null +++ b/src/version3/auditRecords.mts @@ -0,0 +1,79 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class AuditRecords { + constructor(private client: Client) {} + + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords( + parameters: Parameters.GetAuditRecords | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of audit records. The list can be filtered to include items: + * + * - Where each item in `filter` has at least one match in any of these fields: + * + * - `summary` + * - `category` + * - `eventSource` + * - `objectItem.name` If the object is a user, account ID is available to filter. + * - `objectItem.parentName` + * - `objectItem.typeName` + * - `changedValues.changedFrom` + * - `changedValues.changedTo` + * - `remoteAddress` + * + * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and + * `"category": "group management"` is returned. + * - Created on or after a date and time. + * - Created on or before a date and time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; + async getAuditRecords( + parameters?: Parameters.GetAuditRecords, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/auditing/record', + method: 'GET', + params: { + offset: parameters?.offset, + limit: parameters?.limit, + filter: parameters?.filter, + from: parameters?.from, + to: parameters?.to, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/auditRecords.ts b/src/version3/auditRecords.ts deleted file mode 100644 index 4dd4989a93..0000000000 --- a/src/version3/auditRecords.ts +++ /dev/null @@ -1,79 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class AuditRecords { - constructor(private client: Client) {} - - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords( - parameters: Parameters.GetAuditRecords | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of audit records. The list can be filtered to include items: - * - * - Where each item in `filter` has at least one match in any of these fields: - * - * - `summary` - * - `category` - * - `eventSource` - * - `objectItem.name` If the object is a user, account ID is available to filter. - * - `objectItem.parentName` - * - `objectItem.typeName` - * - `changedValues.changedFrom` - * - `changedValues.changedTo` - * - `remoteAddress` - * - * For example, if `filter` contains _man ed_, an audit record containing `summary": "User added to group"` and - * `"category": "group management"` is returned. - * - Created on or after a date and time. - * - Created on or before a date and time. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAuditRecords(parameters?: Parameters.GetAuditRecords, callback?: never): Promise; - async getAuditRecords( - parameters?: Parameters.GetAuditRecords, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/auditing/record', - method: 'GET', - params: { - offset: parameters?.offset, - limit: parameters?.limit, - filter: parameters?.filter, - from: parameters?.from, - to: parameters?.to, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/avatars.mts b/src/version3/avatars.mts new file mode 100644 index 0000000000..d4f626d4c1 --- /dev/null +++ b/src/version3/avatars.mts @@ -0,0 +1,332 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +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. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback: Callback, + ): Promise; + /** + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: never, + ): Promise; + async getAllSystemAvatars( + parameters: Parameters.GetAllSystemAvatars | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/3/avatar/${type}/system`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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 system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; + /** + * Returns the system and custom avatars for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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 system avatars, none. + */ + async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; + async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * 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. + * - [Set project avatar](#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 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. + * + * 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. + * - [Set project avatar](#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 Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: never): Promise; + async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an avatar from a project or issue type. + * + * **[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. + * + * **[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?: never): Promise; + async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback: Callback, + ): Promise; + /** + * Returns the default project or issue type avatar image. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: never, + ): Promise; + async getAvatarImageByType( + parameters: Parameters.GetAvatarImageByType | string, + callback?: Callback, + ): Promise { + const type = typeof parameters === 'string' ? parameters : parameters.type; + + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/view/type/${type}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: typeof parameters !== 'string' && parameters.size, + format: typeof parameters !== 'string' && parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback: Callback, + ): Promise; + /** + * Returns a project or issue type avatar image by ID. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: never, + ): Promise; + async getAvatarImageByID( + parameters: Parameters.GetAvatarImageByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } + + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback: Callback, + ): Promise; + /** + * Returns the avatar image for a project or issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - For system avatars, none. + * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for + * 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. + */ + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: never, + ): Promise; + async getAvatarImageByOwner( + parameters: Parameters.GetAvatarImageByOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, + method: 'GET', + responseType: 'arraybuffer', + params: { + size: parameters.size, + format: parameters.format, + }, + }; + + const { + data: avatar, + headers: { 'content-type': contentTypeWithEncoding }, + } = await this.client.sendRequestFullResponse(config); + + const contentType = contentTypeWithEncoding.split(';')[0].trim(); + + return this.client.handleSuccessResponse({ contentType, avatar }, callback); + } +} diff --git a/src/version3/avatars.ts b/src/version3/avatars.ts deleted file mode 100644 index 849e211659..0000000000 --- a/src/version3/avatars.ts +++ /dev/null @@ -1,332 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback: Callback, - ): Promise; - /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: never, - ): Promise; - async getAllSystemAvatars( - parameters: Parameters.GetAllSystemAvatars | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/3/avatar/${type}/system`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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 system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; - /** - * Returns the system and custom avatars for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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 system avatars, none. - */ - async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; - async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * 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. - * - [Set project avatar](#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 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. - * - * 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. - * - [Set project avatar](#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 Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: never): Promise; - async storeAvatar(parameters: Parameters.StoreAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an avatar from a project or issue type. - * - * **[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. - * - * **[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?: never): Promise; - async deleteAvatar(parameters: Parameters.DeleteAvatar, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.owningObjectId}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback: Callback, - ): Promise; - /** - * Returns the default project or issue type avatar image. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: never, - ): Promise; - async getAvatarImageByType( - parameters: Parameters.GetAvatarImageByType | string, - callback?: Callback, - ): Promise { - const type = typeof parameters === 'string' ? parameters : parameters.type; - - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/view/type/${type}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback: Callback, - ): Promise; - /** - * Returns a project or issue type avatar image by ID. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: never, - ): Promise; - async getAvatarImageByID( - parameters: Parameters.GetAvatarImageByID, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/avatar/${parameters.id}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } - - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback: Callback, - ): Promise; - /** - * Returns the avatar image for a project or issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - For system avatars, none. - * - For custom project avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for - * 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. - */ - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: never, - ): Promise; - async getAvatarImageByOwner( - parameters: Parameters.GetAvatarImageByOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/universal_avatar/view/type/${parameters.type}/owner/${parameters.entityId}`, - method: 'GET', - responseType: 'arraybuffer', - params: { - size: parameters.size, - format: parameters.format, - }, - }; - - const { - data: avatar, - headers: { 'content-type': contentTypeWithEncoding }, - } = await this.client.sendRequestFullResponse(config); - - const contentType = contentTypeWithEncoding.split(';')[0].trim(); - - return this.client.handleSuccessResponse({ contentType, avatar }, callback); - } -} diff --git a/src/version3/client/index.ts b/src/version3/client/index.ts deleted file mode 100644 index 97891de5e3..0000000000 --- a/src/version3/client/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './version3Client'; diff --git a/src/version3/client/version3Client.mts b/src/version3/client/version3Client.mts new file mode 100644 index 0000000000..81c35543b0 --- /dev/null +++ b/src/version3/client/version3Client.mts @@ -0,0 +1,176 @@ +import { BaseClient } from '@/clients/baseClient.mjs'; +import { AnnouncementBanner } from '@/version3/announcementBanner.mjs'; +import { AppMigration } from '@/version3/appMigration.mjs'; +import { AppProperties } from '@/version3/appProperties.mjs'; +import { ApplicationRoles } from '@/version3/applicationRoles.mjs'; +import { AuditRecords } from '@/version3/auditRecords.mjs'; +import { Avatars } from '@/version3/avatars.mjs'; +import { Dashboards } from '@/version3/dashboards.mjs'; +import { DynamicModules } from '@/version3/dynamicModules.mjs'; +import { FilterSharing } from '@/version3/filterSharing.mjs'; +import { Filters } from '@/version3/filters.mjs'; +import { GroupAndUserPicker } from '@/version3/groupAndUserPicker.mjs'; +import { Groups } from '@/version3/groups.mjs'; +import { InstanceInformation } from '@/version3/instanceInformation.mjs'; +import { IssueAttachments } from '@/version3/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version3/issueCommentProperties.mjs'; +import { IssueComments } from '@/version3/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version3/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version3/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version3/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version3/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version3/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version3/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version3/issueFields.mjs'; +import { IssueLinkTypes } from '@/version3/issueLinkTypes.mjs'; +import { IssueLinks } from '@/version3/issueLinks.mjs'; +import { IssueNavigatorSettings } from '@/version3/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version3/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version3/issuePriorities.mjs'; +import { IssueProperties } from '@/version3/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version3/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version3/issueResolutions.mjs'; +import { IssueSearch } from '@/version3/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version3/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version3/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version3/issueTypeProperties.mjs'; +import { IssueTypeSchemes } from '@/version3/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version3/issueTypeScreenSchemes.mjs'; +import { IssueTypes } from '@/version3/issueTypes.mjs'; +import { IssueVotes } from '@/version3/issueVotes.mjs'; +import { IssueWatchers } from '@/version3/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version3/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version3/issueWorklogs.mjs'; +import { Issues } from '@/version3/issues.mjs'; +import { JiraExpressions } from '@/version3/jiraExpressions.mjs'; +import { JiraSettings } from '@/version3/jiraSettings.mjs'; +import { JQL } from '@/version3/jql.mjs'; +import { JqlFunctionsApps } from '@/version3/jqlFunctionsApps.mjs'; +import { Labels } from '@/version3/labels.mjs'; +import { LicenseMetrics } from '@/version3/licenseMetrics.mjs'; +import { Myself } from '@/version3/myself.mjs'; +import { PermissionSchemes } from '@/version3/permissionSchemes.mjs'; +import { Permissions } from '@/version3/permissions.mjs'; +import { ProjectAvatars } from '@/version3/projectAvatars.mjs'; +import { ProjectCategories } from '@/version3/projectCategories.mjs'; +import { ProjectComponents } from '@/version3/projectComponents.mjs'; +import { ProjectEmail } from '@/version3/projectEmail.mjs'; +import { ProjectFeatures } from '@/version3/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version3/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version3/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version3/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version3/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version3/projectRoles.mjs'; +import { ProjectTypes } from '@/version3/projectTypes.mjs'; +import { ProjectVersions } from '@/version3/projectVersions.mjs'; +import { Projects } from '@/version3/projects.mjs'; +import { ScreenSchemes } from '@/version3/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version3/screenTabFields.mjs'; +import { ScreenTabs } from '@/version3/screenTabs.mjs'; +import { Screens } from '@/version3/screens.mjs'; +import { ServerInfo } from '@/version3/serverInfo.mjs'; +import { Status } from '@/version3/status.mjs'; +import { Tasks } from '@/version3/tasks.mjs'; +import { TimeTracking } from '@/version3/timeTracking.mjs'; +import { UiModificationsApps } from '@/version3/uiModificationsApps.mjs'; +import { UserProperties } from '@/version3/userProperties.mjs'; +import { UserSearch } from '@/version3/userSearch.mjs'; +import { Users } from '@/version3/users.mjs'; +import { Webhooks } from '@/version3/webhooks.mjs'; +import { Workflows } from '@/version3/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version3/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version3/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version3/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version3/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version3/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version3/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version3/workflowTransitionRules.mjs'; + +export class Version3Client extends BaseClient { + announcementBanner = new AnnouncementBanner(this); + applicationRoles = new ApplicationRoles(this); + appMigration = new AppMigration(this); + appProperties = new AppProperties(this); + auditRecords = new AuditRecords(this); + avatars = new Avatars(this); + dashboards = new Dashboards(this); + dynamicModules = new DynamicModules(this); + filters = new Filters(this); + filterSharing = new FilterSharing(this); + groupAndUserPicker = new GroupAndUserPicker(this); + groups = new Groups(this); + instanceInformation = new InstanceInformation(this); + issueAttachments = new IssueAttachments(this); + issueCommentProperties = new IssueCommentProperties(this); + issueComments = new IssueComments(this); + issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); + issueCustomFieldContexts = new IssueCustomFieldContexts(this); + issueCustomFieldOptions = new IssueCustomFieldOptions(this); + issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); + issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); + issueFieldConfigurations = new IssueFieldConfigurations(this); + issueFields = new IssueFields(this); + issueLinks = new IssueLinks(this); + issueLinkTypes = new IssueLinkTypes(this); + issueNavigatorSettings = new IssueNavigatorSettings(this); + issueNotificationSchemes = new IssueNotificationSchemes(this); + issuePriorities = new IssuePriorities(this); + issueProperties = new IssueProperties(this); + issueRemoteLinks = new IssueRemoteLinks(this); + issueResolutions = new IssueResolutions(this); + issues = new Issues(this); + issueSearch = new IssueSearch(this); + issueSecurityLevel = new IssueSecurityLevel(this); + issueSecuritySchemes = new IssueSecuritySchemes(this); + issueTypeProperties = new IssueTypeProperties(this); + issueTypes = new IssueTypes(this); + issueTypeSchemes = new IssueTypeSchemes(this); + issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); + issueVotes = new IssueVotes(this); + issueWatchers = new IssueWatchers(this); + issueWorklogProperties = new IssueWorklogProperties(this); + issueWorklogs = new IssueWorklogs(this); + jiraExpressions = new JiraExpressions(this); + jiraSettings = new JiraSettings(this); + jql = new JQL(this); + jqlFunctionsApps = new JqlFunctionsApps(this); + labels = new Labels(this); + licenseMetrics = new LicenseMetrics(this); + myself = new Myself(this); + permissions = new Permissions(this); + permissionSchemes = new PermissionSchemes(this); + projectAvatars = new ProjectAvatars(this); + projectCategories = new ProjectCategories(this); + projectComponents = new ProjectComponents(this); + projectEmail = new ProjectEmail(this); + projectFeatures = new ProjectFeatures(this); + projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); + projectPermissionSchemes = new ProjectPermissionSchemes(this); + projectProperties = new ProjectProperties(this); + projectRoleActors = new ProjectRoleActors(this); + projectRoles = new ProjectRoles(this); + projects = new Projects(this); + projectTypes = new ProjectTypes(this); + projectVersions = new ProjectVersions(this); + screens = new Screens(this); + screenSchemes = new ScreenSchemes(this); + screenTabFields = new ScreenTabFields(this); + screenTabs = new ScreenTabs(this); + serverInfo = new ServerInfo(this); + status = new Status(this); + tasks = new Tasks(this); + timeTracking = new TimeTracking(this); + uiModificationsApps = new UiModificationsApps(this); + userProperties = new UserProperties(this); + users = new Users(this); + userSearch = new UserSearch(this); + webhooks = new Webhooks(this); + workflows = new Workflows(this); + workflowSchemeDrafts = new WorkflowSchemeDrafts(this); + workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); + workflowSchemes = new WorkflowSchemes(this); + workflowStatusCategories = new WorkflowStatusCategories(this); + workflowStatuses = new WorkflowStatuses(this); + workflowTransitionProperties = new WorkflowTransitionProperties(this); + workflowTransitionRules = new WorkflowTransitionRules(this); +} diff --git a/src/version3/client/version3Client.ts b/src/version3/client/version3Client.ts deleted file mode 100644 index e991ff1cc6..0000000000 --- a/src/version3/client/version3Client.ts +++ /dev/null @@ -1,178 +0,0 @@ -import { BaseClient } from '../../clients'; -import { - AnnouncementBanner, - ApplicationRoles, - AppMigration, - AppProperties, - AuditRecords, - Avatars, - Dashboards, - DynamicModules, - Filters, - FilterSharing, - GroupAndUserPicker, - Groups, - InstanceInformation, - IssueAttachments, - IssueCommentProperties, - IssueComments, - IssueCustomFieldConfigurationApps, - IssueCustomFieldContexts, - IssueCustomFieldOptions, - IssueCustomFieldOptionsApps, - IssueCustomFieldValuesApps, - IssueFieldConfigurations, - IssueFields, - IssueLinks, - IssueLinkTypes, - IssueNavigatorSettings, - IssueNotificationSchemes, - IssuePriorities, - IssueProperties, - IssueRemoteLinks, - IssueResolutions, - Issues, - IssueSearch, - IssueSecurityLevel, - IssueSecuritySchemes, - IssueTypeProperties, - IssueTypes, - IssueTypeSchemes, - IssueTypeScreenSchemes, - IssueVotes, - IssueWatchers, - IssueWorklogProperties, - IssueWorklogs, - JiraExpressions, - JiraSettings, - JQL, - JqlFunctionsApps, - Labels, - LicenseMetrics, - Myself, - Permissions, - PermissionSchemes, - ProjectAvatars, - ProjectCategories, - ProjectComponents, - ProjectEmail, - ProjectFeatures, - ProjectKeyAndNameValidation, - ProjectPermissionSchemes, - ProjectProperties, - ProjectRoleActors, - ProjectRoles, - Projects, - ProjectTypes, - ProjectVersions, - Screens, - ScreenSchemes, - ScreenTabFields, - ScreenTabs, - ServerInfo, - Status, - Tasks, - TimeTracking, - UIModificationsApps, - UserProperties, - Users, - UserSearch, - Webhooks, - Workflows, - WorkflowSchemeDrafts, - WorkflowSchemeProjectAssociations, - WorkflowSchemes, - WorkflowStatusCategories, - WorkflowStatuses, - WorkflowTransitionProperties, - WorkflowTransitionRules, -} from '..'; - -export class Version3Client extends BaseClient { - announcementBanner = new AnnouncementBanner(this); - applicationRoles = new ApplicationRoles(this); - appMigration = new AppMigration(this); - appProperties = new AppProperties(this); - auditRecords = new AuditRecords(this); - avatars = new Avatars(this); - dashboards = new Dashboards(this); - dynamicModules = new DynamicModules(this); - filters = new Filters(this); - filterSharing = new FilterSharing(this); - groupAndUserPicker = new GroupAndUserPicker(this); - groups = new Groups(this); - instanceInformation = new InstanceInformation(this); - issueAttachments = new IssueAttachments(this); - issueCommentProperties = new IssueCommentProperties(this); - issueComments = new IssueComments(this); - issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); - issueCustomFieldContexts = new IssueCustomFieldContexts(this); - issueCustomFieldOptions = new IssueCustomFieldOptions(this); - issueCustomFieldOptionsApps = new IssueCustomFieldOptionsApps(this); - issueCustomFieldValuesApps = new IssueCustomFieldValuesApps(this); - issueFieldConfigurations = new IssueFieldConfigurations(this); - issueFields = new IssueFields(this); - issueLinks = new IssueLinks(this); - issueLinkTypes = new IssueLinkTypes(this); - issueNavigatorSettings = new IssueNavigatorSettings(this); - issueNotificationSchemes = new IssueNotificationSchemes(this); - issuePriorities = new IssuePriorities(this); - issueProperties = new IssueProperties(this); - issueRemoteLinks = new IssueRemoteLinks(this); - issueResolutions = new IssueResolutions(this); - issues = new Issues(this); - issueSearch = new IssueSearch(this); - issueSecurityLevel = new IssueSecurityLevel(this); - issueSecuritySchemes = new IssueSecuritySchemes(this); - issueTypeProperties = new IssueTypeProperties(this); - issueTypes = new IssueTypes(this); - issueTypeSchemes = new IssueTypeSchemes(this); - issueTypeScreenSchemes = new IssueTypeScreenSchemes(this); - issueVotes = new IssueVotes(this); - issueWatchers = new IssueWatchers(this); - issueWorklogProperties = new IssueWorklogProperties(this); - issueWorklogs = new IssueWorklogs(this); - jiraExpressions = new JiraExpressions(this); - jiraSettings = new JiraSettings(this); - jql = new JQL(this); - jqlFunctionsApps = new JqlFunctionsApps(this); - labels = new Labels(this); - licenseMetrics = new LicenseMetrics(this); - myself = new Myself(this); - permissions = new Permissions(this); - permissionSchemes = new PermissionSchemes(this); - projectAvatars = new ProjectAvatars(this); - projectCategories = new ProjectCategories(this); - projectComponents = new ProjectComponents(this); - projectEmail = new ProjectEmail(this); - projectFeatures = new ProjectFeatures(this); - projectKeyAndNameValidation = new ProjectKeyAndNameValidation(this); - projectPermissionSchemes = new ProjectPermissionSchemes(this); - projectProperties = new ProjectProperties(this); - projectRoleActors = new ProjectRoleActors(this); - projectRoles = new ProjectRoles(this); - projects = new Projects(this); - projectTypes = new ProjectTypes(this); - projectVersions = new ProjectVersions(this); - screens = new Screens(this); - screenSchemes = new ScreenSchemes(this); - screenTabFields = new ScreenTabFields(this); - screenTabs = new ScreenTabs(this); - serverInfo = new ServerInfo(this); - status = new Status(this); - tasks = new Tasks(this); - timeTracking = new TimeTracking(this); - uiModificationsApps = new UIModificationsApps(this); - userProperties = new UserProperties(this); - users = new Users(this); - userSearch = new UserSearch(this); - webhooks = new Webhooks(this); - workflows = new Workflows(this); - workflowSchemeDrafts = new WorkflowSchemeDrafts(this); - workflowSchemeProjectAssociations = new WorkflowSchemeProjectAssociations(this); - workflowSchemes = new WorkflowSchemes(this); - workflowStatusCategories = new WorkflowStatusCategories(this); - workflowStatuses = new WorkflowStatuses(this); - workflowTransitionProperties = new WorkflowTransitionProperties(this); - workflowTransitionRules = new WorkflowTransitionRules(this); -} diff --git a/src/version3/dashboards.mts b/src/version3/dashboards.mts new file mode 100644 index 0000000000..d07e79ecd1 --- /dev/null +++ b/src/version3/dashboards.mts @@ -0,0 +1,729 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Dashboards { + constructor(private client: Client) {} + + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters: Parameters.GetAllDashboards | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or + * owned dashboards. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: never, + ): Promise; + async getAllDashboards( + parameters?: Parameters.GetAllDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard', + method: 'GET', + params: { + filter: parameters?.filter, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async createDashboard( + parameters: Parameters.CreateDashboard, + callback: Callback, + ): Promise; + /** + * Creates a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; + async createDashboard( + parameters: Parameters.CreateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard', + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback: Callback, + ): Promise; + /** + * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboards to be updated must be owned by the user, or the user must be an administrator. + */ + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: never, + ): Promise; + async bulkEditDashboards( + parameters: Parameters.BulkEditDashboards, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard/bulk/edit', + method: 'PUT', + data: { + action: parameters.action, + changeOwnerDetails: parameters.changeOwnerDetails, + entityIds: parameters.entityIds, + extendAdminPermissions: parameters.extendAdminPermissions, + permissionDetails: parameters.permissionDetails, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets( + callback: Callback, + ): Promise; + /** + * Gets a list of all available gadgets that can be added to all dashboards. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllAvailableDashboardGadgets(callback?: never): Promise; + async getAllAvailableDashboardGadgets( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard/gadgets', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters: Parameters.GetDashboardsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results + * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. + * When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * following dashboards that match the query parameters are returned: + * + * - Dashboards owned by the user. Not returned for anonymous users. + * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. + * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. + * - Dashboards shared with a public project. + * - Dashboards shared with the public. + */ + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: never, + ): Promise; + async getDashboardsPaginated( + parameters?: Parameters.GetDashboardsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/dashboard/search', + method: 'GET', + params: { + dashboardName: parameters?.dashboardName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + status: parameters?.status, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets | string, + callback: Callback, + ): Promise; + /** + * Returns a list of dashboard gadgets on a dashboard. + * + * This operation returns: + * + * - Gadgets from a list of IDs, when `id` is set. + * - Gadgets with a module key, when `moduleKey` is set. + * - Gadgets from a list of URIs, when `uri` is set. + * - All gadgets, when no other parameters are set. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllGadgets( + parameters: Parameters.GetAllGadgets | string, + callback?: never, + ): Promise; + async getAllGadgets( + parameters: Parameters.GetAllGadgets | string, + callback?: Callback, + ): Promise { + const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; + + // todo paramSerializer needed? + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${dashboardId}/gadget`, + method: 'GET', + params: { + moduleKey: typeof parameters !== 'string' && parameters.moduleKey, + uri: typeof parameters !== 'string' && parameters.uri, + gadgetId: typeof parameters !== 'string' && parameters.gadgetId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; + /** + * Adds a gadget to a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; + async addGadget( + parameters: Parameters.AddGadget, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget`, + method: 'POST', + data: { + color: parameters.color, + ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, + moduleKey: parameters.moduleKey, + position: parameters.position, + title: parameters.title, + uri: parameters.uri, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; + /** + * Changes the title, position, and color of the gadget on a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; + async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'PUT', + data: { + color: parameters.color, + position: parameters.position, + title: parameters.title, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; + /** + * Removes a dashboard gadget from a dashboard. + * + * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied + * position. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; + async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a dashboard item. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: never, + ): Promise; + async getDashboardItemPropertyKeys( + parameters: Parameters.GetDashboardItemPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of a dashboard item property. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when + * Jira’s anonymous access is permitted. + */ + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: never, + ): Promise; + async getDashboardItemProperty( + parameters: Parameters.GetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard + * item. + * + * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed + * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding + * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). + * + * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires + * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this + * resource to store the item's content or configuration details. For more information on working with dashboard + * items, see [ Building a dashboard item for a JIRA Connect + * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) + * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) + * documentation. + * + * There is no resource to set or get dashboard items. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: never, + ): Promise; + async setDashboardItemProperty( + parameters: Parameters.SetDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'PUT', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard item property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + */ + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: never, + ): Promise; + async deleteDashboardItemProperty( + parameters: Parameters.DeleteDashboardItemProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback: Callback, + ): Promise; + /** + * Returns a dashboard. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + * + * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the + * System dashboard. The System dashboard is considered to be shared with all other users. + */ + async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; + async getDashboard( + parameters: Parameters.GetDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback: Callback, + ): Promise; + /** + * Updates a dashboard, replacing all the dashboard details with those provided. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be updated must be owned by the user. + */ + async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; + async updateDashboard( + parameters: Parameters.UpdateDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback: Callback, + ): Promise; + /** + * Deletes a dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be deleted must be owned by the user. + */ + async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; + async deleteDashboard( + parameters: Parameters.DeleteDashboard | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; + /** + * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None + * + * The dashboard to be copied must be owned by or shared with the user. + */ + async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; + async copyDashboard( + parameters: Parameters.CopyDashboard, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/dashboard/${parameters.id}/copy`, + method: 'POST', + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + name: parameters.name, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/dashboards.ts b/src/version3/dashboards.ts deleted file mode 100644 index cbec827763..0000000000 --- a/src/version3/dashboards.ts +++ /dev/null @@ -1,728 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Dashboards { - constructor(private client: Client) {} - - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters: Parameters.GetAllDashboards | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or - * owned dashboards. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: never, - ): Promise; - async getAllDashboards( - parameters?: Parameters.GetAllDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard', - method: 'GET', - params: { - filter: parameters?.filter, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async createDashboard( - parameters: Parameters.CreateDashboard, - callback: Callback, - ): Promise; - /** - * Creates a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async createDashboard(parameters: Parameters.CreateDashboard, callback?: never): Promise; - async createDashboard( - parameters: Parameters.CreateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard', - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback: Callback, - ): Promise; - /** - * Bulk edit dashboards. Maximum number of dashboards to be edited at the same time is 100. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboards to be updated must be owned by the user, or the user must be an administrator. - */ - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: never, - ): Promise; - async bulkEditDashboards( - parameters: Parameters.BulkEditDashboards, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard/bulk/edit', - method: 'PUT', - data: { - action: parameters.action, - changeOwnerDetails: parameters.changeOwnerDetails, - entityIds: parameters.entityIds, - extendAdminPermissions: parameters.extendAdminPermissions, - permissionDetails: parameters.permissionDetails, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets( - callback: Callback, - ): Promise; - /** - * Gets a list of all available gadgets that can be added to all dashboards. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllAvailableDashboardGadgets(callback?: never): Promise; - async getAllAvailableDashboardGadgets( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard/gadgets', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters: Parameters.GetDashboardsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results - * can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. - * When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * following dashboards that match the query parameters are returned: - * - * - Dashboards owned by the user. Not returned for anonymous users. - * - Dashboards shared with a group that the user is a member of. Not returned for anonymous users. - * - Dashboards shared with a private project that the user can browse. Not returned for anonymous users. - * - Dashboards shared with a public project. - * - Dashboards shared with the public. - */ - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: never, - ): Promise; - async getDashboardsPaginated( - parameters?: Parameters.GetDashboardsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/dashboard/search', - method: 'GET', - params: { - dashboardName: parameters?.dashboardName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - status: parameters?.status, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback: Callback, - ): Promise; - /** - * Returns a list of dashboard gadgets on a dashboard. - * - * This operation returns: - * - * - Gadgets from a list of IDs, when `id` is set. - * - Gadgets with a module key, when `moduleKey` is set. - * - Gadgets from a list of URIs, when `uri` is set. - * - All gadgets, when no other parameters are set. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback?: never, - ): Promise; - async getAllGadgets( - parameters: Parameters.GetAllGadgets | string, - callback?: Callback, - ): Promise { - const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; - - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${dashboardId}/gadget`, - method: 'GET', - params: { - moduleKey: typeof parameters !== 'string' && parameters.moduleKey, - uri: typeof parameters !== 'string' && parameters.uri, - gadgetId: typeof parameters !== 'string' && parameters.gadgetId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback: Callback): Promise; - /** - * Adds a gadget to a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async addGadget(parameters: Parameters.AddGadget, callback?: never): Promise; - async addGadget( - parameters: Parameters.AddGadget, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget`, - method: 'POST', - data: { - color: parameters.color, - ignoreUriAndModuleKeyValidation: parameters.ignoreUriAndModuleKeyValidation, - moduleKey: parameters.moduleKey, - position: parameters.position, - title: parameters.title, - uri: parameters.uri, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback: Callback): Promise; - /** - * Changes the title, position, and color of the gadget on a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async updateGadget(parameters: Parameters.UpdateGadget, callback?: never): Promise; - async updateGadget(parameters: Parameters.UpdateGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'PUT', - data: { - color: parameters.color, - position: parameters.position, - title: parameters.title, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback: Callback): Promise; - /** - * Removes a dashboard gadget from a dashboard. - * - * When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied - * position. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async removeGadget(parameters: Parameters.RemoveGadget, callback?: never): Promise; - async removeGadget(parameters: Parameters.RemoveGadget, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/gadget/${parameters.gadgetId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a dashboard item. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: never, - ): Promise; - async getDashboardItemPropertyKeys( - parameters: Parameters.GetDashboardItemPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of a dashboard item property. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - * The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when - * Jira’s anonymous access is permitted. - */ - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: never, - ): Promise; - async getDashboardItemProperty( - parameters: Parameters.GetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard - * item. - * - * A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed - * to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding - * and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). - * - * When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires - * whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this - * resource to store the item's content or configuration details. For more information on working with dashboard - * items, see [ Building a dashboard item for a JIRA Connect - * add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) - * and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) - * documentation. - * - * There is no resource to set or get dashboard items. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: never, - ): Promise; - async setDashboardItemProperty( - parameters: Parameters.SetDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'PUT', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard item property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * user must be the owner of the dashboard. Note, users with the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. - */ - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: never, - ): Promise; - async deleteDashboardItemProperty( - parameters: Parameters.DeleteDashboardItemProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.dashboardId}/items/${parameters.itemId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback: Callback, - ): Promise; - /** - * Returns a dashboard. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - * - * However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the - * System dashboard. The System dashboard is considered to be shared with all other users. - */ - async getDashboard(parameters: Parameters.GetDashboard | string, callback?: never): Promise; - async getDashboard( - parameters: Parameters.GetDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback: Callback, - ): Promise; - /** - * Updates a dashboard, replacing all the dashboard details with those provided. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be updated must be owned by the user. - */ - async updateDashboard(parameters: Parameters.UpdateDashboard, callback?: never): Promise; - async updateDashboard( - parameters: Parameters.UpdateDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback: Callback, - ): Promise; - /** - * Deletes a dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be deleted must be owned by the user. - */ - async deleteDashboard(parameters: Parameters.DeleteDashboard | string, callback?: never): Promise; - async deleteDashboard( - parameters: Parameters.DeleteDashboard | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback: Callback): Promise; - /** - * Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None - * - * The dashboard to be copied must be owned by or shared with the user. - */ - async copyDashboard(parameters: Parameters.CopyDashboard, callback?: never): Promise; - async copyDashboard( - parameters: Parameters.CopyDashboard, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/dashboard/${parameters.id}/copy`, - method: 'POST', - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - name: parameters.name, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/dynamicModules.mts b/src/version3/dynamicModules.mts new file mode 100644 index 0000000000..c83f55ebc1 --- /dev/null +++ b/src/version3/dynamicModules.mts @@ -0,0 +1,90 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class DynamicModules { + constructor(private client: Client) {} + + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback: Callback): Promise; + /** + * Returns all modules registered dynamically by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async getModules(callback?: never): Promise; + async getModules(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules( + parameters: Parameters.RegisterModules | undefined, + callback: Callback, + ): Promise; + /** + * Registers a list of modules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; + async registerModules( + parameters?: Parameters.RegisterModules, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'POST', + data: { + modules: parameters?.modules, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; + /** + * Remove all or a list of modules registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request. + */ + async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; + async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/app/module/dynamic', + method: 'DELETE', + params: { + moduleKey: parameters?.moduleKey, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/dynamicModules.ts b/src/version3/dynamicModules.ts deleted file mode 100644 index 205b9af6c2..0000000000 --- a/src/version3/dynamicModules.ts +++ /dev/null @@ -1,90 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class DynamicModules { - constructor(private client: Client) {} - - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback: Callback): Promise; - /** - * Returns all modules registered dynamically by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async getModules(callback?: never): Promise; - async getModules(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules( - parameters: Parameters.RegisterModules | undefined, - callback: Callback, - ): Promise; - /** - * Registers a list of modules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async registerModules(parameters?: Parameters.RegisterModules, callback?: never): Promise; - async registerModules( - parameters?: Parameters.RegisterModules, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'POST', - data: { - modules: parameters?.modules, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters: Parameters.RemoveModules | undefined, callback: Callback): Promise; - /** - * Remove all or a list of modules registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. - */ - async removeModules(parameters?: Parameters.RemoveModules, callback?: never): Promise; - async removeModules(parameters?: Parameters.RemoveModules, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/atlassian-connect/1/app/module/dynamic', - method: 'DELETE', - params: { - moduleKey: parameters?.moduleKey, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/filterSharing.mts b/src/version3/filterSharing.mts new file mode 100644 index 0000000000..2e005d1866 --- /dev/null +++ b/src/version3/filterSharing.mts @@ -0,0 +1,255 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class FilterSharing { + constructor(private client: Client) {} + + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback: Callback): Promise; + /** + * Returns the default sharing settings for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getDefaultShareScope(callback?: never): Promise; + async getDefaultShareScope(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/defaultShareScope', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback: Callback, + ): Promise; + /** + * Sets the default sharing for new filters and dashboards for a user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: never, + ): Promise; + async setDefaultShareScope( + parameters: Parameters.SetDefaultShareScope | string, + callback?: Callback, + ): Promise { + const scope = typeof parameters === 'string' ? parameters : parameters.scope; + + const config: RequestConfig = { + url: '/rest/api/3/filter/defaultShareScope', + method: 'PUT', + data: { + scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback: Callback, + ): Promise; + /** + * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or + * the public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, share permissions are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: never, + ): Promise; + async getSharePermissions( + parameters: Parameters.GetSharePermissions | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/permission`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-3-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback: Callback, + ): Promise; + /** + * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the + * public) it will overwrite all share permissions for the filter. + * + * Be aware that this operation uses different objects for updating share permissions compared to [Update + * filter](#api-rest-api-3-filter-id-put). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share + * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the + * filter. + */ + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: never, + ): Promise; + async addSharePermission( + parameters: Parameters.AddSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/permission`, + method: 'POST', + data: { + type: parameters.type, + projectId: parameters.projectId, + groupname: parameters.groupname, + projectRoleId: parameters.projectRoleId, + accountId: parameters.accountId, + rights: parameters.rights, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback: Callback, + ): Promise; + /** + * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the + * public. Sharing with all logged-in users or the public is known as a global share permission. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, a share permission is only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: never, + ): Promise; + async getSharePermission( + parameters: Parameters.GetSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback: Callback, + ): Promise; + /** + * Deletes a share permission from a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira and the user must own the filter. + */ + async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; + async deleteSharePermission( + parameters: Parameters.DeleteSharePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/filterSharing.ts b/src/version3/filterSharing.ts deleted file mode 100644 index be262344a7..0000000000 --- a/src/version3/filterSharing.ts +++ /dev/null @@ -1,255 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class FilterSharing { - constructor(private client: Client) {} - - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback: Callback): Promise; - /** - * Returns the default sharing settings for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getDefaultShareScope(callback?: never): Promise; - async getDefaultShareScope(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/defaultShareScope', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback: Callback, - ): Promise; - /** - * Sets the default sharing for new filters and dashboards for a user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: never, - ): Promise; - async setDefaultShareScope( - parameters: Parameters.SetDefaultShareScope | string, - callback?: Callback, - ): Promise { - const scope = typeof parameters === 'string' ? parameters : parameters.scope; - - const config: RequestConfig = { - url: '/rest/api/3/filter/defaultShareScope', - method: 'PUT', - data: { - scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback: Callback, - ): Promise; - /** - * Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or - * the public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, share permissions are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: never, - ): Promise; - async getSharePermissions( - parameters: Parameters.GetSharePermissions | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/permission`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-3-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback: Callback, - ): Promise; - /** - * Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the - * public) it will overwrite all share permissions for the filter. - * - * Be aware that this operation uses different objects for updating share permissions compared to [Update - * filter](#api-rest-api-3-filter-id-put). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Share - * dashboards and filters_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the - * filter. - */ - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: never, - ): Promise; - async addSharePermission( - parameters: Parameters.AddSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/permission`, - method: 'POST', - data: { - type: parameters.type, - projectId: parameters.projectId, - groupname: parameters.groupname, - projectRoleId: parameters.projectRoleId, - accountId: parameters.accountId, - rights: parameters.rights, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback: Callback, - ): Promise; - /** - * Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the - * public. Sharing with all logged-in users or the public is known as a global share permission. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, a share permission is only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: never, - ): Promise; - async getSharePermission( - parameters: Parameters.GetSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback: Callback, - ): Promise; - /** - * Deletes a share permission from a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira and the user must own the filter. - */ - async deleteSharePermission(parameters: Parameters.DeleteSharePermission, callback?: never): Promise; - async deleteSharePermission( - parameters: Parameters.DeleteSharePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/filters.mts b/src/version3/filters.mts new file mode 100644 index 0000000000..cdf2bc7866 --- /dev/null +++ b/src/version3/filters.mts @@ -0,0 +1,629 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Filters { + constructor(private client: Client) {} + + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; + /** + * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The + * filter is not selected as a favorite. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; + async createFilter( + parameters: Parameters.CreateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter', + method: 'POST', + params: { + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + data: { + description: parameters.description, + editPermissions: parameters.editPermissions, + favourite: parameters.favourite, + favouritedCount: parameters.favouritedCount, + id: parameters.id, + jql: parameters.jql, + name: parameters.name, + owner: parameters.owner, + searchUrl: parameters.searchUrl, + self: parameters.self, + sharePermissions: parameters.sharePermissions, + sharedUsers: parameters.sharedUsers, + subscriptions: parameters.subscriptions, + viewUrl: parameters.viewUrl, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters: Parameters.GetFavouriteFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the visible favorite filters of the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A + * favorite filter is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: never, + ): Promise; + async getFavouriteFilters( + parameters?: Parameters.GetFavouriteFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/favourite', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters( + parameters: Parameters.GetMyFilters | undefined, + callback: Callback, + ): Promise; + /** + * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are + * also returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + * + * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by + * this operation. + */ + async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; + async getMyFilters( + parameters?: Parameters.GetMyFilters, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/my', + method: 'GET', + params: { + expand: parameters?.expand, + includeFavourites: parameters?.includeFavourites, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters: Parameters.GetFiltersPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * filters. Use this operation to get: + * + * - Specific filters, by defining `id` only. + * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in + * their name. When multiple attributes are specified only filters matching all attributes are returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, only the following filters that match the query parameters are returned: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: never, + ): Promise; + async getFiltersPaginated( + parameters?: Parameters.GetFiltersPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/filter/search', + method: 'GET', + params: { + filterName: parameters?.filterName, + accountId: parameters?.accountId, + groupname: parameters?.groupname, + groupId: parameters?.groupId, + projectId: parameters?.projectId, + id: parameters?.id, + orderBy: parameters?.orderBy, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + overrideSharePermissions: parameters?.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; + /** + * Returns a filter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, the filter is only returned where it is: + * + * - Owned by the user. + * - Shared with a group that the user is a member of. + * - Shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Shared with a public project. + * - Shared with the public. + */ + async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; + async getFilter( + parameters: Parameters.GetFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; + /** + * Updates a filter. Use this operation to update a filter's name, description, Jql, or sharing. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however the user must own the filter. + */ + async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; + async updateFilter( + parameters: Parameters.UpdateFilter, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}`, + method: 'PUT', + params: { + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, + }, + data: { + name: parameters.name, + description: parameters.description, + jql: parameters.jql, + favourite: parameters.favourite, + sharePermissions: parameters.sharePermissions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; + /** + * Delete a filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; + async deleteFilter( + parameters: Parameters.DeleteFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns( + parameters: Parameters.GetColumns | string, + callback: Callback, + ): Promise; + /** + * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed + * in _List View_ with the _Columns_ set to _Filter_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, column details are only returned for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; + async getColumns( + parameters: Parameters.GetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/columns`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * 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/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; + /** + * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get + * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to + * `true`. + * + * 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/filter/10000/columns` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only set for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; + async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/columns`, + method: 'PUT', + data: parameters.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; + /** + * Reset the user's column configuration for the filter to the default. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, columns are only reset for: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + 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/3/filter/${id}/columns`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Add a filter as a favorite for the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user can only favorite: + * + * - Filters owned by the user. + * - Filters shared with a group that the user is a member of. + * - Filters shared with a private project that the user has _Browse projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for. + * - Filters shared with a public project. + * - Filters shared with the public. + */ + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: never, + ): Promise; + async setFavouriteForFilter( + parameters: Parameters.SetFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/favourite`, + method: 'PUT', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback: Callback, + ): Promise; + /** + * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from + * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private + * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: never, + ): Promise; + async deleteFavouriteForFilter( + parameters: Parameters.DeleteFavouriteForFilter | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/filter/${id}/favourite`, + method: 'DELETE', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; + /** + * Changes the owner of the filter. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; + async changeFilterOwner( + parameters: Parameters.ChangeFilterOwner, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/filter/${parameters.id}/owner`, + method: 'PUT', + data: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/filters.ts b/src/version3/filters.ts deleted file mode 100644 index af84c7be04..0000000000 --- a/src/version3/filters.ts +++ /dev/null @@ -1,629 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Filters { - constructor(private client: Client) {} - - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback: Callback): Promise; - /** - * Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The - * filter is not selected as a favorite. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async createFilter(parameters: Parameters.CreateFilter, callback?: never): Promise; - async createFilter( - parameters: Parameters.CreateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter', - method: 'POST', - params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - data: { - description: parameters.description, - editPermissions: parameters.editPermissions, - favourite: parameters.favourite, - favouritedCount: parameters.favouritedCount, - id: parameters.id, - jql: parameters.jql, - name: parameters.name, - owner: parameters.owner, - searchUrl: parameters.searchUrl, - self: parameters.self, - sharePermissions: parameters.sharePermissions, - sharedUsers: parameters.sharedUsers, - subscriptions: parameters.subscriptions, - viewUrl: parameters.viewUrl, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters: Parameters.GetFavouriteFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the visible favorite filters of the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** A - * favorite filter is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: never, - ): Promise; - async getFavouriteFilters( - parameters?: Parameters.GetFavouriteFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/favourite', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters( - parameters: Parameters.GetMyFilters | undefined, - callback: Callback, - ): Promise; - /** - * Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are - * also returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - * - * For example, if the user favorites a public filter that is subsequently made private that filter is not returned by - * this operation. - */ - async getMyFilters(parameters?: Parameters.GetMyFilters, callback?: never): Promise; - async getMyFilters( - parameters?: Parameters.GetMyFilters, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/my', - method: 'GET', - params: { - expand: parameters?.expand, - includeFavourites: parameters?.includeFavourites, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters: Parameters.GetFiltersPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * filters. Use this operation to get: - * - * - Specific filters, by defining `id` only. - * - Filters that match all of the specified attributes. For example, all filters for a user with a particular word in - * their name. When multiple attributes are specified only filters matching all attributes are returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, only the following filters that match the query parameters are returned: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: never, - ): Promise; - async getFiltersPaginated( - parameters?: Parameters.GetFiltersPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/filter/search', - method: 'GET', - params: { - filterName: parameters?.filterName, - accountId: parameters?.accountId, - groupname: parameters?.groupname, - groupId: parameters?.groupId, - projectId: parameters?.projectId, - id: parameters?.id, - orderBy: parameters?.orderBy, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback: Callback): Promise; - /** - * Returns a filter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, the filter is only returned where it is: - * - * - Owned by the user. - * - Shared with a group that the user is a member of. - * - Shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Shared with a public project. - * - Shared with the public. - */ - async getFilter(parameters: Parameters.GetFilter | string, callback?: never): Promise; - async getFilter( - parameters: Parameters.GetFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - overrideSharePermissions: typeof parameters !== 'string' && parameters.overrideSharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback: Callback): Promise; - /** - * Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however the user must own the filter. - */ - async updateFilter(parameters: Parameters.UpdateFilter, callback?: never): Promise; - async updateFilter( - parameters: Parameters.UpdateFilter, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}`, - method: 'PUT', - params: { - expand: parameters.expand, - overrideSharePermissions: parameters.overrideSharePermissions, - }, - data: { - name: parameters.name, - description: parameters.description, - jql: parameters.jql, - favourite: parameters.favourite, - sharePermissions: parameters.sharePermissions, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback: Callback): Promise; - /** - * Delete a filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFilter(parameters: Parameters.DeleteFilter | string, callback?: never): Promise; - async deleteFilter( - parameters: Parameters.DeleteFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns( - parameters: Parameters.GetColumns | string, - callback: Callback, - ): Promise; - /** - * Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed - * in _List View_ with the _Columns_ set to _Filter_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, column details are only returned for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async getColumns(parameters: Parameters.GetColumns | string, callback?: never): Promise; - async getColumns( - parameters: Parameters.GetColumns | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/columns`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * 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/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback: Callback): Promise; - /** - * Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get - * fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to - * `true`. - * - * 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/filter/10000/columns` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only set for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setColumns(parameters: Parameters.SetColumns, callback?: never): Promise; - async setColumns(parameters: Parameters.SetColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/columns`, - method: 'PUT', - data: parameters.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; - /** - * Reset the user's column configuration for the filter to the default. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, columns are only reset for: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - 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/3/filter/${id}/columns`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Add a filter as a favorite for the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user can only favorite: - * - * - Filters owned by the user. - * - Filters shared with a group that the user is a member of. - * - Filters shared with a private project that the user has _Browse projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for. - * - Filters shared with a public project. - * - Filters shared with the public. - */ - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: never, - ): Promise; - async setFavouriteForFilter( - parameters: Parameters.SetFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/favourite`, - method: 'PUT', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback: Callback, - ): Promise; - /** - * Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from - * the user's favorites list. For example, if the user favorites a public filter that is subsequently made private - * (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: never, - ): Promise; - async deleteFavouriteForFilter( - parameters: Parameters.DeleteFavouriteForFilter | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/filter/${id}/favourite`, - method: 'DELETE', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback: Callback): Promise; - /** - * Changes the owner of the filter. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. However, the user must own the filter or have the _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async changeFilterOwner(parameters: Parameters.ChangeFilterOwner, callback?: never): Promise; - async changeFilterOwner( - parameters: Parameters.ChangeFilterOwner, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/filter/${parameters.id}/owner`, - method: 'PUT', - data: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/groupAndUserPicker.mts b/src/version3/groupAndUserPicker.mts new file mode 100644 index 0000000000..53718648ae --- /dev/null +++ b/src/version3/groupAndUserPicker.mts @@ -0,0 +1,110 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class GroupAndUserPicker { + constructor(private client: Client) {} + + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback: Callback, + ): Promise; + /** + * Returns a list of users and groups matching a string. The string is used: + * + * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden + * their email address in their user profile, partial matches of the email address will not find the user. An exact + * match is required. + * - For groups, to find a case-sensitive match with group name. + * + * For example, if the string _tin_ is used, records with the display name _Tina_, email address + * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. + * + * Optionally, the search can be refined to: + * + * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further + * refined to return only users and groups that have permission to view specific: + * + * - Projects. + * - Issue types. + * + * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or + * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be + * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. + * - Not return Connect app users and groups. + * - Return groups that have a case-insensitive match with the query. + * + * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this + * end, the returned object includes an `html` field for each list. This field highlights the matched query term in + * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for + * use in a picker, specifically _Showing X of Y matching groups_. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). + */ + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: never, + ): Promise; + async findUsersAndGroups( + parameters: Parameters.FindUsersAndGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/groupuserpicker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + fieldId: parameters.fieldId, + projectId: parameters.projectId, + issueTypeId: parameters.issueTypeId, + avatarSize: parameters.avatarSize, + caseInsensitive: parameters.caseInsensitive, + excludeConnectAddons: parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/groupAndUserPicker.ts b/src/version3/groupAndUserPicker.ts deleted file mode 100644 index c1f42bbc73..0000000000 --- a/src/version3/groupAndUserPicker.ts +++ /dev/null @@ -1,110 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class GroupAndUserPicker { - constructor(private client: Client) {} - - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback: Callback, - ): Promise; - /** - * Returns a list of users and groups matching a string. The string is used: - * - * - For users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden - * their email address in their user profile, partial matches of the email address will not find the user. An exact - * match is required. - * - For groups, to find a case-sensitive match with group name. - * - * For example, if the string _tin_ is used, records with the display name _Tina_, email address - * _sarah@tinplatetraining.com_, and the group _accounting_ would be returned. - * - * Optionally, the search can be refined to: - * - * - The projects and issue types associated with a custom field, such as a user picker. The search can then be further - * refined to return only users and groups that have permission to view specific: - * - * - Projects. - * - Issue types. - * - * If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or - * no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be - * limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. - * - Not return Connect app users and groups. - * - Return groups that have a case-insensitive match with the query. - * - * The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this - * end, the returned object includes an `html` field for each list. This field highlights the matched query term in - * the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for - * use in a picker, specifically _Showing X of Y matching groups_. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/yodKLg). - */ - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: never, - ): Promise; - async findUsersAndGroups( - parameters: Parameters.FindUsersAndGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/groupuserpicker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - fieldId: parameters.fieldId, - projectId: parameters.projectId, - issueTypeId: parameters.issueTypeId, - avatarSize: parameters.avatarSize, - caseInsensitive: parameters.caseInsensitive, - excludeConnectAddons: parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/groups.mts b/src/version3/groups.mts new file mode 100644 index 0000000000..56bd2f117d --- /dev/null +++ b/src/version3/groups.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Groups { + constructor(private client: Client) {} + + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; + /** + * Creates a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; + async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; + /** + * Deletes a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; + async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group', + method: 'DELETE', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + swapGroup: parameters.swapGroup, + swapGroupId: parameters.swapGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * groups. + * + * **[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 bulkGetGroups( + parameters: Parameters.BulkGetGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * groups. + * + * **[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 bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; + async bulkGetGroups( + parameters?: Parameters.BulkGetGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/bulk', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + groupId: parameters?.groupId, + groupName: parameters?.groupName, + accessType: parameters?.accessType, + applicationKey: parameters?.applicationKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * users in a group. + * + * 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). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * users in a group. + * + * 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). + */ + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: never, + ): Promise; + async getUsersFromGroup( + parameters: Parameters.GetUsersFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/member', + method: 'GET', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + includeInactiveUsers: parameters.includeInactiveUsers, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; + /** + * Adds a user to a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; + async addUserToGroup( + parameters: Parameters.AddUserToGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/user', + method: 'POST', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + }, + data: { + accountId: parameters.accountId, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback: Callback, + ): Promise; + /** + * Removes a user from a group. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; + async removeUserFromGroup( + parameters: Parameters.RemoveUserFromGroup, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/group/user', + method: 'DELETE', + params: { + groupname: parameters.groupname, + groupId: parameters.groupId, + username: parameters.username, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * 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). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups( + parameters: Parameters.FindGroups | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude + * groups from the results. + * + * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned + * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong + * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, + * specifically _Showing X of Y matching groups_. + * + * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. + * + * 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). Anonymous calls and calls by users + * without the required permission return an empty list. + * + * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, + * calls where query is not an exact match to an existing group will return an empty list. + */ + async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; + async findGroups( + parameters?: Parameters.FindGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/groups/picker', + method: 'GET', + params: { + query: parameters?.query, + exclude: parameters?.exclude, + excludeId: parameters?.excludeId, + maxResults: parameters?.maxResults, + caseInsensitive: parameters?.caseInsensitive, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/groups.ts b/src/version3/groups.ts deleted file mode 100644 index 1b30b6cd9e..0000000000 --- a/src/version3/groups.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Groups { - constructor(private client: Client) {} - - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback: Callback): Promise; - /** - * Creates a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async createGroup(parameters: Parameters.CreateGroup, callback?: never): Promise; - async createGroup(parameters: Parameters.CreateGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback: Callback): Promise; - /** - * Deletes a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ strategic [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeGroup(parameters: Parameters.RemoveGroup, callback?: never): Promise; - async removeGroup(parameters: Parameters.RemoveGroup, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group', - method: 'DELETE', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - swapGroup: parameters.swapGroup, - swapGroupId: parameters.swapGroupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * groups. - * - * **[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 bulkGetGroups( - parameters: Parameters.BulkGetGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * groups. - * - * **[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 bulkGetGroups(parameters?: Parameters.BulkGetGroups, callback?: never): Promise; - async bulkGetGroups( - parameters?: Parameters.BulkGetGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/bulk', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - groupId: parameters?.groupId, - groupName: parameters?.groupName, - accessType: parameters?.accessType, - applicationKey: parameters?.applicationKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * users in a group. - * - * 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). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * users in a group. - * - * 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). - */ - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: never, - ): Promise; - async getUsersFromGroup( - parameters: Parameters.GetUsersFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/member', - method: 'GET', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - includeInactiveUsers: parameters.includeInactiveUsers, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback: Callback): Promise; - /** - * Adds a user to a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async addUserToGroup(parameters: Parameters.AddUserToGroup, callback?: never): Promise; - async addUserToGroup( - parameters: Parameters.AddUserToGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/user', - method: 'POST', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - }, - data: { - accountId: parameters.accountId, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback: Callback, - ): Promise; - /** - * Removes a user from a group. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, member of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUserFromGroup(parameters: Parameters.RemoveUserFromGroup, callback?: never): Promise; - async removeUserFromGroup( - parameters: Parameters.RemoveUserFromGroup, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/group/user', - method: 'DELETE', - params: { - groupname: parameters.groupname, - groupId: parameters.groupId, - username: parameters.username, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * 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). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups( - parameters: Parameters.FindGroups | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude - * groups from the results. - * - * The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned - * object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong - * tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, - * specifically _Showing X of Y matching groups_. - * - * The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. - * - * 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). Anonymous calls and calls by users - * without the required permission return an empty list. - * - * _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, - * calls where query is not an exact match to an existing group will return an empty list. - */ - async findGroups(parameters?: Parameters.FindGroups, callback?: never): Promise; - async findGroups( - parameters?: Parameters.FindGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/groups/picker', - method: 'GET', - params: { - query: parameters?.query, - exclude: parameters?.exclude, - excludeId: parameters?.excludeId, - maxResults: parameters?.maxResults, - caseInsensitive: parameters?.caseInsensitive, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/index.mts b/src/version3/index.mts new file mode 100644 index 0000000000..058fd4d5b8 --- /dev/null +++ b/src/version3/index.mts @@ -0,0 +1,90 @@ +export * from './announcementBanner.mjs'; +export * from './applicationRoles.mjs'; +export * from './appMigration.mjs'; +export * from './appProperties.mjs'; +export * from './auditRecords.mjs'; +export * from './avatars.mjs'; +export * from './dashboards.mjs'; +export * from './dynamicModules.mjs'; +export * from './filters.mjs'; +export * from './filterSharing.mjs'; +export * from './groupAndUserPicker.mjs'; +export * from './groups.mjs'; +export * from './instanceInformation.mjs'; +export * from './issueAttachments.mjs'; +export * from './issueCommentProperties.mjs'; +export * from './issueComments.mjs'; +export * from './issueCustomFieldConfigurationApps.mjs'; +export * from './issueCustomFieldContexts.mjs'; +export * from './issueCustomFieldOptions.mjs'; +export * from './issueCustomFieldOptionsApps.mjs'; +export * from './issueCustomFieldValuesApps.mjs'; +export * from './issueFieldConfigurations.mjs'; +export * from './issueFields.mjs'; +export * from './issueLinks.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueNavigatorSettings.mjs'; +export * from './issueNotificationSchemes.mjs'; +export * from './issuePriorities.mjs'; +export * from './issueProperties.mjs'; +export * from './issueRemoteLinks.mjs'; +export * from './issueResolutions.mjs'; +export * from './issues.mjs'; +export * from './issueSearch.mjs'; +export * from './issueSecurityLevel.mjs'; +export * from './issueSecuritySchemes.mjs'; +export * from './issueTypeProperties.mjs'; +export * from './issueTypes.mjs'; +export * from './issueTypeSchemes.mjs'; +export * from './issueTypeScreenSchemes.mjs'; +export * from './issueVotes.mjs'; +export * from './issueWatchers.mjs'; +export * from './issueWorklogProperties.mjs'; +export * from './issueWorklogs.mjs'; +export * from './jiraExpressions.mjs'; +export * from './jiraSettings.mjs'; +export * from './jql.mjs'; +export * from './jqlFunctionsApps.mjs'; +export * from './labels.mjs'; +export * from './licenseMetrics.mjs'; +export * from './myself.mjs'; +export * from './permissions.mjs'; +export * from './permissionSchemes.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategories.mjs'; +export * from './projectComponents.mjs'; +export * from './projectEmail.mjs'; +export * from './projectFeatures.mjs'; +export * from './projectKeyAndNameValidation.mjs'; +export * from './projectPermissionSchemes.mjs'; +export * from './projectProperties.mjs'; +export * from './projectRoleActors.mjs'; +export * from './projectRoles.mjs'; +export * from './projects.mjs'; +export * from './projectTypes.mjs'; +export * from './projectVersions.mjs'; +export * from './screens.mjs'; +export * from './screenSchemes.mjs'; +export * from './screenTabFields.mjs'; +export * from './screenTabs.mjs'; +export * from './serverInfo.mjs'; +export * from './status.mjs'; +export * from './tasks.mjs'; +export * from './timeTracking.mjs'; +export * from './uiModificationsApps.mjs'; +export * from './userProperties.mjs'; +export * from './users.mjs'; +export * from './userSearch.mjs'; +export * from './webhooks.mjs'; +export * from './workflows.mjs'; +export * from './workflowSchemeDrafts.mjs'; +export * from './workflowSchemeProjectAssociations.mjs'; +export * from './workflowSchemes.mjs'; +export * from './workflowStatusCategories.mjs'; +export * from './workflowStatuses.mjs'; +export * from './workflowTransitionProperties.mjs'; +export * from './workflowTransitionRules.mjs'; + +export * from './client/version3Client.mjs'; +export * as Version3Models from './models/index.mjs'; +export * as Version3Parameters from './parameters/index.mjs'; diff --git a/src/version3/index.ts b/src/version3/index.ts deleted file mode 100644 index 86cbc71d60..0000000000 --- a/src/version3/index.ts +++ /dev/null @@ -1,90 +0,0 @@ -export * from './announcementBanner'; -export * from './applicationRoles'; -export * from './appMigration'; -export * from './appProperties'; -export * from './auditRecords'; -export * from './avatars'; -export * from './dashboards'; -export * from './dynamicModules'; -export * from './filters'; -export * from './filterSharing'; -export * from './groupAndUserPicker'; -export * from './groups'; -export * from './instanceInformation'; -export * from './issueAttachments'; -export * from './issueCommentProperties'; -export * from './issueComments'; -export * from './issueCustomFieldConfigurationApps'; -export * from './issueCustomFieldContexts'; -export * from './issueCustomFieldOptions'; -export * from './issueCustomFieldOptionsApps'; -export * from './issueCustomFieldValuesApps'; -export * from './issueFieldConfigurations'; -export * from './issueFields'; -export * from './issueLinks'; -export * from './issueLinkTypes'; -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 './issueVotes'; -export * from './issueWatchers'; -export * from './issueWorklogProperties'; -export * from './issueWorklogs'; -export * from './jiraExpressions'; -export * from './jiraSettings'; -export * from './jQL'; -export * from './jqlFunctionsApps'; -export * from './labels'; -export * from './licenseMetrics'; -export * from './myself'; -export * from './permissions'; -export * from './permissionSchemes'; -export * from './projectAvatars'; -export * from './projectCategories'; -export * from './projectComponents'; -export * from './projectEmail'; -export * from './projectFeatures'; -export * from './projectKeyAndNameValidation'; -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 './screenSchemes'; -export * from './screenTabFields'; -export * from './screenTabs'; -export * from './serverInfo'; -export * from './status'; -export * from './tasks'; -export * from './timeTracking'; -export * from './uIModificationsApps'; -export * from './userProperties'; -export * from './users'; -export * from './userSearch'; -export * from './webhooks'; -export * from './workflows'; -export * from './workflowSchemeDrafts'; -export * from './workflowSchemeProjectAssociations'; -export * from './workflowSchemes'; -export * from './workflowStatusCategories'; -export * from './workflowStatuses'; -export * from './workflowTransitionProperties'; -export * from './workflowTransitionRules'; - -export * from './client'; -export * as Version3Models from './models'; -export * as Version3Parameters from './parameters'; diff --git a/src/version3/instanceInformation.mts b/src/version3/instanceInformation.mts new file mode 100644 index 0000000000..0f8906c59c --- /dev/null +++ b/src/version3/instanceInformation.mts @@ -0,0 +1,29 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class InstanceInformation { + constructor(private client: Client) {} + + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + 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. + */ + async getLicense(callback?: never): Promise; + async getLicense(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/instance/license', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/instanceInformation.ts b/src/version3/instanceInformation.ts deleted file mode 100644 index 6bc2d59b04..0000000000 --- a/src/version3/instanceInformation.ts +++ /dev/null @@ -1,29 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class InstanceInformation { - constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - 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. - */ - async getLicense(callback?: never): Promise; - async getLicense(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/instance/license', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueAttachments.mts b/src/version3/issueAttachments.mts new file mode 100644 index 0000000000..78044f1842 --- /dev/null +++ b/src/version3/issueAttachments.mts @@ -0,0 +1,444 @@ +import { FormData } from 'formdata-node'; +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueAttachments { + constructor(private client: Client) {} + + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback: Callback, + ): Promise; + /** + * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment + * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) + * for details. + * + * To return a thumbnail of the attachment, use [Get attachment + * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: never, + ): Promise; + async getAttachmentContent( + parameters: Parameters.GetAttachmentContent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/content/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback: Callback): Promise; + /** + * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. + * + * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether + * users can create and delete attachments. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAttachmentMeta(callback?: never): Promise; + async getAttachmentMeta(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/attachment/meta', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback: Callback, + ): Promise; + /** + * Returns the thumbnail of an attachment. + * + * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: never, + ): Promise; + async getAttachmentThumbnail( + parameters: Parameters.GetAttachmentThumbnail | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/thumbnail/${id}`, + method: 'GET', + params: { + redirect: typeof parameters !== 'string' && parameters.redirect, + fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, + width: typeof parameters !== 'string' && parameters.width, + height: typeof parameters !== 'string' && parameters.height, + }, + responseType: 'arraybuffer', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * 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 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 getAttachment( + parameters: Parameters.GetAttachment | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for an attachment. Note that the attachment itself is not returned. + * + * 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 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 getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: never, + ): Promise; + async getAttachment( + parameters: Parameters.GetAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback: Callback, + ): Promise; + /** + * Deletes an attachment from an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * project holding the issue containing the attachment: + * + * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by the calling user. + * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment + * created by any user. + */ + async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; + async removeAttachment( + parameters: Parameters.RemoveAttachment | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment + * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is + * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. + * + * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the + * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded + * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's + * contents. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: never, + ): Promise; + async expandAttachmentForHumans( + parameters: Parameters.ExpandAttachmentForHumans | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}/expand/human`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback: Callback, + ): Promise; + /** + * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a + * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is + * supported. + * + * Use this operation if you are processing the data without presenting it to the user, as this operation only returns + * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all + * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the + * metadata for the attachment itself, such as the attachment's ID and name. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the + * issue containing the attachment: + * + * - _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 expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: never, + ): Promise; + async expandAttachmentForMachines( + parameters: Parameters.ExpandAttachmentForMachines | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/attachment/${id}/expand/raw`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment( + parameters: Parameters.AddAttachment, + callback: Callback, + ): Promise; + /** + * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC + * 1867](https://www.ietf.org/rfc/rfc1867.txt)). + * + * Note that: + * + * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special + * headers](#special-request-headers) for more information. + * - The name of the multipart/form-data parameter that contains the attachments must be `file`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; + async addAttachment( + parameters: Parameters.AddAttachment, + callback?: Callback, + ): Promise { + const formData = new FormData(); + const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; + + attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/attachments`, + method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': 'multipart/form-data', + }, + data: formData, + maxBodyLength: Infinity, + maxContentLength: Infinity, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueAttachments.ts b/src/version3/issueAttachments.ts deleted file mode 100644 index cbae4311fa..0000000000 --- a/src/version3/issueAttachments.ts +++ /dev/null @@ -1,446 +0,0 @@ -// @ts-expect-error Wrong form data typings -import FormData from 'form-data'; -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueAttachments { - constructor(private client: Client) {} - - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback: Callback, - ): Promise; - /** - * Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment - * to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) - * for details. - * - * To return a thumbnail of the attachment, use [Get attachment - * thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: never, - ): Promise; - async getAttachmentContent( - parameters: Parameters.GetAttachmentContent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/content/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback: Callback): Promise; - /** - * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. - * - * Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether - * users can create and delete attachments. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAttachmentMeta(callback?: never): Promise; - async getAttachmentMeta(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/attachment/meta', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback: Callback, - ): Promise; - /** - * Returns the thumbnail of an attachment. - * - * To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: never, - ): Promise; - async getAttachmentThumbnail( - parameters: Parameters.GetAttachmentThumbnail | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/thumbnail/${id}`, - method: 'GET', - params: { - redirect: typeof parameters !== 'string' && parameters.redirect, - fallbackToDefault: typeof parameters !== 'string' && parameters.fallbackToDefault, - width: typeof parameters !== 'string' && parameters.width, - height: typeof parameters !== 'string' && parameters.height, - }, - responseType: 'arraybuffer', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * 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 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 getAttachment( - parameters: Parameters.GetAttachment | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for an attachment. Note that the attachment itself is not returned. - * - * 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 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 getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: never, - ): Promise; - async getAttachment( - parameters: Parameters.GetAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback: Callback, - ): Promise; - /** - * Deletes an attachment from an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * project holding the issue containing the attachment: - * - * - _Delete own attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by the calling user. - * - _Delete all attachments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment - * created by any user. - */ - async removeAttachment(parameters: Parameters.RemoveAttachment | string, callback?: never): Promise; - async removeAttachment( - parameters: Parameters.RemoveAttachment | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment - * itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is - * returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. - * - * Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the - * attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded - * attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's - * contents. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: never, - ): Promise; - async expandAttachmentForHumans( - parameters: Parameters.ExpandAttachmentForHumans | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}/expand/human`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback: Callback, - ): Promise; - /** - * Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a - * ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is - * supported. - * - * Use this operation if you are processing the data without presenting it to the user, as this operation only returns - * the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all - * metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the - * metadata for the attachment itself, such as the attachment's ID and name. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** For the - * issue containing the attachment: - * - * - _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 expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: never, - ): Promise; - async expandAttachmentForMachines( - parameters: Parameters.ExpandAttachmentForMachines | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/attachment/${id}/expand/raw`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment( - parameters: Parameters.AddAttachment, - callback: Callback, - ): Promise; - /** - * Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC - * 1867](https://www.ietf.org/rfc/rfc1867.txt)). - * - * Note that: - * - * - The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special - * headers](#special-request-headers) for more information. - * - The name of the multipart/form-data parameter that contains the attachments must be `file`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Create attachments_ [ 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 addAttachment(parameters: Parameters.AddAttachment, callback?: never): Promise; - async addAttachment( - parameters: Parameters.AddAttachment, - callback?: Callback, - ): Promise { - const formData = new FormData(); - const attachments = Array.isArray(parameters.attachment) ? parameters.attachment : [parameters.attachment]; - - attachments.forEach(attachment => formData.append('file', attachment.file, attachment.filename)); - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/attachments`, - method: 'POST', - headers: { - 'X-Atlassian-Token': 'no-check', - 'Content-Type': 'multipart/form-data', - ...formData.getHeaders?.(), - }, - data: formData, - maxBodyLength: Infinity, - maxContentLength: Infinity, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCommentProperties.mts b/src/version3/issueCommentProperties.mts new file mode 100644 index 0000000000..8158aa37f1 --- /dev/null +++ b/src/version3/issueCommentProperties.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCommentProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all the properties of a comment. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns the keys of all the properties of a comment. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: never, + ): Promise; + async getCommentPropertyKeys( + parameters: Parameters.GetCommentPropertyKeys | string, + callback?: Callback, + ): Promise { + const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; + + const config: RequestConfig = { + url: `/rest/api/3/comment/${commentId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a comment property. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a comment property. + * + * 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. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: never, + ): Promise; + async getCommentProperty( + parameters: Parameters.GetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on any comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value + * of a property on a comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; + async setCommentProperty( + parameters: Parameters.SetCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.property, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback: Callback, + ): Promise; + /** + * Deletes a comment property. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any + * comment. + * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a + * comment created by the user. + * + * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or + * group. + */ + async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; + async deleteCommentProperty( + parameters: Parameters.DeleteCommentProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCommentProperties.ts b/src/version3/issueCommentProperties.ts deleted file mode 100644 index 2fdecdea69..0000000000 --- a/src/version3/issueCommentProperties.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCommentProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all the properties of a comment. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns the keys of all the properties of a comment. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: never, - ): Promise; - async getCommentPropertyKeys( - parameters: Parameters.GetCommentPropertyKeys | string, - callback?: Callback, - ): Promise { - const commentId = typeof parameters === 'string' ? parameters : parameters.commentId; - - const config: RequestConfig = { - url: `/rest/api/3/comment/${commentId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a comment property. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a comment property. - * - * 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. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: never, - ): Promise; - async getCommentProperty( - parameters: Parameters.GetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on any comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value - * of a property on a comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async setCommentProperty(parameters: Parameters.SetCommentProperty, callback?: never): Promise; - async setCommentProperty( - parameters: Parameters.SetCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.property, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback: Callback, - ): Promise; - /** - * Deletes a comment property. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Edit All Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any - * comment. - * - _Edit Own Comments_ [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a - * comment created by the user. - * - * Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or - * group. - */ - async deleteCommentProperty(parameters: Parameters.DeleteCommentProperty, callback?: never): Promise; - async deleteCommentProperty( - parameters: Parameters.DeleteCommentProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/comment/${parameters.commentId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueComments.mts b/src/version3/issueComments.mts new file mode 100644 index 0000000000..5f7c636364 --- /dev/null +++ b/src/version3/issueComments.mts @@ -0,0 +1,324 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueComments { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * comments specified by a list of comment IDs. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are returned where the user: + * + * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing + * the comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; + async getCommentsByIds( + parameters: Parameters.GetCommentsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/comment/list', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback: Callback, + ): Promise; + /** + * Returns all comments for an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Comments are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is + * restricted to. + */ + async getComments( + parameters: Parameters.GetComments | string, + callback?: never, + ): Promise; + async getComments( + parameters: Parameters.GetComments | string, + callback?: Callback, + ): Promise { + const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/issue/${issueIdOrKey}/comment`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + orderBy: typeof parameters !== 'string' && parameters.orderBy, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; + /** + * Adds a comment to an issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the + * project that the issue containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async addComment(parameters: Parameters.AddComment, callback?: never): Promise; + async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { + const body = typeof parameters.comment === 'string' + ? { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [{ type: 'text', text: parameters.comment }], + }, + ], + } + : parameters.comment; + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + self: parameters.self, + id: parameters.id, + author: parameters.author, + body, + renderedBody: parameters.renderedBody, + updateAuthor: parameters.updateAuthor, + created: parameters.created, + updated: parameters.updated, + visibility: parameters.visibility, + jsdPublic: parameters.jsdPublic, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a comment. + * + * 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 + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; + /** + * Returns a comment. + * + * 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 + * comment. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async getComment(parameters: Parameters.GetComment, callback?: never): Promise; + async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a comment. + * + * 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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; + /** + * Updates a comment. + * + * 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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit + * own comments_ to update comment created by the user. + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; + async updateComment( + parameters: Parameters.UpdateComment, + callback?: Callback, + ): Promise { + // todo same above + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideEditableFlag: parameters.overrideEditableFlag, + expand: parameters.expand, + }, + data: { + body: parameters.body, + visibility: parameters.visibility, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a comment. + * + * **[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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; + /** + * Deletes a comment. + * + * **[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 that the issue + * containing the comment is in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or + * _Delete own comments_ to delete comment created by the user, + * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted + * to. + */ + async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; + async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueComments.ts b/src/version3/issueComments.ts deleted file mode 100644 index 29d55a8cbf..0000000000 --- a/src/version3/issueComments.ts +++ /dev/null @@ -1,324 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueComments { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * comments specified by a list of comment IDs. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are returned where the user: - * - * - Has _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing - * the comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getCommentsByIds(parameters: Parameters.GetCommentsByIds, callback?: never): Promise; - async getCommentsByIds( - parameters: Parameters.GetCommentsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/comment/list', - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - ids: parameters.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback: Callback, - ): Promise; - /** - * Returns all comments for an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Comments are included in the response where the user has: - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is - * restricted to. - */ - async getComments( - parameters: Parameters.GetComments | string, - callback?: never, - ): Promise; - async getComments( - parameters: Parameters.GetComments | string, - callback?: Callback, - ): Promise { - const issueIdOrKey = typeof parameters === 'string' ? parameters : parameters.issueIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/issue/${issueIdOrKey}/comment`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback: Callback): Promise; - /** - * Adds a comment to an issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Add comments_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for the - * project that the issue containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async addComment(parameters: Parameters.AddComment, callback?: never): Promise; - async addComment(parameters: Parameters.AddComment, callback?: Callback): Promise { - const body = typeof parameters.comment === 'string' - ? { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [{ type: 'text', text: parameters.comment }], - }, - ], - } - : parameters.comment; - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - self: parameters.self, - id: parameters.id, - author: parameters.author, - body, - renderedBody: parameters.renderedBody, - updateAuthor: parameters.updateAuthor, - created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - jsdPublic: parameters.jsdPublic, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a comment. - * - * 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 - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback: Callback): Promise; - /** - * Returns a comment. - * - * 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 - * comment. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async getComment(parameters: Parameters.GetComment, callback?: never): Promise; - async getComment(parameters: Parameters.GetComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a comment. - * - * 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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback: Callback): Promise; - /** - * Updates a comment. - * - * 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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or _Edit - * own comments_ to update comment created by the user. - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async updateComment(parameters: Parameters.UpdateComment, callback?: never): Promise; - async updateComment( - parameters: Parameters.UpdateComment, - callback?: Callback, - ): Promise { - // todo same above - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideEditableFlag: parameters.overrideEditableFlag, - expand: parameters.expand, - }, - data: { - body: parameters.body, - visibility: parameters.visibility, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a comment. - * - * **[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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback: Callback): Promise; - /** - * Deletes a comment. - * - * **[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 that the issue - * containing the comment is in. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Delete all comments_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or - * _Delete own comments_ to delete comment created by the user, - * - If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted - * to. - */ - async deleteComment(parameters: Parameters.DeleteComment, callback?: never): Promise; - async deleteComment(parameters: Parameters.DeleteComment, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldConfigurationApps.mts b/src/version3/issueCustomFieldConfigurationApps.mts new file mode 100644 index 0000000000..202785387c --- /dev/null +++ b/src/version3/issueCustomFieldConfigurationApps.mts @@ -0,0 +1,113 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldConfigurationApps { + constructor(private client: Client) {} + + /** + * 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/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations 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 created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration | string, + callback: Callback, + ): 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/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations 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 created the custom field. + */ + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration | string, + callback?: never, + ): Promise; + async getCustomFieldConfiguration( + parameters: Parameters.GetCustomFieldConfiguration | string, + callback?: Callback, + ): Promise { + const fieldIdOrKey = typeof parameters === 'string' ? parameters : parameters.fieldIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/app/field/${fieldIdOrKey}/context/configuration`, + method: 'GET', + params: { + id: typeof parameters !== 'string' && parameters.id, + fieldContextId: typeof parameters !== 'string' && parameters.fieldContextId, + issueId: typeof parameters !== 'string' && parameters.issueId, + projectKeyOrId: typeof parameters !== 'string' && parameters.projectKeyOrId, + issueTypeId: typeof parameters !== 'string' && parameters.issueTypeId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the configuration for contexts of a custom field 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. + */ + 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/). + * + * **[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. + */ + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: never, + ): Promise; + async updateCustomFieldConfiguration( + parameters: Parameters.UpdateCustomFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/context/configuration`, + method: 'PUT', + data: { + configurations: parameters.configurations, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldConfigurationApps.ts b/src/version3/issueCustomFieldConfigurationApps.ts deleted file mode 100644 index 662e4fca60..0000000000 --- a/src/version3/issueCustomFieldConfigurationApps.ts +++ /dev/null @@ -1,113 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldConfigurationApps { - constructor(private client: Client) {} - - /** - * 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/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations 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 created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration | string, - callback: Callback, - ): 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/). - * - * The result can be filtered by one of these criteria: - * - * - `id`. - * - `fieldContextId`. - * - `issueId`. - * - `projectKeyOrId` and `issueTypeId`. - * - * Otherwise, all configurations 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 created the custom field. - */ - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration | string, - callback?: never, - ): Promise; - async getCustomFieldConfiguration( - parameters: Parameters.GetCustomFieldConfiguration | string, - callback?: Callback, - ): Promise { - const fieldIdOrKey = typeof parameters === 'string' ? parameters : parameters.fieldIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/app/field/${fieldIdOrKey}/context/configuration`, - method: 'GET', - params: { - id: typeof parameters !== 'string' && parameters.id, - fieldContextId: typeof parameters !== 'string' && parameters.fieldContextId, - issueId: typeof parameters !== 'string' && parameters.issueId, - projectKeyOrId: typeof parameters !== 'string' && parameters.projectKeyOrId, - issueTypeId: typeof parameters !== 'string' && parameters.issueTypeId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the configuration for contexts of a custom field 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. - */ - 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/). - * - * **[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. - */ - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: never, - ): Promise; - async updateCustomFieldConfiguration( - parameters: Parameters.UpdateCustomFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/context/configuration`, - method: 'PUT', - data: { - configurations: parameters.configurations, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldContexts.mts b/src/version3/issueCustomFieldContexts.mts new file mode 100644 index 0000000000..a99a55a3e8 --- /dev/null +++ b/src/version3/issueCustomFieldContexts.mts @@ -0,0 +1,724 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldContexts { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ + * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a + * custom field. Contexts can be returned as follows: + * + * - With no other parameters set, all contexts. + * - By defining `id` only, all contexts from the list of IDs. + * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types + * (true) or those that apply to only a subset of issue types (false) + * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global + * contexts) (true) or those that apply to only a subset of projects (false). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: never, + ): Promise; + async getContextsForField( + parameters: Parameters.GetContextsForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context`, + method: 'GET', + params: { + isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, + isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Creates a custom field context. + * + * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If + * `issueTypeIds` is empty, the context applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: never, + ): Promise; + async createCustomFieldContext( + parameters: Parameters.CreateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + description: parameters.description, + projectIds: parameters.projectIds, + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback: Callback, + ): Promise; + /** + * 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: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: never, + ): Promise; + async getDefaultValues( + parameters: Parameters.GetDefaultValues | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context/defaultValue`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; + /** + * Sets default for contexts of a custom field. Default are defined using these objects: + * + * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. + * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. + * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio + * buttons. + * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and + * checkboxes. + * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. + * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. + * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. + * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. + * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group + * pickers. + * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. + * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. + * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). + * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. + * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. + * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. + * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. + * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. + * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. + * + * Forge custom fields + * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) + * are also supported, returning: + * + * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. + * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection + * fields. + * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. + * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. + * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. + * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection + * fields. + * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. + * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. + * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. + * + * Only one type of default object can be included in a request. To remove a default for a context, set the default + * parameter to `null`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; + async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/defaultValue`, + method: 'PUT', + data: { + defaultValues: parameters.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. + * Mappings are ordered first by context ID and then by issue type ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: never, + ): Promise; + async getIssueTypeMappingsForContexts( + parameters: Parameters.GetIssueTypeMappingsForContexts | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context/issuetypemapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * project and issue type mappings and, for each mapping, the ID of a [custom field + * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. + * + * If there is no custom field context assigned to the project then, if present, the custom field context that applies + * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is + * not found, the returned custom field context ID is `null`. + * + * Duplicate project and issue type mappings cannot be provided in the request. + * + * The order of the returned values is the same as provided in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: never, + ): Promise; + async getCustomFieldContextsForProjectsAndIssueTypes( + parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/mapping`, + method: 'POST', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings + * are returned. Invalid IDs are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: never, + ): Promise; + async getProjectContextMapping( + parameters: Parameters.GetProjectContextMapping | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/context/projectmapping`, + method: 'GET', + params: { + contextId: typeof parameters !== 'string' && parameters.contextId, + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Updates a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: never, + ): Promise; + async updateCustomFieldContext( + parameters: Parameters.UpdateCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Deletes a [custom field + * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: never, + ): Promise; + async deleteCustomFieldContext( + parameters: Parameters.DeleteCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback: Callback, + ): Promise; + /** + * Adds issue types to a custom field context, appending the issue types to the issue types list. + * + * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom + * field context would result in it applying to only the listed issue types. + * + * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; + async addIssueTypesToContext( + parameters: Parameters.AddIssueTypesToContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback: Callback, + ): Promise; + /** + * Removes issue types from a custom field context. + * + * A custom field context without any issue types applies to all issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: never, + ): Promise; + async removeIssueTypesFromContext( + parameters: Parameters.RemoveIssueTypesFromContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback: Callback, + ): Promise; + /** + * Assigns a custom field context to projects. + * + * If any project in the request is assigned to any context of the custom field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: never, + ): Promise; + async assignProjectsToCustomFieldContext( + parameters: Parameters.AssignProjectsToCustomFieldContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project`, + method: 'PUT', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback: Callback, + ): Promise; + /** + * Removes a custom field context from projects. + * + * A custom field context without any projects applies to all projects. Removing all projects from a custom field + * context would result in it applying to all projects. + * + * If any project in the request is not assigned to the context, or the operation would result in two global contexts + * for the field, the operation fails. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: never, + ): Promise; + async removeCustomFieldContextFromProjects( + parameters: Parameters.RemoveCustomFieldContextFromProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, + method: 'POST', + data: { + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldContexts.ts b/src/version3/issueCustomFieldContexts.ts deleted file mode 100644 index c4ade17d87..0000000000 --- a/src/version3/issueCustomFieldContexts.ts +++ /dev/null @@ -1,724 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldContexts { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of [ - * contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a - * custom field. Contexts can be returned as follows: - * - * - With no other parameters set, all contexts. - * - By defining `id` only, all contexts from the list of IDs. - * - By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types - * (true) or those that apply to only a subset of issue types (false) - * - By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global - * contexts) (true) or those that apply to only a subset of projects (false). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: never, - ): Promise; - async getContextsForField( - parameters: Parameters.GetContextsForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context`, - method: 'GET', - params: { - isAnyIssueType: typeof parameters !== 'string' && parameters.isAnyIssueType, - isGlobalContext: typeof parameters !== 'string' && parameters.isGlobalContext, - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Creates a custom field context. - * - * If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If - * `issueTypeIds` is empty, the context applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: never, - ): Promise; - async createCustomFieldContext( - parameters: Parameters.CreateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, - projectIds: parameters.projectIds, - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback: Callback, - ): Promise; - /** - * 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: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: never, - ): Promise; - async getDefaultValues( - parameters: Parameters.GetDefaultValues | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context/defaultValue`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback: Callback): Promise; - /** - * Sets default for contexts of a custom field. Default are defined using these objects: - * - * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. - * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. - * - `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio - * buttons. - * - `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and - * checkboxes. - * - `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. - * - `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. - * - `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. - * - `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. - * - `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group - * pickers. - * - `CustomFieldContextDefaultValueURL` (type `url`) for URLs. - * - `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. - * - `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). - * - `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. - * - `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. - * - `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. - * - `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. - * - `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. - * - `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. - * - * Forge custom fields - * [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) - * are also supported, returning: - * - * - `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. - * - `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection - * fields. - * - `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. - * - `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. - * - `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. - * - `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection - * fields. - * - `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. - * - `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. - * - `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. - * - * Only one type of default object can be included in a request. To remove a default for a context, set the default - * parameter to `null`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: never): Promise; - async setDefaultValues(parameters: Parameters.SetDefaultValues, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/defaultValue`, - method: 'PUT', - data: { - defaultValues: parameters.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. - * Mappings are ordered first by context ID and then by issue type ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: never, - ): Promise; - async getIssueTypeMappingsForContexts( - parameters: Parameters.GetIssueTypeMappingsForContexts | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context/issuetypemapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * project and issue type mappings and, for each mapping, the ID of a [custom field - * context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. - * - * If there is no custom field context assigned to the project then, if present, the custom field context that applies - * to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is - * not found, the returned custom field context ID is `null`. - * - * Duplicate project and issue type mappings cannot be provided in the request. - * - * The order of the returned values is the same as provided in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: never, - ): Promise; - async getCustomFieldContextsForProjectsAndIssueTypes( - parameters: Parameters.GetCustomFieldContextsForProjectsAndIssueTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/mapping`, - method: 'POST', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings - * are returned. Invalid IDs are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: never, - ): Promise; - async getProjectContextMapping( - parameters: Parameters.GetProjectContextMapping | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/context/projectmapping`, - method: 'GET', - params: { - contextId: typeof parameters !== 'string' && parameters.contextId, - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Updates a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: never, - ): Promise; - async updateCustomFieldContext( - parameters: Parameters.UpdateCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Deletes a [custom field - * context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: never, - ): Promise; - async deleteCustomFieldContext( - parameters: Parameters.DeleteCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback: Callback, - ): Promise; - /** - * Adds issue types to a custom field context, appending the issue types to the issue types list. - * - * A custom field context without any issue types applies to all issue types. Adding issue types to such a custom - * field context would result in it applying to only the listed issue types. - * - * If any of the issue types exists in the custom field context, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToContext(parameters: Parameters.AddIssueTypesToContext, callback?: never): Promise; - async addIssueTypesToContext( - parameters: Parameters.AddIssueTypesToContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback: Callback, - ): Promise; - /** - * Removes issue types from a custom field context. - * - * A custom field context without any issue types applies to all issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: never, - ): Promise; - async removeIssueTypesFromContext( - parameters: Parameters.RemoveIssueTypesFromContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/issuetype/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback: Callback, - ): Promise; - /** - * Assigns a custom field context to projects. - * - * If any project in the request is assigned to any context of the custom field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: never, - ): Promise; - async assignProjectsToCustomFieldContext( - parameters: Parameters.AssignProjectsToCustomFieldContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project`, - method: 'PUT', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback: Callback, - ): Promise; - /** - * Removes a custom field context from projects. - * - * A custom field context without any projects applies to all projects. Removing all projects from a custom field - * context would result in it applying to all projects. - * - * If any project in the request is not assigned to the context, or the operation would result in two global contexts - * for the field, the operation fails. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: never, - ): Promise; - async removeCustomFieldContextFromProjects( - parameters: Parameters.RemoveCustomFieldContextFromProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/project/remove`, - method: 'POST', - data: { - projectIds: parameters.projectIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldOptions.mts b/src/version3/issueCustomFieldOptions.mts new file mode 100644 index 0000000000..333991671e --- /dev/null +++ b/src/version3/issueCustomFieldOptions.mts @@ -0,0 +1,301 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptions { + constructor(private client: Client) {} + + /** + * Returns a custom field option. For example, an option in a select list. + * + * 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 apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback: Callback, + ): Promise; + /** + * Returns a custom field option. For example, an option in a select list. + * + * 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 apps. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The + * custom field option is returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least + * one project the custom field is used in, and the field is visible in at least one layout the user has permission + * to view. + */ + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: never, + ): Promise; + async getCustomFieldOption( + parameters: Parameters.GetCustomFieldOption | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/customFieldOption/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * custom field option for a context. Options are returned first then cascading options, in the order they display in + * Jira. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: never, + ): Promise; + async getOptionsForContext( + parameters: Parameters.GetOptionsForContext, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'GET', + params: { + optionId: parameters.optionId, + onlyOptions: parameters.onlyOptions, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a + * custom select field. The options are added to a context of the field. + * + * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 + * options. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: never, + ): Promise; + async createCustomFieldOption( + parameters: Parameters.CreateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'POST', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * 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 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 updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Updates the options of a custom field. + * + * If any of the options are not found, no options are updated. Options where the values in the request match the + * current values aren't updated and aren't reported in the response. + * + * 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 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 updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: never, + ): Promise; + async updateCustomFieldOption( + parameters: Parameters.UpdateCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, + method: 'PUT', + data: { + options: parameters.options, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback: Callback, + ): Promise; + /** + * Changes the order of custom field options or cascading options in a context. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: never, + ): Promise; + async reorderCustomFieldOptions( + parameters: Parameters.ReorderCustomFieldOptions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, + method: 'PUT', + data: { + after: parameters.after, + customFieldOptionIds: parameters.customFieldOptionIds, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes a custom field option. + * + * Options with cascading options cannot be deleted without deleting the cascading options first. + * + * This operation works for custom field options created in Jira or the operations from this resource. **To work with + * issue field select list options created for Connect apps use the [Issue custom field options + * (apps)](#api-group-issue-custom-field-options--apps-) operations.** + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; + async deleteCustomFieldOption( + parameters: Parameters.DeleteCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldOptions.ts b/src/version3/issueCustomFieldOptions.ts deleted file mode 100644 index bddd413e0c..0000000000 --- a/src/version3/issueCustomFieldOptions.ts +++ /dev/null @@ -1,301 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldOptions { - constructor(private client: Client) {} - - /** - * Returns a custom field option. For example, an option in a select list. - * - * 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 apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback: Callback, - ): Promise; - /** - * Returns a custom field option. For example, an option in a select list. - * - * 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 apps. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** The - * custom field option is returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least - * one project the custom field is used in, and the field is visible in at least one layout the user has permission - * to view. - */ - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: never, - ): Promise; - async getCustomFieldOption( - parameters: Parameters.GetCustomFieldOption | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/customFieldOption/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * custom field option for a context. Options are returned first then cascading options, in the order they display in - * Jira. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: never, - ): Promise; - async getOptionsForContext( - parameters: Parameters.GetOptionsForContext, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'GET', - params: { - optionId: parameters.optionId, - onlyOptions: parameters.onlyOptions, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a - * custom select field. The options are added to a context of the field. - * - * The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 - * options. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: never, - ): Promise; - async createCustomFieldOption( - parameters: Parameters.CreateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'POST', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * 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 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 updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Updates the options of a custom field. - * - * If any of the options are not found, no options are updated. Options where the values in the request match the - * current values aren't updated and aren't reported in the response. - * - * 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 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 updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: never, - ): Promise; - async updateCustomFieldOption( - parameters: Parameters.UpdateCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option`, - method: 'PUT', - data: { - options: parameters.options, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback: Callback, - ): Promise; - /** - * Changes the order of custom field options or cascading options in a context. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: never, - ): Promise; - async reorderCustomFieldOptions( - parameters: Parameters.ReorderCustomFieldOptions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, - method: 'PUT', - data: { - after: parameters.after, - customFieldOptionIds: parameters.customFieldOptionIds, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes a custom field option. - * - * Options with cascading options cannot be deleted without deleting the cascading options first. - * - * This operation works for custom field options created in Jira or the operations from this resource. **To work with - * issue field select list options created for Connect apps use the [Issue custom field options - * (apps)](#api-group-issue-custom-field-options--apps-) operations.** - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteCustomFieldOption(parameters: Parameters.DeleteCustomFieldOption, callback?: never): Promise; - async deleteCustomFieldOption( - parameters: Parameters.DeleteCustomFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldOptionsApps.mts b/src/version3/issueCustomFieldOptionsApps.mts new file mode 100644 index 0000000000..ffa53d0516 --- /dev/null +++ b/src/version3/issueCustomFieldOptionsApps.mts @@ -0,0 +1,407 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldOptionsApps { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * the options of a select list issue field. A select list issue field is a type of [issue + * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a + * value from a list of options. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: never, + ): Promise; + async getAllIssueFieldOptions( + parameters: Parameters.GetAllIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldKey}/option`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Creates an option for a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: never, + ): Promise; + async createIssueFieldOption( + parameters: Parameters.CreateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option`, + method: 'POST', + data: { + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed and selected by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: never, + ): Promise; + async getSelectableIssueFieldOptions( + parameters: Parameters.GetSelectableIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldKey}/option/suggestions/edit`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * options for a select list issue field that can be viewed by the user. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: never, + ): Promise; + async getVisibleIssueFieldOptions( + parameters: Parameters.GetVisibleIssueFieldOptions | string, + callback?: Callback, + ): Promise { + const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldKey}/option/suggestions/search`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + projectId: typeof parameters !== 'string' && parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Returns an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: never, + ): Promise; + async getIssueFieldOption( + parameters: Parameters.GetIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided + * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID + * provided in the path and body must be identical. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: never, + ): Promise; + async updateIssueFieldOption( + parameters: Parameters.UpdateIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'PUT', + data: { + id: parameters.id, + value: parameters.value, + properties: parameters.properties, + config: parameters.config, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deletes an option from a select list issue field. + * + * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be + * 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. + * + * **[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. + */ + async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; + async deleteIssueFieldOption( + parameters: Parameters.DeleteIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * 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 + * 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 + * 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. + * + * **[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. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback: Callback, + ): Promise; + /** + * Deselects an issue-field select-list option from all issues where it is selected. A different option can be + * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a Jql + * query. + * + * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + * 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 + * 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 + * 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. + * + * **[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. + */ + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: never, + ): Promise; + async replaceIssueFieldOption( + parameters: Parameters.ReplaceIssueFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldOptionsApps.ts b/src/version3/issueCustomFieldOptionsApps.ts deleted file mode 100644 index 9786d24053..0000000000 --- a/src/version3/issueCustomFieldOptionsApps.ts +++ /dev/null @@ -1,407 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldOptionsApps { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * the options of a select list issue field. A select list issue field is a type of [issue - * field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a - * value from a list of options. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: never, - ): Promise; - async getAllIssueFieldOptions( - parameters: Parameters.GetAllIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldKey}/option`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Creates an option for a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: never, - ): Promise; - async createIssueFieldOption( - parameters: Parameters.CreateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option`, - method: 'POST', - data: { - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed and selected by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: never, - ): Promise; - async getSelectableIssueFieldOptions( - parameters: Parameters.GetSelectableIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldKey}/option/suggestions/edit`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * options for a select list issue field that can be viewed by the user. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: never, - ): Promise; - async getVisibleIssueFieldOptions( - parameters: Parameters.GetVisibleIssueFieldOptions | string, - callback?: Callback, - ): Promise { - const fieldKey = typeof parameters === 'string' ? parameters : parameters.fieldKey; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldKey}/option/suggestions/search`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - projectId: typeof parameters !== 'string' && parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Returns an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: never, - ): Promise; - async getIssueFieldOption( - parameters: Parameters.GetIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Updates or creates an option for a select list issue field. This operation requires that the option ID is provided - * when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID - * provided in the path and body must be identical. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: never, - ): Promise; - async updateIssueFieldOption( - parameters: Parameters.UpdateIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'PUT', - data: { - id: parameters.id, - value: parameters.value, - properties: parameters.properties, - config: parameters.config, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deletes an option from a select list issue field. - * - * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be - * 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. - * - * **[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. - */ - async deleteIssueFieldOption(parameters: Parameters.DeleteIssueFieldOption, callback?: never): Promise; - async deleteIssueFieldOption( - parameters: Parameters.DeleteIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * 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 - * 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 - * 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. - * - * **[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. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback: Callback, - ): Promise; - /** - * Deselects an issue-field select-list option from all issues where it is selected. A different option can be - * selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL - * query. - * - * Connect and Forge app users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - * 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 - * 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 - * 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. - * - * **[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. - */ - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: never, - ): Promise; - async replaceIssueFieldOption( - parameters: Parameters.ReplaceIssueFieldOption, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}/issue`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - jql: parameters.jql, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueCustomFieldValuesApps.mts b/src/version3/issueCustomFieldValuesApps.mts new file mode 100644 index 0000000000..c83ad68ac0 --- /dev/null +++ b/src/version3/issueCustomFieldValuesApps.mts @@ -0,0 +1,85 @@ +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueCustomFieldValuesApps { + constructor(private client: Client) {} + + /** + * 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. + * + * **[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. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback: Callback, + ): 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. + * + * **[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. + */ + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: never, + ): Promise; + async updateMultipleCustomFieldValues( + parameters: Parameters.UpdateMultipleCustomFieldValues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/app/field/value', + method: 'POST', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * **[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. + */ + 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. + * + * **[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. + */ + async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; + async updateCustomFieldValue( + parameters: Parameters.UpdateCustomFieldValue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/value`, + method: 'PUT', + params: { + generateChangelog: parameters.generateChangelog, + }, + data: { + updates: parameters.updates, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCustomFieldValuesApps.ts b/src/version3/issueCustomFieldValuesApps.ts deleted file mode 100644 index 890dbb8fa9..0000000000 --- a/src/version3/issueCustomFieldValuesApps.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueCustomFieldValuesApps { - constructor(private client: Client) {} - - /** - * 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. - * - * **[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. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback: Callback, - ): 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. - * - * **[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. - */ - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: never, - ): Promise; - async updateMultipleCustomFieldValues( - parameters: Parameters.UpdateMultipleCustomFieldValues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/app/field/value', - method: 'POST', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * **[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. - */ - 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. - * - * **[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. - */ - async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; - async updateCustomFieldValue( - parameters: Parameters.UpdateCustomFieldValue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/app/field/${parameters.fieldIdOrKey}/value`, - method: 'PUT', - params: { - generateChangelog: parameters.generateChangelog, - }, - data: { - updates: parameters.updates, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueFieldConfigurations.mts b/src/version3/issueFieldConfigurations.mts new file mode 100644 index 0000000000..e263e50d21 --- /dev/null +++ b/src/version3/issueFieldConfigurations.mts @@ -0,0 +1,644 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFieldConfigurations { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects 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). + */ + async getAllFieldConfigurations( + parameters: Parameters.GetAllFieldConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configurations. The list can be for all field configurations or a subset determined by any combination of these + * criteria: + * + * - A list of field configuration item IDs. + * - Whether the field configuration is a default. + * - Whether the field configuration name or description contains a query string. + * + * Only field configurations used in company-managed (classic) projects 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). + */ + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: never, + ): Promise; + async getAllFieldConfigurations( + parameters?: Parameters.GetAllFieldConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfiguration', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + isDefault: parameters?.isDefault, + query: parameters?.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters: Parameters.CreateFieldConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration. The field configuration is created with the same field properties as the default + * configuration, with all the fields being optional. + * + * This operation can only create configurations for use in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: never, + ): Promise; + async createFieldConfiguration( + parameters?: Parameters.CreateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfiguration', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Updates a field configuration. The name and the description provided in the request override the existing values. + * + * This operation can only update configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: never, + ): Promise; + async updateFieldConfiguration( + parameters: Parameters.UpdateFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration. + * + * This operation can only delete configurations used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration, + callback?: never, + ): Promise; + async deleteFieldConfiguration( + parameters: Parameters.DeleteFieldConfiguration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects 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). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * fields for a configuration. + * + * Only the fields from configurations used in company-managed (classic) projects 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). + */ + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems, + callback?: never, + ): Promise; + async getFieldConfigurationItems( + parameters: Parameters.GetFieldConfigurationItems, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback: Callback, + ): Promise; + /** + * Updates fields in a field configuration. The properties of the field configuration fields provided override the + * existing values. + * + * This operation can only update field configurations used in company-managed (classic) projects. + * + * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style + * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer + * (`autocomplete-renderer`). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: never, + ): Promise; + async updateFieldConfigurationItems( + parameters: Parameters.UpdateFieldConfigurationItems, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, + method: 'PUT', + data: { + fieldConfigurationItems: parameters.fieldConfigurationItems, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects 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). + */ + async getAllFieldConfigurationSchemes( + parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes. + * + * Only field configuration schemes used in classic projects 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). + */ + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: never, + ): Promise; + async getAllFieldConfigurationSchemes( + parameters?: Parameters.GetAllFieldConfigurationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters: Parameters.CreateFieldConfigurationScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a field configuration scheme. + * + * This operation can only create field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: never, + ): Promise; + async createFieldConfigurationScheme( + parameters?: Parameters.CreateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme', + method: 'POST', + data: { + name: parameters?.name, + description: parameters?.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects 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). + */ + async getFieldConfigurationSchemeMappings( + parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration issue type items. + * + * Only items used in classic projects 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). + */ + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeMappings( + parameters?: Parameters.GetFieldConfigurationSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects 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). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field + * configuration schemes and, for each scheme, a list of the projects that use it. + * + * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to + * the default field configuration scheme. + * + * Only field configuration schemes used in classic projects 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). + */ + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: never, + ): Promise; + async getFieldConfigurationSchemeProjectMapping( + parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters: Parameters.AssignFieldConfigurationSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation + * assigns the default field configuration scheme. + * + * Field configuration schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignFieldConfigurationSchemeToProject( + parameters?: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: never, + ): Promise; + async assignFieldConfigurationSchemeToProject( + parameters?: Parameters.AssignFieldConfigurationSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/fieldconfigurationscheme/project', + method: 'PUT', + data: { + fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Updates a field configuration scheme. + * + * This operation can only update field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: never, + ): Promise; + async updateFieldConfigurationScheme( + parameters: Parameters.UpdateFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Deletes a field configuration scheme. + * + * This operation can only delete field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme, + callback?: never, + ): Promise; + async deleteFieldConfigurationScheme( + parameters: Parameters.DeleteFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback: Callback, + ): Promise; + /** + * Assigns issue types to field configurations on field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: never, + ): Promise; + async setFieldConfigurationSchemeMapping( + parameters: Parameters.SetFieldConfigurationSchemeMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping`, + method: 'PUT', + data: { + mappings: parameters.mappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback: Callback, + ): Promise; + /** + * Removes issue types from the field configuration scheme. + * + * This operation can only modify field configuration schemes used in company-managed (classic) projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: never, + ): Promise; + async removeIssueTypesFromGlobalFieldConfigurationScheme( + parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping/delete`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueFieldConfigurations.ts b/src/version3/issueFieldConfigurations.ts deleted file mode 100644 index 49b233448c..0000000000 --- a/src/version3/issueFieldConfigurations.ts +++ /dev/null @@ -1,644 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueFieldConfigurations { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects 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). - */ - async getAllFieldConfigurations( - parameters: Parameters.GetAllFieldConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configurations. The list can be for all field configurations or a subset determined by any combination of these - * criteria: - * - * - A list of field configuration item IDs. - * - Whether the field configuration is a default. - * - Whether the field configuration name or description contains a query string. - * - * Only field configurations used in company-managed (classic) projects 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). - */ - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: never, - ): Promise; - async getAllFieldConfigurations( - parameters?: Parameters.GetAllFieldConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfiguration', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - isDefault: parameters?.isDefault, - query: parameters?.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration. The field configuration is created with the same field properties as the default - * configuration, with all the fields being optional. - * - * This operation can only create configurations for use in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: never, - ): Promise; - async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfiguration', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Updates a field configuration. The name and the description provided in the request override the existing values. - * - * This operation can only update configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: never, - ): Promise; - async updateFieldConfiguration( - parameters: Parameters.UpdateFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration. - * - * This operation can only delete configurations used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration, - callback?: never, - ): Promise; - async deleteFieldConfiguration( - parameters: Parameters.DeleteFieldConfiguration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects 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). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * fields for a configuration. - * - * Only the fields from configurations used in company-managed (classic) projects 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). - */ - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems, - callback?: never, - ): Promise; - async getFieldConfigurationItems( - parameters: Parameters.GetFieldConfigurationItems, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback: Callback, - ): Promise; - /** - * Updates fields in a field configuration. The properties of the field configuration fields provided override the - * existing values. - * - * This operation can only update field configurations used in company-managed (classic) projects. - * - * The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style - * renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer - * (`autocomplete-renderer`). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: never, - ): Promise; - async updateFieldConfigurationItems( - parameters: Parameters.UpdateFieldConfigurationItems, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfiguration/${parameters.id}/fields`, - method: 'PUT', - data: { - fieldConfigurationItems: parameters.fieldConfigurationItems, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects 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). - */ - async getAllFieldConfigurationSchemes( - parameters: Parameters.GetAllFieldConfigurationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes. - * - * Only field configuration schemes used in classic projects 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). - */ - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: never, - ): Promise; - async getAllFieldConfigurationSchemes( - parameters?: Parameters.GetAllFieldConfigurationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a field configuration scheme. - * - * This operation can only create field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: never, - ): Promise; - async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme', - method: 'POST', - data: { - name: parameters?.name, - description: parameters?.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects 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). - */ - async getFieldConfigurationSchemeMappings( - parameters: Parameters.GetFieldConfigurationSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration issue type items. - * - * Only items used in classic projects 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). - */ - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeMappings( - parameters?: Parameters.GetFieldConfigurationSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects 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). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of field - * configuration schemes and, for each scheme, a list of the projects that use it. - * - * The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to - * the default field configuration scheme. - * - * Only field configuration schemes used in classic projects 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). - */ - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: never, - ): Promise; - async getFieldConfigurationSchemeProjectMapping( - parameters: Parameters.GetFieldConfigurationSchemeProjectMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters: Parameters.AssignFieldConfigurationSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation - * assigns the default field configuration scheme. - * - * Field configuration schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignFieldConfigurationSchemeToProject( - parameters?: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: never, - ): Promise; - async assignFieldConfigurationSchemeToProject( - parameters?: Parameters.AssignFieldConfigurationSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/fieldconfigurationscheme/project', - method: 'PUT', - data: { - fieldConfigurationSchemeId: parameters?.fieldConfigurationSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Updates a field configuration scheme. - * - * This operation can only update field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: never, - ): Promise; - async updateFieldConfigurationScheme( - parameters: Parameters.UpdateFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a field configuration scheme. - * - * This operation can only delete field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme, - callback?: never, - ): Promise; - async deleteFieldConfigurationScheme( - parameters: Parameters.DeleteFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback: Callback, - ): Promise; - /** - * Assigns issue types to field configurations on field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: never, - ): Promise; - async setFieldConfigurationSchemeMapping( - parameters: Parameters.SetFieldConfigurationSchemeMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping`, - method: 'PUT', - data: { - mappings: parameters.mappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback: Callback, - ): Promise; - /** - * Removes issue types from the field configuration scheme. - * - * This operation can only modify field configuration schemes used in company-managed (classic) projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: never, - ): Promise; - async removeIssueTypesFromGlobalFieldConfigurationScheme( - parameters: Parameters.RemoveIssueTypesFromGlobalFieldConfigurationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}/mapping/delete`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueFields.mts b/src/version3/issueFields.mts new file mode 100644 index 0000000000..9d3d36aa62 --- /dev/null +++ b/src/version3/issueFields.mts @@ -0,0 +1,319 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueFields { + constructor(private client: Client) {} + + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFields(callback: Callback): Promise; + /** + * Returns system and custom issue fields according to the following rules: + * + * - Fields that cannot be added to the issue navigator are always returned. + * - Fields that cannot be placed on an issue screen are always returned. + * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking + * fields, subtasks, votes, and watches. + * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the + * field is used in at least one project that the user has _Browse Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for.) + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFields(callback?: never): Promise; + async getFields(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters: Parameters.CreateCustomField, + callback: Callback, + ): Promise; + /** + * Creates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createCustomField( + parameters: Parameters.CreateCustomField, + callback?: never, + ): Promise; + async createCustomField( + parameters: Parameters.CreateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + searcherKey: parameters.searcherKey, + type: parameters.type, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - 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`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters: Parameters.GetFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * for Classic Jira projects. The list can include: + * + * - All fields + * - Specific fields, by defining `id` + * - 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`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: never, + ): Promise; + async getFieldsPaginated( + parameters?: Parameters.GetFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + type: parameters?.type, + id: parameters?.id, + query: parameters?.query, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters: Parameters.GetTrashedFieldsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields + * in the trash. The list may be restricted to fields whose field name or description partially match a string. + * + * Only custom fields can be queried, `type` must be set to `custom`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: never, + ): Promise; + async getTrashedFieldsPaginated( + parameters?: Parameters.GetTrashedFieldsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/field/search/trashed', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + query: parameters?.query, + expand: parameters?.expand, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; + /** + * Updates a custom field. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; + async updateCustomField( + parameters: Parameters.UpdateCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + searcherKey: parameters.searcherKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; + /** + * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom + * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. + * + * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; + async deleteCustomField( + parameters: Parameters.DeleteCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback: Callback, + ): Promise; + /** + * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) + * for more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; + async restoreCustomField( + parameters: Parameters.RestoreCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.id}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; + /** + * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for + * more information on trashing and deleting custom fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; + async trashCustomField( + parameters: Parameters.TrashCustomField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.id}/trash`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueFields.ts b/src/version3/issueFields.ts deleted file mode 100644 index b29356e6bd..0000000000 --- a/src/version3/issueFields.ts +++ /dev/null @@ -1,319 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueFields { - constructor(private client: Client) {} - - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFields(callback: Callback): Promise; - /** - * Returns system and custom issue fields according to the following rules: - * - * - Fields that cannot be added to the issue navigator are always returned. - * - Fields that cannot be placed on an issue screen are always returned. - * - Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking - * fields, subtasks, votes, and watches. - * - For all other fields, this operation only returns the fields that the user has permission to view (that is, the - * field is used in at least one project that the user has _Browse Projects_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for.) - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFields(callback?: never): Promise; - async getFields(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField, - callback: Callback, - ): Promise; - /** - * Creates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createCustomField( - parameters: Parameters.CreateCustomField, - callback?: never, - ): Promise; - async createCustomField( - parameters: Parameters.CreateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - searcherKey: parameters.searcherKey, - type: parameters.type, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - 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`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters: Parameters.GetFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * for Classic Jira projects. The list can include: - * - * - All fields - * - Specific fields, by defining `id` - * - 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`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: never, - ): Promise; - async getFieldsPaginated( - parameters?: Parameters.GetFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - type: parameters?.type, - id: parameters?.id, - query: parameters?.query, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters: Parameters.GetTrashedFieldsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of fields - * in the trash. The list may be restricted to fields whose field name or description partially match a string. - * - * Only custom fields can be queried, `type` must be set to `custom`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: never, - ): Promise; - async getTrashedFieldsPaginated( - parameters?: Parameters.GetTrashedFieldsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/field/search/trashed', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - query: parameters?.query, - expand: parameters?.expand, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback: Callback): Promise; - /** - * Updates a custom field. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateCustomField(parameters: Parameters.UpdateCustomField, callback?: never): Promise; - async updateCustomField( - parameters: Parameters.UpdateCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.fieldId}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - searcherKey: parameters.searcherKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback: Callback): Promise; - /** - * Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom - * field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. - * - * 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 deleteCustomField(parameters: Parameters.DeleteCustomField, callback?: never): Promise; - async deleteCustomField( - parameters: Parameters.DeleteCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback: Callback, - ): Promise; - /** - * Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) - * for more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async restoreCustomField(parameters: Parameters.RestoreCustomField, callback?: never): Promise; - async restoreCustomField( - parameters: Parameters.RestoreCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.id}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback: Callback): Promise; - /** - * Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for - * more information on trashing and deleting custom fields. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async trashCustomField(parameters: Parameters.TrashCustomField, callback?: never): Promise; - async trashCustomField( - parameters: Parameters.TrashCustomField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/field/${parameters.id}/trash`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueLinkTypes.mts b/src/version3/issueLinkTypes.mts new file mode 100644 index 0000000000..7e39825ff0 --- /dev/null +++ b/src/version3/issueLinkTypes.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinkTypes { + constructor(private client: Client) {} + + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkTypes(callback: Callback): Promise; + /** + * Returns a list of all issue link types. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkTypes(callback?: never): Promise; + async getIssueLinkTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issueLinkType', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The + * issue link type consists of a name and descriptions for a link's inward and outward relationships. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: never, + ): Promise; + async createIssueLinkType( + parameters: Parameters.CreateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issueLinkType', + method: 'POST', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType, + callback: Callback, + ): Promise; + /** + * Returns an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * 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 a project in the site. + */ + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType, + callback?: never, + ): Promise; + async getIssueLinkType( + parameters: Parameters.GetIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback: Callback, + ): Promise; + /** + * Updates an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: never, + ): Promise; + async updateIssueLinkType( + parameters: Parameters.UpdateIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'PUT', + data: { + id: parameters.id, + inward: parameters.inward, + name: parameters.name, + outward: parameters.outward, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback: Callback): Promise; + /** + * Deletes an issue link type. + * + * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback?: never): Promise; + async deleteIssueLinkType( + parameters: Parameters.DeleteIssueLinkType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueLinkTypes.ts b/src/version3/issueLinkTypes.ts deleted file mode 100644 index 06b4fc987b..0000000000 --- a/src/version3/issueLinkTypes.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueLinkTypes { - constructor(private client: Client) {} - - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkTypes(callback: Callback): Promise; - /** - * Returns a list of all issue link types. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkTypes(callback?: never): Promise; - async getIssueLinkTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issueLinkType', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The - * issue link type consists of a name and descriptions for a link's inward and outward relationships. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: never, - ): Promise; - async createIssueLinkType( - parameters: Parameters.CreateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issueLinkType', - method: 'POST', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType, - callback: Callback, - ): Promise; - /** - * Returns an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * 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 a project in the site. - */ - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType, - callback?: never, - ): Promise; - async getIssueLinkType( - parameters: Parameters.GetIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback: Callback, - ): Promise; - /** - * Updates an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: never, - ): Promise; - async updateIssueLinkType( - parameters: Parameters.UpdateIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'PUT', - data: { - id: parameters.id, - inward: parameters.inward, - name: parameters.name, - outward: parameters.outward, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback: Callback): Promise; - /** - * Deletes an issue link type. - * - * To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueLinkType(parameters: Parameters.DeleteIssueLinkType, callback?: never): Promise; - async deleteIssueLinkType( - parameters: Parameters.DeleteIssueLinkType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLinkType/${parameters.issueLinkTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueLinks.mts b/src/version3/issueLinks.mts new file mode 100644 index 0000000000..bbb86747c0 --- /dev/null +++ b/src/version3/issueLinks.mts @@ -0,0 +1,149 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueLinks { + constructor(private client: Client) {} + + /** + * 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 + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * 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; + /** + * 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 + * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. + * + * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use + * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. + * + * If the link request duplicates a link, the response indicates that the issue link was created. If the request + * included a comment, the comment is added. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the issues to be linked, + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from + * (outward) issue, + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * 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 { + const config: RequestConfig = { + url: '/rest/api/3/issueLink', + method: 'POST', + data: { + type: parameters?.type, + inwardIssue: parameters?.inwardIssue, + outwardIssue: parameters?.outwardIssue, + comment: parameters?.comment, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink(parameters: Parameters.GetIssueLink, callback: Callback): Promise; + /** + * Returns an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing + * the linked issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async getIssueLink(parameters: Parameters.GetIssueLink, callback?: never): Promise; + async getIssueLink( + parameters: Parameters.GetIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLink/${parameters.linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback: Callback): Promise; + /** + * Deletes an issue link. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the + * issues in the link. + * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects + * containing issues in the link. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the + * issues. + */ + async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: never): Promise; + async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issueLink/${parameters.linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueLinks.ts b/src/version3/issueLinks.ts deleted file mode 100644 index e89e9fcda9..0000000000 --- a/src/version3/issueLinks.ts +++ /dev/null @@ -1,149 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueLinks { - constructor(private client: Client) {} - - /** - * 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 - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * 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; - /** - * 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 - * Linking](https://confluence.atlassian.com/x/yoXKM) enabled. - * - * This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use - * `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. - * - * If the link request duplicates a link, the response indicates that the issue link was created. If the request - * included a comment, the comment is added. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the issues to be linked, - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from - * (outward) issue, - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * 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 { - const config: RequestConfig = { - url: '/rest/api/3/issueLink', - method: 'POST', - data: { - type: parameters?.type, - inwardIssue: parameters?.inwardIssue, - outwardIssue: parameters?.outwardIssue, - comment: parameters?.comment, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink(parameters: Parameters.GetIssueLink, callback: Callback): Promise; - /** - * Returns an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse project_ [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing - * the linked issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async getIssueLink(parameters: Parameters.GetIssueLink, callback?: never): Promise; - async getIssueLink( - parameters: Parameters.GetIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLink/${parameters.linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback: Callback): Promise; - /** - * Deletes an issue link. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the - * issues in the link. - * - _Link issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects - * containing issues in the link. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the - * issues. - */ - async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: never): Promise; - async deleteIssueLink(parameters: Parameters.DeleteIssueLink, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issueLink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueNavigatorSettings.mts b/src/version3/issueNavigatorSettings.mts new file mode 100644 index 0000000000..5f4d3280a2 --- /dev/null +++ b/src/version3/issueNavigatorSettings.mts @@ -0,0 +1,76 @@ +import * as Models from './models/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class IssueNavigatorSettings { + constructor(private client: Client) {} + + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Returns the default issue navigator columns. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueNavigatorDefaultColumns(callback?: never): Promise; + async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/settings/columns', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-3-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback: Callback): Promise; + /** + * Sets the default issue navigator columns. + * + * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple + * columns, pass multiple `columns` parameters. For example, in curl: + * + * `curl -X PUT -d columns=summary -d columns=description + * https://your-domain.atlassian.net/rest/api/3/settings/columns` + * + * If no column details are sent, then all default columns are removed. + * + * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue + * columns using [Get fields](#api-rest-api-3-field-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueNavigatorDefaultColumns(callback?: never): Promise; + async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/settings/columns', + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueNavigatorSettings.ts b/src/version3/issueNavigatorSettings.ts deleted file mode 100644 index 470e0a389c..0000000000 --- a/src/version3/issueNavigatorSettings.ts +++ /dev/null @@ -1,76 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueNavigatorSettings { - constructor(private client: Client) {} - - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Returns the default issue navigator columns. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueNavigatorDefaultColumns(callback?: never): Promise; - async getIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/settings/columns', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-3-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback: Callback): Promise; - /** - * Sets the default issue navigator columns. - * - * The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple - * columns, pass multiple `columns` parameters. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/settings/columns` - * - * If no column details are sent, then all default columns are removed. - * - * A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue - * columns using [Get fields](#api-rest-api-3-field-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueNavigatorDefaultColumns(callback?: never): Promise; - async setIssueNavigatorDefaultColumns(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/settings/columns', - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueNotificationSchemes.mts b/src/version3/issueNotificationSchemes.mts new file mode 100644 index 0000000000..c6706a7fcb --- /dev/null +++ b/src/version3/issueNotificationSchemes.mts @@ -0,0 +1,281 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueNotificationSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters: Parameters.GetNotificationSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. + * + * _Note that you should allow for events without recipients to appear in responses._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with a notification scheme for it to be returned. + */ + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: never, + ): Promise; + async getNotificationSchemes( + parameters?: Parameters.GetNotificationSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/notificationscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: parameters?.projectId, + onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: never, + ): Promise; + async createNotificationScheme( + parameters: Parameters.CreateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/notificationscheme', + method: 'POST', + data: { + description: parameters.description, + name: parameters.name, + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or + * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only + * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a + * default notification scheme. The mappings are ordered by projectId. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: never, + ): Promise; + async getNotificationSchemeToProjectMappings( + parameters?: Parameters.GetNotificationSchemeToProjectMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/notificationscheme/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + notificationSchemeId: parameters?.notificationSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the + * recipients who will receive notifications for those events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, the user must have permission to administer at least one project associated + * with the notification scheme. + */ + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: never, + ): Promise; + async getNotificationScheme( + parameters: Parameters.GetNotificationScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a notification 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 updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback: Callback, + ): Promise; + /** + * Updates a notification 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 updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: never, + ): Promise; + async updateNotificationScheme( + parameters: Parameters.UpdateNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a notification 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 deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback: Callback, + ): Promise; + /** + * Deletes a notification 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 deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: never, + ): Promise; + async deleteNotificationScheme( + parameters: Parameters.DeleteNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback: Callback, + ): Promise; + /** + * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: never, + ): Promise; + async removeNotificationFromNotificationScheme( + parameters: Parameters.RemoveNotificationFromNotificationScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueNotificationSchemes.ts b/src/version3/issueNotificationSchemes.ts deleted file mode 100644 index 2392ff3b88..0000000000 --- a/src/version3/issueNotificationSchemes.ts +++ /dev/null @@ -1,281 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueNotificationSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters: Parameters.GetNotificationSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. - * - * _Note that you should allow for events without recipients to appear in responses._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with a notification scheme for it to be returned. - */ - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: never, - ): Promise; - async getNotificationSchemes( - parameters?: Parameters.GetNotificationSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/notificationscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - onlyDefault: parameters?.onlyDefault, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Creates a notification scheme with notifications. You can create up to 1000 notifications per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: never, - ): Promise; - async createNotificationScheme( - parameters: Parameters.CreateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/notificationscheme', - method: 'POST', - data: { - description: parameters.description, - name: parameters.name, - notificationSchemeEvents: parameters.notificationSchemeEvents, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters: Parameters.GetNotificationSchemeToProjectMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or - * project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only - * company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a - * default notification scheme. The mappings are ordered by projectId. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: never, - ): Promise; - async getNotificationSchemeToProjectMappings( - parameters?: Parameters.GetNotificationSchemeToProjectMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/notificationscheme/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - notificationSchemeId: parameters?.notificationSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the - * recipients who will receive notifications for those events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, the user must have permission to administer at least one project associated - * with the notification scheme. - */ - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: never, - ): Promise; - async getNotificationScheme( - parameters: Parameters.GetNotificationScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a notification 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 updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback: Callback, - ): Promise; - /** - * Updates a notification 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 updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: never, - ): Promise; - async updateNotificationScheme( - parameters: Parameters.UpdateNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a notification 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 deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback: Callback, - ): Promise; - /** - * Deletes a notification 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 deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: never, - ): Promise; - async deleteNotificationScheme( - parameters: Parameters.DeleteNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback: Callback, - ): Promise; - /** - * Removes a notification from a notification 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 removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: never, - ): Promise; - async removeNotificationFromNotificationScheme( - parameters: Parameters.RemoveNotificationFromNotificationScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/notificationscheme/${parameters.notificationSchemeId}/notification/${parameters.notificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issuePriorities.mts b/src/version3/issuePriorities.mts new file mode 100644 index 0000000000..7b62a3d513 --- /dev/null +++ b/src/version3/issuePriorities.mts @@ -0,0 +1,236 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class IssuePriorities { + constructor(private client: Client) {} + + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback: Callback): Promise; + /** + * Returns the list of all issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriorities(callback?: never): Promise; + async getPriorities(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue 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 createPriority( + parameters: Parameters.CreatePriority, + callback: Callback, + ): Promise; + /** + * Creates an issue 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 createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; + async createPriority( + parameters: Parameters.CreatePriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority', + method: 'POST', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue 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 setDefaultPriority( + parameters: Parameters.SetDefaultPriority | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue 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 setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; + async setDefaultPriority( + parameters?: Parameters.SetDefaultPriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority/default', + method: 'PUT', + data: { + id: parameters?.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; + /** + * Changes the order of issue priorities. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; + async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority/move', + method: 'PUT', + data: { + after: parameters.after, + ids: parameters.ids, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters: Parameters.SearchPriorities | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: + * + * - A list of priority IDs. Any invalid priority IDs are ignored. + * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project + * IDs are ignored. + * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, + * as there is no concept of default priorities in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: never, + ): Promise; + async searchPriorities( + parameters?: Parameters.SearchPriorities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priority/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: paramSerializer('projectId', parameters?.projectId), + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority(parameters: Parameters.GetPriority, callback: Callback): Promise; + /** + * Returns an issue priority. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPriority(parameters: Parameters.GetPriority, callback?: never): Promise; + async getPriority( + parameters: Parameters.GetPriority, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priority/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; + /** + * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; + async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priority/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + iconUrl: parameters.iconUrl, + name: parameters.name, + statusColor: parameters.statusColor, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issuePriorities.ts b/src/version3/issuePriorities.ts deleted file mode 100644 index 4df878f737..0000000000 --- a/src/version3/issuePriorities.ts +++ /dev/null @@ -1,236 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class IssuePriorities { - constructor(private client: Client) {} - - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback: Callback): Promise; - /** - * Returns the list of all issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriorities(callback?: never): Promise; - async getPriorities(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue 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 createPriority( - parameters: Parameters.CreatePriority, - callback: Callback, - ): Promise; - /** - * Creates an issue 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 createPriority(parameters: Parameters.CreatePriority, callback?: never): Promise; - async createPriority( - parameters: Parameters.CreatePriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority', - method: 'POST', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue 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 setDefaultPriority( - parameters: Parameters.SetDefaultPriority | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue 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 setDefaultPriority(parameters?: Parameters.SetDefaultPriority, callback?: never): Promise; - async setDefaultPriority( - parameters?: Parameters.SetDefaultPriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority/default', - method: 'PUT', - data: { - id: parameters?.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback: Callback): Promise; - /** - * Changes the order of issue priorities. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async movePriorities(parameters: Parameters.MovePriorities, callback?: never): Promise; - async movePriorities(parameters: Parameters.MovePriorities, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority/move', - method: 'PUT', - data: { - after: parameters.after, - ids: parameters.ids, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters: Parameters.SearchPriorities | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * priorities. The list can contain all priorities or a subset determined by any combination of these criteria: - * - * - A list of priority IDs. Any invalid priority IDs are ignored. - * - A list of project IDs. Only priorities that are available in these projects will be returned. Any invalid project - * IDs are ignored. - * - Whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, - * as there is no concept of default priorities in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: never, - ): Promise; - async searchPriorities( - parameters?: Parameters.SearchPriorities, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/priority/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: paramSerializer('projectId', parameters?.projectId), - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority, callback: Callback): Promise; - /** - * Returns an issue priority. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPriority(parameters: Parameters.GetPriority, callback?: never): Promise; - async getPriority( - parameters: Parameters.GetPriority, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/priority/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback: Callback): Promise; - /** - * Updates an issue 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 updatePriority(parameters: Parameters.UpdatePriority, callback?: never): Promise; - async updatePriority(parameters: Parameters.UpdatePriority, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/priority/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - iconUrl: parameters.iconUrl, - name: parameters.name, - statusColor: parameters.statusColor, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueProperties.mts b/src/version3/issueProperties.mts new file mode 100644 index 0000000000..e2f8a9544d --- /dev/null +++ b/src/version3/issueProperties.mts @@ -0,0 +1,509 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueProperties { + constructor(private client: Client) {} + + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( + parameters: Parameters.BulkSetIssuesProperties | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified + * along with up to 10,000 issues on which to set or update that list of entity properties. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum + * length of single issue property value is 32768 characters. This operation can be accessed anonymously. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: never, + ): Promise; + async bulkSetIssuesProperties( + parameters?: Parameters.BulkSetIssuesProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/properties', + method: 'POST', + data: { + entitiesIds: parameters?.entitiesIds, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * 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-3-task-taskId-get) to obtain subsequent updates. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( + parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, + callback: Callback, + ): Promise; + /** + * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up + * to 100 issues included in the request. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. + * + * 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-3-task-taskId-get) to obtain subsequent updates. + * - Non-transactional. Updating some entities may fail. Such information will available in the task result. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: never, + ): Promise; + async bulkSetIssuePropertiesByIssue( + parameters?: Parameters.BulkSetIssuePropertiesByIssue, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/properties/multi', + method: 'POST', + data: { + issues: parameters?.issues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * 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 + * `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:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback: Callback, + ): Promise; + /** + * Sets a property value on multiple issues. + * + * The value set can be a constant or determined by a [Jira + * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable + * with constant complexity when applied to a set of issues. Expressions must also comply with the + * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to + * all Jira expressions. + * + * The issues to be updated can be specified by a filter. + * + * The filter identifies issues eligible for update using these criteria: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * - `hasProperty`: + * + * - If _true_, only issues with the property are eligible. + * - If _false_, only issues without the property are eligible. + * + * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all + * criteria are eligible. + * + * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` + * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a + * value). + * + * The filter is optional. Without the filter all the issues visible to the user and where the user has the + * EDIT_ISSUES permission for the issue are considered eligible. + * + * 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 + * `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:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; + async bulkSetIssueProperty( + parameters: Parameters.BulkSetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, + method: 'PUT', + data: { + value: parameters.value, + expression: parameters.expression, + filter: parameters.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. + * + * The criteria the filter used to identify eligible issues are: + * + * - `entityIds` Only issues from this list are eligible. + * - `currentValue` Only issues with the property set to this value are eligible. + * + * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are + * considered eligible. + * + * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES + * permission for the issue are considered eligible. + * + * This operation is: + * + * - 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 + * `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:** + * + * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing + * issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + */ + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: never, + ): Promise; + async bulkDeleteIssueProperty( + parameters: Parameters.BulkDeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, + method: 'DELETE', + data: { + entityIds: parameters.entityIds, + currentValue: parameters.currentValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Property details are only returned 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 getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the URLs and keys of an issue's properties. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Property details are only returned 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 getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys, + callback?: never, + ): Promise; + async getIssuePropertyKeys( + parameters: Parameters.GetIssuePropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of an issue's property. + * + * 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 + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of an issue's property. + * + * 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 + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: never, + ): Promise; + async getIssueProperty( + parameters: Parameters.GetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; + /** + * Sets the value of an issue's property. Use this resource to store custom data against an issue. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; + async setIssueProperty( + parameters: Parameters.SetIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; + /** + * Deletes an issue's property. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; + async deleteIssueProperty( + parameters: Parameters.DeleteIssueProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueProperties.ts b/src/version3/issueProperties.ts deleted file mode 100644 index bd873db325..0000000000 --- a/src/version3/issueProperties.ts +++ /dev/null @@ -1,509 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueProperties { - constructor(private client: Client) {} - - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( - parameters: Parameters.BulkSetIssuesProperties | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified - * along with up to 10,000 issues on which to set or update that list of entity properties. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum - * length of single issue property value is 32768 characters. This operation can be accessed anonymously. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: never, - ): Promise; - async bulkSetIssuesProperties( - parameters?: Parameters.BulkSetIssuesProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/properties', - method: 'POST', - data: { - entitiesIds: parameters?.entitiesIds, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * 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-3-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( - parameters: Parameters.BulkSetIssuePropertiesByIssue | undefined, - callback: Callback, - ): Promise; - /** - * Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up - * to 100 issues included in the request. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. - * - * 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-3-task-taskId-get) to obtain subsequent updates. - * - Non-transactional. Updating some entities may fail. Such information will available in the task result. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: never, - ): Promise; - async bulkSetIssuePropertiesByIssue( - parameters?: Parameters.BulkSetIssuePropertiesByIssue, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/properties/multi', - method: 'POST', - data: { - issues: parameters?.issues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * 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 - * `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:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback: Callback, - ): Promise; - /** - * Sets a property value on multiple issues. - * - * The value set can be a constant or determined by a [Jira - * expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable - * with constant complexity when applied to a set of issues. Expressions must also comply with the - * [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to - * all Jira expressions. - * - * The issues to be updated can be specified by a filter. - * - * The filter identifies issues eligible for update using these criteria: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - `hasProperty`: - * - * - If _true_, only issues with the property are eligible. - * - If _false_, only issues without the property are eligible. - * - * If more than one criteria is specified, they are joined with the logical _AND_: only issues that satisfy all - * criteria are eligible. - * - * If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` - * and `hasProperty` as _false_ would not match any issues (because without the property the property cannot have a - * value). - * - * The filter is optional. Without the filter all the issues visible to the user and where the user has the - * EDIT_ISSUES permission for the issue are considered eligible. - * - * 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 - * `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:** - * - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkSetIssueProperty(parameters: Parameters.BulkSetIssueProperty, callback?: never): Promise; - async bulkSetIssueProperty( - parameters: Parameters.BulkSetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, - method: 'PUT', - data: { - value: parameters.value, - expression: parameters.expression, - filter: parameters.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. - * - * The criteria the filter used to identify eligible issues are: - * - * - `entityIds` Only issues from this list are eligible. - * - `currentValue` Only issues with the property set to this value are eligible. - * - * If both criteria is specified, they are joined with the logical _AND_: only issues that satisfy both criteria are - * considered eligible. - * - * If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT_ISSUES - * permission for the issue are considered eligible. - * - * This operation is: - * - * - 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 - * `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:** - * - * - _Browse projects_ [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing - * issues. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - _Edit issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. - */ - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: never, - ): Promise; - async bulkDeleteIssueProperty( - parameters: Parameters.BulkDeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, - method: 'DELETE', - data: { - entityIds: parameters.entityIds, - currentValue: parameters.currentValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Property details are only returned 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 getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the URLs and keys of an issue's properties. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Property details are only returned 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 getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys, - callback?: never, - ): Promise; - async getIssuePropertyKeys( - parameters: Parameters.GetIssuePropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of an issue's property. - * - * 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 - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of an issue's property. - * - * 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 - * issue. - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - */ - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: never, - ): Promise; - async getIssueProperty( - parameters: Parameters.GetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback: Callback): Promise; - /** - * Sets the value of an issue's property. Use this resource to store custom data against an issue. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 setIssueProperty(parameters: Parameters.SetIssueProperty, callback?: never): Promise; - async setIssueProperty( - parameters: Parameters.SetIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback: Callback): Promise; - /** - * Deletes an issue's property. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [project permissions](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 deleteIssueProperty(parameters: Parameters.DeleteIssueProperty, callback?: never): Promise; - async deleteIssueProperty( - parameters: Parameters.DeleteIssueProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueRemoteLinks.mts b/src/version3/issueRemoteLinks.mts new file mode 100644 index 0000000000..26dae6a89d --- /dev/null +++ b/src/version3/issueRemoteLinks.mts @@ -0,0 +1,332 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueRemoteLinks { + constructor(private client: Client) {} + + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks, + callback: Callback, + ): Promise; + /** + * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that + * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks, + callback?: never, + ): Promise; + async getRemoteIssueLinks( + parameters: Parameters.GetRemoteIssueLinks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'GET', + params: { + globalId: parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Creates or updates a remote issue link for an issue. + * + * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without + * values in the request are set to null. Otherwise, the remote issue link is created. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: never, + ): Promise; + async createOrUpdateRemoteIssueLink( + parameters: Parameters.CreateOrUpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'POST', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, + callback: Callback, + ): Promise; + /** + * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL + * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` + * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security + * permission to view the issue. + */ + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkByGlobalId( + parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, + method: 'DELETE', + params: { + globalId: parameters.globalId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Returns a remote issue link for an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * 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 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 getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: never, + ): Promise; + async getRemoteIssueLinkById( + parameters: Parameters.GetRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback: Callback, + ): Promise; + /** + * Updates a remote issue link for an issue. + * + * Note: Fields without values in the request are set to null. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; + async updateRemoteIssueLink( + parameters: Parameters.UpdateRemoteIssueLink, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'PUT', + data: { + globalId: parameters.globalId, + application: parameters.application, + relationship: parameters.relationship, + object: parameters.object, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback: Callback, + ): Promise; + /** + * Deletes a remote issue link from an issue. + * + * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: never, + ): Promise; + async deleteRemoteIssueLinkById( + parameters: Parameters.DeleteRemoteIssueLinkById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueRemoteLinks.ts b/src/version3/issueRemoteLinks.ts deleted file mode 100644 index 188d1f5376..0000000000 --- a/src/version3/issueRemoteLinks.ts +++ /dev/null @@ -1,332 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueRemoteLinks { - constructor(private client: Client) {} - - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks, - callback: Callback, - ): Promise; - /** - * Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that - * global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks, - callback?: never, - ): Promise; - async getRemoteIssueLinks( - parameters: Parameters.GetRemoteIssueLinks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'GET', - params: { - globalId: parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Creates or updates a remote issue link for an issue. - * - * If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without - * values in the request are set to null. Otherwise, the remote issue link is created. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: never, - ): Promise; - async createOrUpdateRemoteIssueLink( - parameters: Parameters.CreateOrUpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'POST', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, - callback: Callback, - ): Promise; - /** - * Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL - * characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` - * as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 implemented, issue-level security - * permission to view the issue. - */ - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkByGlobalId( - parameters: Parameters.DeleteRemoteIssueLinkByGlobalId, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, - method: 'DELETE', - params: { - globalId: parameters.globalId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Returns a remote issue link for an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * 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 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 getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: never, - ): Promise; - async getRemoteIssueLinkById( - parameters: Parameters.GetRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback: Callback, - ): Promise; - /** - * Updates a remote issue link for an issue. - * - * Note: Fields without values in the request are set to null. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Link issues_ [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 updateRemoteIssueLink(parameters: Parameters.UpdateRemoteIssueLink, callback?: never): Promise; - async updateRemoteIssueLink( - parameters: Parameters.UpdateRemoteIssueLink, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'PUT', - data: { - globalId: parameters.globalId, - application: parameters.application, - relationship: parameters.relationship, - object: parameters.object, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback: Callback, - ): Promise; - /** - * Deletes a remote issue link from an issue. - * - * This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_, _Edit issues_, and _Link issues_ [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 deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: never, - ): Promise; - async deleteRemoteIssueLinkById( - parameters: Parameters.DeleteRemoteIssueLinkById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueResolutions.mts b/src/version3/issueResolutions.mts new file mode 100644 index 0000000000..988b42a7fb --- /dev/null +++ b/src/version3/issueResolutions.mts @@ -0,0 +1,224 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueResolutions { + constructor(private client: Client) {} + + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback: Callback, + ): Promise; + /** + * Creates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createResolution( + parameters: Parameters.CreateResolution, + callback?: never, + ): Promise; + async createResolution( + parameters: Parameters.CreateResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback: Callback, + ): Promise; + /** + * Sets default issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; + async setDefaultResolution( + parameters: Parameters.SetDefaultResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution/default', + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; + /** + * Changes the order of issue resolutions. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; + async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution/move', + method: 'PUT', + data: { + ids: parameters.ids, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters: Parameters.SearchResolutions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: + * + * - A list of resolutions IDs. + * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects + * only, as there is no concept of default resolutions in team-managed projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: never, + ): Promise; + async searchResolutions( + parameters?: Parameters.SearchResolutions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; + /** + * Updates an issue resolution. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; + async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/resolution/${parameters.id}`, + method: 'PUT', + data: { + ...parameters, + name: parameters.name, + description: parameters.description, + id: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue resolution. + * + * 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 deleteResolution( + parameters: Parameters.DeleteResolution, + callback: Callback, + ): Promise; + /** + * Deletes an issue resolution. + * + * 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 deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: never, + ): Promise; + async deleteResolution( + parameters: Parameters.DeleteResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/resolution/${parameters.id}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueResolutions.ts b/src/version3/issueResolutions.ts deleted file mode 100644 index 09298953f1..0000000000 --- a/src/version3/issueResolutions.ts +++ /dev/null @@ -1,224 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueResolutions { - constructor(private client: Client) {} - - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback: Callback, - ): Promise; - /** - * Creates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createResolution( - parameters: Parameters.CreateResolution, - callback?: never, - ): Promise; - async createResolution( - parameters: Parameters.CreateResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution', - method: 'POST', - data: parameters, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback: Callback, - ): Promise; - /** - * Sets default issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultResolution(parameters: Parameters.SetDefaultResolution, callback?: never): Promise; - async setDefaultResolution( - parameters: Parameters.SetDefaultResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution/default', - method: 'PUT', - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback: Callback): Promise; - /** - * Changes the order of issue resolutions. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: never): Promise; - async moveResolutions(parameters: Parameters.MoveResolutions, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution/move', - method: 'PUT', - data: { - ids: parameters.ids, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters: Parameters.SearchResolutions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: - * - * - A list of resolutions IDs. - * - Whether the field configuration is a default. This returns resolutions from company-managed (classic) projects - * only, as there is no concept of default resolutions in team-managed projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: never, - ): Promise; - async searchResolutions( - parameters?: Parameters.SearchResolutions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/resolution/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback: Callback): Promise; - /** - * Updates an issue resolution. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateResolution(parameters: Parameters.UpdateResolution, callback?: never): Promise; - async updateResolution(parameters: Parameters.UpdateResolution, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/resolution/${parameters.id}`, - method: 'PUT', - data: { - ...parameters, - name: parameters.name, - description: parameters.description, - id: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue resolution. - * - * 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 deleteResolution( - parameters: Parameters.DeleteResolution, - callback: Callback, - ): Promise; - /** - * Deletes an issue resolution. - * - * 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 deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: never, - ): Promise; - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/resolution/${parameters.id}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueSearch.mts b/src/version3/issueSearch.mts new file mode 100644 index 0000000000..30a0facb33 --- /dev/null +++ b/src/version3/issueSearch.mts @@ -0,0 +1,234 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSearch { + constructor(private client: Client) {} + + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters: Parameters.GetIssuePickerResource | undefined, + callback: Callback, + ): Promise; + /** + * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the + * user is looking for an issue using a word or string. + * + * This operation returns two lists: + * + * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain + * the string in the `query` parameter. + * - `Current Search` which includes issues that match the Jql expression in `currentJQL` and contain the string in the + * `query` parameter. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: never, + ): Promise; + async getIssuePickerResource( + parameters?: Parameters.GetIssuePickerResource, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/picker', + method: 'GET', + params: { + query: parameters?.query, + currentJQL: parameters?.currentJQL, + currentIssueKey: parameters?.currentIssueKey, + currentProjectId: parameters?.currentProjectId, + showSubTasks: parameters?.showSubTasks, + showSubTaskParent: parameters?.showSubTaskParent, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries 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 matchIssues( + parameters: Parameters.MatchIssues | undefined, + callback: Callback, + ): Promise; + /** + * Checks whether one or more issues would be returned by one or more Jql queries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, + * however, issues are only matched against Jql queries 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 matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * If the Jql query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-3-search-post) 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 searchForIssuesUsingJql( + parameters: Parameters.SearchForIssuesUsingJql | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * If the Jql query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-3-search-post) 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 searchForIssuesUsingJql( + parameters?: Parameters.SearchForIssuesUsingJql, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-3-search-get) 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 searchForIssuesUsingJqlPost( + parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, + callback: Callback, + ): Promise; + /** + * Searches for issues using [Jql](https://confluence.atlassian.com/x/egORLQ). + * + * There is a [GET](#api-rest-api-3-search-get) 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 searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlPost( + parameters?: Parameters.SearchForIssuesUsingJqlPost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search', + method: 'POST', + data: { + jql: parameters?.jql, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + fields: parameters?.fields, + validateQuery: parameters?.validateQuery, + expand: parameters?.expand, + properties: parameters?.properties, + fieldsByKeys: parameters?.fieldsByKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueSearch.ts b/src/version3/issueSearch.ts deleted file mode 100644 index 051a2a4091..0000000000 --- a/src/version3/issueSearch.ts +++ /dev/null @@ -1,234 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueSearch { - constructor(private client: Client) {} - - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters: Parameters.GetIssuePickerResource | undefined, - callback: Callback, - ): Promise; - /** - * Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the - * user is looking for an issue using a word or string. - * - * This operation returns two lists: - * - * - `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain - * the string in the `query` parameter. - * - `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the - * `query` parameter. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: never, - ): Promise; - async getIssuePickerResource( - parameters?: Parameters.GetIssuePickerResource, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/picker', - method: 'GET', - params: { - query: parameters?.query, - currentJQL: parameters?.currentJQL, - currentIssueKey: parameters?.currentIssueKey, - currentProjectId: parameters?.currentProjectId, - showSubTasks: parameters?.showSubTasks, - showSubTaskParent: parameters?.showSubTaskParent, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries 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 matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; - /** - * Checks whether one or more issues would be returned by one or more JQL queries. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None, - * however, issues are only matched against JQL queries 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 matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-3-search-post) 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 searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * If the JQL query expression is too large to be encoded as a query parameter, use the - * [POST](#api-rest-api-3-search-post) 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 searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-3-search-get) 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 searchForIssuesUsingJqlPost( - parameters: Parameters.SearchForIssuesUsingJqlPost | undefined, - callback: Callback, - ): Promise; - /** - * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). - * - * There is a [GET](#api-rest-api-3-search-get) 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 searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: never, - ): Promise; - async searchForIssuesUsingJqlPost( - parameters?: Parameters.SearchForIssuesUsingJqlPost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/search', - method: 'POST', - data: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueSecurityLevel.mts b/src/version3/issueSecurityLevel.mts new file mode 100644 index 0000000000..ee69f2e4a8 --- /dev/null +++ b/src/version3/issueSecurityLevel.mts @@ -0,0 +1,91 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecurityLevel { + constructor(private client: Client) {} + + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects 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). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers, + callback: Callback, + ): Promise; + /** + * Returns issue security level members. + * + * Only issue security level members in context of classic projects 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). + */ + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers, + callback?: never, + ): Promise; + async getIssueSecurityLevelMembers( + parameters: Parameters.GetIssueSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.issueSecuritySchemeId}/members`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + issueSecurityLevelId: parameters.issueSecurityLevelId, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel, + callback: Callback, + ): Promise; + /** + * Returns details of an issue security level. + * + * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security + * levels associated with the issue security scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel, + callback?: never, + ): Promise; + async getIssueSecurityLevel( + parameters: Parameters.GetIssueSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/securitylevel/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueSecurityLevel.ts b/src/version3/issueSecurityLevel.ts deleted file mode 100644 index 1a3e866999..0000000000 --- a/src/version3/issueSecurityLevel.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueSecurityLevel { - constructor(private client: Client) {} - - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects 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). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Returns issue security level members. - * - * Only issue security level members in context of classic projects 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). - */ - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers, - callback?: never, - ): Promise; - async getIssueSecurityLevelMembers( - parameters: Parameters.GetIssueSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.issueSecuritySchemeId}/members`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - issueSecurityLevelId: parameters.issueSecurityLevelId, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel, - callback: Callback, - ): Promise; - /** - * Returns details of an issue security level. - * - * Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security - * levels associated with the issue security scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel, - callback?: never, - ): Promise; - async getIssueSecurityLevel( - parameters: Parameters.GetIssueSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/securitylevel/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueSecuritySchemes.mts b/src/version3/issueSecuritySchemes.mts new file mode 100644 index 0000000000..8ede5b35c6 --- /dev/null +++ b/src/version3/issueSecuritySchemes.mts @@ -0,0 +1,604 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueSecuritySchemes { + constructor(private client: Client) {} + + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback: Callback): Promise; + /** + * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueSecuritySchemes(callback?: never): Promise; + async getIssueSecuritySchemes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme + * levels and security scheme levels' members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: never, + ): Promise; + async createIssueSecurityScheme( + parameters: Parameters.CreateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes', + method: 'POST', + data: { + description: parameters.description, + levels: parameters.levels, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters: Parameters.GetSecurityLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security levels. + * + * Only issue security levels in the context of classic projects are returned. + * + * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include + * both specified issue security levels and all issue security levels from the specified schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: never, + ): Promise; + async getSecurityLevels( + parameters?: Parameters.GetSecurityLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/level', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + schemeId: parameters?.schemeId, + onlyDefault: parameters?.onlyDefault, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels( + parameters: Parameters.SetDefaultLevels | undefined, + callback: Callback, + ): Promise; + /** + * Sets default issue security levels for schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; + async setDefaultLevels( + parameters?: Parameters.SetDefaultLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/level/default', + method: 'PUT', + data: { + defaultValues: parameters?.defaultValues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters: Parameters.GetSecurityLevelMembers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * security level members. + * + * Only issue security level members in the context of classic projects are returned. + * + * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will + * include all issue security level members from the specified schemes and levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: never, + ): Promise; + async getSecurityLevelMembers( + parameters?: Parameters.GetSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/level/member', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + schemeId: parameters?.schemeId, + levelId: parameters?.levelId, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of + * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs + * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the + * context of classic projects are supported. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: never, + ): Promise; + async searchProjectsUsingSecuritySchemes( + parameters?: Parameters.SearchProjectsUsingSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/project', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueSecuritySchemeId: parameters?.issueSecuritySchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * 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 associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback: Callback, + ): Promise; + /** + * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if + * provided. + * + * 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 associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: never, + ): Promise; + async associateSchemesToProjects( + parameters: Parameters.AssociateSchemesToProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/project', + method: 'PUT', + data: { + oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, + projectId: parameters.projectId, + schemeId: parameters.schemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * Only issue security schemes in the context of classic projects 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). + */ + async searchSecuritySchemes( + parameters: Parameters.SearchSecuritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * 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. + * + * Only issue security schemes in the context of classic projects 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). + */ + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: never, + ): Promise; + async searchSecuritySchemes( + parameters?: Parameters.SearchSecuritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuesecurityschemes/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Returns an issue security scheme along with its security levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the + * requested issue security scheme. + */ + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme, + callback?: never, + ): Promise; + async getIssueSecurityScheme( + parameters: Parameters.GetIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security 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 updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback: Callback, + ): Promise; + /** + * Updates the issue security 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 updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: never, + ): Promise; + async updateIssueSecurityScheme( + parameters: Parameters.UpdateIssueSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security 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 deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue security 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 deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; + async deleteSecurityScheme( + parameters: Parameters.DeleteSecurityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; + /** + * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; + async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level`, + method: 'PUT', + data: { + levels: parameters.levels, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; + /** + * Updates the issue security level. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; + async updateSecurityLevel( + parameters: Parameters.UpdateSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'PUT', + data: { + description: parameters.description, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue security level. + * + * 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 removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; + /** + * Deletes an issue security level. + * + * 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 removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; + async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback: Callback, + ): Promise; + /** + * Adds members to the issue security level. You can add up to 100 members per request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; + async addSecurityLevelMembers( + parameters: Parameters.AddSecurityLevelMembers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, + method: 'PUT', + data: { + members: parameters.members, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback: Callback, + ): Promise; + /** + * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: never, + ): Promise; + async removeMemberFromSecurityLevel( + parameters: Parameters.RemoveMemberFromSecurityLevel, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueSecuritySchemes.ts b/src/version3/issueSecuritySchemes.ts deleted file mode 100644 index 4618823f56..0000000000 --- a/src/version3/issueSecuritySchemes.ts +++ /dev/null @@ -1,604 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueSecuritySchemes { - constructor(private client: Client) {} - - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback: Callback): Promise; - /** - * Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueSecuritySchemes(callback?: never): Promise; - async getIssueSecuritySchemes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Creates a security scheme with security scheme levels and levels' members. You can create up to 100 security scheme - * levels and security scheme levels' members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: never, - ): Promise; - async createIssueSecurityScheme( - parameters: Parameters.CreateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes', - method: 'POST', - data: { - description: parameters.description, - levels: parameters.levels, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters: Parameters.GetSecurityLevels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security levels. - * - * Only issue security levels in the context of classic projects are returned. - * - * Filtering using IDs is inclusive: if you specify both security scheme IDs and level IDs, the result will include - * both specified issue security levels and all issue security levels from the specified schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: never, - ): Promise; - async getSecurityLevels( - parameters?: Parameters.GetSecurityLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/level', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - schemeId: parameters?.schemeId, - onlyDefault: parameters?.onlyDefault, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels( - parameters: Parameters.SetDefaultLevels | undefined, - callback: Callback, - ): Promise; - /** - * Sets default issue security levels for schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setDefaultLevels(parameters?: Parameters.SetDefaultLevels, callback?: never): Promise; - async setDefaultLevels( - parameters?: Parameters.SetDefaultLevels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/level/default', - method: 'PUT', - data: { - defaultValues: parameters?.defaultValues, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters: Parameters.GetSecurityLevelMembers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * security level members. - * - * Only issue security level members in the context of classic projects are returned. - * - * Filtering using parameters is inclusive: if you specify both security scheme IDs and level IDs, the result will - * include all issue security level members from the specified schemes and levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: never, - ): Promise; - async getSecurityLevelMembers( - parameters?: Parameters.GetSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/level/member', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - schemeId: parameters?.schemeId, - levelId: parameters?.levelId, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters: Parameters.SearchProjectsUsingSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) mapping of - * projects that are using security schemes. You can provide either one or multiple security scheme IDs or project IDs - * to filter by. If you don't provide any, this will return a list of all mappings. Only issue security schemes in the - * context of classic projects are supported. - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: never, - ): Promise; - async searchProjectsUsingSecuritySchemes( - parameters?: Parameters.SearchProjectsUsingSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/project', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueSecuritySchemeId: parameters?.issueSecuritySchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * 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 associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback: Callback, - ): Promise; - /** - * Associates an issue security scheme with a project and remaps security levels of issues to the new levels, if - * provided. - * - * 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 associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: never, - ): Promise; - async associateSchemesToProjects( - parameters: Parameters.AssociateSchemesToProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/project', - method: 'PUT', - data: { - oldToNewSecurityLevelMappings: parameters.oldToNewSecurityLevelMappings, - projectId: parameters.projectId, - schemeId: parameters.schemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * Only issue security schemes in the context of classic projects 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). - */ - async searchSecuritySchemes( - parameters: Parameters.SearchSecuritySchemes | undefined, - callback: Callback, - ): Promise; - /** - * 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. - * - * Only issue security schemes in the context of classic projects 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). - */ - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: never, - ): Promise; - async searchSecuritySchemes( - parameters?: Parameters.SearchSecuritySchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuesecurityschemes/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Returns an issue security scheme along with its security levels. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the - * requested issue security scheme. - */ - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme, - callback?: never, - ): Promise; - async getIssueSecurityScheme( - parameters: Parameters.GetIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security 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 updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback: Callback, - ): Promise; - /** - * Updates the issue security 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 updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: never, - ): Promise; - async updateIssueSecurityScheme( - parameters: Parameters.UpdateIssueSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.id}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security 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 deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue security 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 deleteSecurityScheme(parameters: Parameters.DeleteSecurityScheme, callback?: never): Promise; - async deleteSecurityScheme( - parameters: Parameters.DeleteSecurityScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback: Callback): Promise; - /** - * Adds levels and levels' members to the issue security scheme. You can add up to 100 levels per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: never): Promise; - async addSecurityLevel(parameters: Parameters.AddSecurityLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level`, - method: 'PUT', - data: { - levels: parameters.levels, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback: Callback): Promise; - /** - * Updates the issue security level. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateSecurityLevel(parameters: Parameters.UpdateSecurityLevel, callback?: never): Promise; - async updateSecurityLevel( - parameters: Parameters.UpdateSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'PUT', - data: { - description: parameters.description, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue security level. - * - * 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 removeLevel(parameters: Parameters.RemoveLevel, callback: Callback): Promise; - /** - * Deletes an issue security level. - * - * 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 removeLevel(parameters: Parameters.RemoveLevel, callback?: never): Promise; - async removeLevel(parameters: Parameters.RemoveLevel, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}`, - method: 'DELETE', - params: { - replaceWith: parameters.replaceWith, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback: Callback, - ): Promise; - /** - * Adds members to the issue security level. You can add up to 100 members per request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addSecurityLevelMembers(parameters: Parameters.AddSecurityLevelMembers, callback?: never): Promise; - async addSecurityLevelMembers( - parameters: Parameters.AddSecurityLevelMembers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member`, - method: 'PUT', - data: { - members: parameters.members, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback: Callback, - ): Promise; - /** - * Removes an issue security level member from an issue security 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 removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: never, - ): Promise; - async removeMemberFromSecurityLevel( - parameters: Parameters.RemoveMemberFromSecurityLevel, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuesecurityschemes/${parameters.schemeId}/level/${parameters.levelId}/member/${parameters.memberId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypeProperties.mts b/src/version3/issueTypeProperties.mts new file mode 100644 index 0000000000..e6b2b08c48 --- /dev/null +++ b/src/version3/issueTypeProperties.mts @@ -0,0 +1,173 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeProperties { + constructor(private client: Client) {} + + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns all the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys of the issue type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any + * issue type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any + * issue types associated with the projects the user has permission to browse. + */ + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys, + callback?: never, + ): Promise; + async getIssueTypePropertyKeys( + parameters: Parameters.GetIssueTypePropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Returns the key and value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue + * type. + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue + * types associated with the projects the user has permission to browse. + */ + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: never, + ): Promise; + async getIssueTypeProperty( + parameters: Parameters.GetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Creates or updates the value of the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * Use this resource to store and update data against an issue type. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; + async setIssueTypeProperty( + parameters: Parameters.SetIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback: Callback, + ): Promise; + /** + * Deletes the [issue type + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; + async deleteIssueTypeProperty( + parameters: Parameters.DeleteIssueTypeProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypeProperties.ts b/src/version3/issueTypeProperties.ts deleted file mode 100644 index 03c2088b67..0000000000 --- a/src/version3/issueTypeProperties.ts +++ /dev/null @@ -1,173 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypeProperties { - constructor(private client: Client) {} - - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns all the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys of the issue type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any - * issue type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any - * issue types associated with the projects the user has permission to browse. - */ - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys, - callback?: never, - ): Promise; - async getIssueTypePropertyKeys( - parameters: Parameters.GetIssueTypePropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Returns the key and value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue - * type. - * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue - * types associated with the projects the user has permission to browse. - */ - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: never, - ): Promise; - async getIssueTypeProperty( - parameters: Parameters.GetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Creates or updates the value of the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * Use this resource to store and update data against an issue type. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setIssueTypeProperty(parameters: Parameters.SetIssueTypeProperty, callback?: never): Promise; - async setIssueTypeProperty( - parameters: Parameters.SetIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback: Callback, - ): Promise; - /** - * Deletes the [issue type - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueTypeProperty(parameters: Parameters.DeleteIssueTypeProperty, callback?: never): Promise; - async deleteIssueTypeProperty( - parameters: Parameters.DeleteIssueTypeProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.issueTypeId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypeSchemes.mts b/src/version3/issueTypeSchemes.mts new file mode 100644 index 0000000000..f817140bf6 --- /dev/null +++ b/src/version3/issueTypeSchemes.mts @@ -0,0 +1,432 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects 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). + */ + async getAllIssueTypeSchemes( + parameters: Parameters.GetAllIssueTypeSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes. + * + * Only issue type schemes used in classic projects 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). + */ + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: never, + ): Promise; + async getAllIssueTypeSchemes( + parameters?: Parameters.GetAllIssueTypeSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + queryString: parameters?.queryString, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type 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 createIssueTypeScheme( + parameters: Parameters.CreateIssueTypeScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type 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 createIssueTypeScheme( + parameters?: Parameters.CreateIssueTypeScheme, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects 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). + */ + async getIssueTypeSchemesMapping( + parameters: Parameters.GetIssueTypeSchemesMapping | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type scheme items. + * + * Only issue type scheme items used in classic projects 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). + */ + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: never, + ): Promise; + async getIssueTypeSchemesMapping( + parameters?: Parameters.GetIssueTypeSchemesMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeSchemeId: parameters?.issueTypeSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects 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). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type schemes and, for each issue type scheme, a list of the projects that use it. + * + * Only issue type schemes used in classic projects 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). + */ + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: never, + ): Promise; + async getIssueTypeSchemeForProjects( + parameters: Parameters.GetIssueTypeSchemeForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type scheme to a project. + * + * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To + * complete the assignment those issues must be updated to use issue types in the new scheme. + * + * Issue type schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeSchemeToProject( + parameters?: Parameters.AssignIssueTypeSchemeToProject, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type 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 updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type 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 updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; + async updateIssueTypeScheme( + parameters: Parameters.UpdateIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultIssueTypeId: parameters.defaultIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue type scheme. + * + * Only issue type schemes used in classic projects can be deleted. + * + * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme(parameters: Parameters.DeleteIssueTypeScheme, callback?: never): Promise; + async deleteIssueTypeScheme( + parameters: Parameters.DeleteIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Adds issue types to an issue type scheme. + * + * The added issue types are appended to the issue types list. + * + * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: never, + ): Promise; + async addIssueTypesToIssueTypeScheme( + parameters: Parameters.AddIssueTypesToIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Changes the order of issue types in an issue type scheme. + * + * The request body parameters must meet the following requirements: + * + * - All of the issue types must belong to the issue type scheme. + * - Either `after` or `position` must be provided. + * - The issue type in `after` must not be in the issue type list. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: never, + ): Promise; + async reorderIssueTypesInIssueTypeScheme( + parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, + method: 'PUT', + data: { + issueTypeIds: parameters.issueTypeIds, + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback: Callback, + ): Promise; + /** + * Removes an issue type from an issue type scheme. + * + * This operation cannot remove: + * + * - Any issue type used by issues. + * - Any issue types from the default issue type scheme. + * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: never, + ): Promise; + async removeIssueTypeFromIssueTypeScheme( + parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypeSchemes.ts b/src/version3/issueTypeSchemes.ts deleted file mode 100644 index 3aec7af581..0000000000 --- a/src/version3/issueTypeSchemes.ts +++ /dev/null @@ -1,432 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypeSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects 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). - */ - async getAllIssueTypeSchemes( - parameters: Parameters.GetAllIssueTypeSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes. - * - * Only issue type schemes used in classic projects 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). - */ - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: never, - ): Promise; - async getAllIssueTypeSchemes( - parameters?: Parameters.GetAllIssueTypeSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - queryString: parameters?.queryString, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type 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 createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type 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 createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects 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). - */ - async getIssueTypeSchemesMapping( - parameters: Parameters.GetIssueTypeSchemesMapping | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type scheme items. - * - * Only issue type scheme items used in classic projects 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). - */ - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: never, - ): Promise; - async getIssueTypeSchemesMapping( - parameters?: Parameters.GetIssueTypeSchemesMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeSchemeId: parameters?.issueTypeSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects 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). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type schemes and, for each issue type scheme, a list of the projects that use it. - * - * Only issue type schemes used in classic projects 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). - */ - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: never, - ): Promise; - async getIssueTypeSchemeForProjects( - parameters: Parameters.GetIssueTypeSchemeForProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type scheme to a project. - * - * If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To - * complete the assignment those issues must be updated to use issue types in the new scheme. - * - * Issue type schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type 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 updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type 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 updateIssueTypeScheme(parameters: Parameters.UpdateIssueTypeScheme, callback?: never): Promise; - async updateIssueTypeScheme( - parameters: Parameters.UpdateIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultIssueTypeId: parameters.defaultIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue type scheme. - * - * Only issue type schemes used in classic projects can be deleted. - * - * Any projects assigned to the scheme are reassigned to the default issue type 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 deleteIssueTypeScheme(parameters: Parameters.DeleteIssueTypeScheme, callback?: never): Promise; - async deleteIssueTypeScheme( - parameters: Parameters.DeleteIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Adds issue types to an issue type scheme. - * - * The added issue types are appended to the issue types list. - * - * If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: never, - ): Promise; - async addIssueTypesToIssueTypeScheme( - parameters: Parameters.AddIssueTypesToIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Changes the order of issue types in an issue type scheme. - * - * The request body parameters must meet the following requirements: - * - * - All of the issue types must belong to the issue type scheme. - * - Either `after` or `position` must be provided. - * - The issue type in `after` must not be in the issue type list. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: never, - ): Promise; - async reorderIssueTypesInIssueTypeScheme( - parameters: Parameters.ReorderIssueTypesInIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, - method: 'PUT', - data: { - issueTypeIds: parameters.issueTypeIds, - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback: Callback, - ): Promise; - /** - * Removes an issue type from an issue type scheme. - * - * This operation cannot remove: - * - * - Any issue type used by issues. - * - Any issue types from the default issue type scheme. - * - The last standard issue type from an issue type 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 removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: never, - ): Promise; - async removeIssueTypeFromIssueTypeScheme( - parameters: Parameters.RemoveIssueTypeFromIssueTypeScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/${parameters.issueTypeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypeScreenSchemes.mts b/src/version3/issueTypeScreenSchemes.mts new file mode 100644 index 0000000000..696559528e --- /dev/null +++ b/src/version3/issueTypeScreenSchemes.mts @@ -0,0 +1,436 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypeScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemes( + parameters: Parameters.GetIssueTypeScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemes( + parameters?: Parameters.GetIssueTypeScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type screen 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 createIssueTypeScreenScheme( + parameters: Parameters.CreateIssueTypeScreenScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type screen 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 createIssueTypeScreenScheme( + parameters?: Parameters.CreateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeMappings( + parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen scheme items. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeMappings( + parameters?: Parameters.GetIssueTypeScreenSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme/mapping', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue + * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. + * + * Only issue type screen schemes used in classic projects 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). + */ + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: never, + ): Promise; + async getIssueTypeScreenSchemeProjectAssociations( + parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme/project', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, + callback: Callback, + ): Promise; + /** + * Assigns an issue type screen scheme to a project. + * + * Issue type screen schemes can only be assigned to classic projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: never, + ): Promise; + async assignIssueTypeScreenSchemeToProject( + parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetypescreenscheme/project', + method: 'PUT', + data: { + issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates an issue type screen 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 updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates an issue type screen 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 updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: never, + ): Promise; + async updateIssueTypeScreenScheme( + parameters: Parameters.UpdateIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme, + callback?: never, + ): Promise; + async deleteIssueTypeScreenScheme( + parameters: Parameters.DeleteIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: never, + ): Promise; + async appendMappingsForIssueTypeScreenScheme( + parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, + method: 'PUT', + data: { + issueTypeMappings: parameters.issueTypeMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback: Callback, + ): Promise; + /** + * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all + * unmapped issue types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: never, + ): Promise; + async updateDefaultScreenScheme( + parameters: Parameters.UpdateDefaultScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, + method: 'PUT', + data: { + screenSchemeId: parameters.screenSchemeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: never, + ): Promise; + async removeMappingsFromIssueTypeScreenScheme( + parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, + method: 'POST', + data: { + issueTypeIds: parameters.issueTypeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme 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). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects associated with an issue type screen scheme. + * + * Only company-managed projects associated with an issue type screen scheme 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). + */ + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme, + callback?: never, + ): Promise; + async getProjectsForIssueTypeScreenScheme( + parameters: Parameters.GetProjectsForIssueTypeScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/project`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypeScreenSchemes.ts b/src/version3/issueTypeScreenSchemes.ts deleted file mode 100644 index 2b52cba239..0000000000 --- a/src/version3/issueTypeScreenSchemes.ts +++ /dev/null @@ -1,436 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypeScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemes( - parameters: Parameters.GetIssueTypeScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemes( - parameters?: Parameters.GetIssueTypeScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type screen 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 createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type screen 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 createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeMappings( - parameters: Parameters.GetIssueTypeScreenSchemeMappings | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen scheme items. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeMappings( - parameters?: Parameters.GetIssueTypeScreenSchemeMappings, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme/mapping', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue - * type screen schemes and, for each issue type screen scheme, a list of the projects that use it. - * - * Only issue type screen schemes used in classic projects 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). - */ - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: never, - ): Promise; - async getIssueTypeScreenSchemeProjectAssociations( - parameters: Parameters.GetIssueTypeScreenSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme/project', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters: Parameters.AssignIssueTypeScreenSchemeToProject | undefined, - callback: Callback, - ): Promise; - /** - * Assigns an issue type screen scheme to a project. - * - * Issue type screen schemes can only be assigned to classic projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: never, - ): Promise; - async assignIssueTypeScreenSchemeToProject( - parameters?: Parameters.AssignIssueTypeScreenSchemeToProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetypescreenscheme/project', - method: 'PUT', - data: { - issueTypeScreenSchemeId: parameters?.issueTypeScreenSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates an issue type screen 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 updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates an issue type screen 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 updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: never, - ): Promise; - async updateIssueTypeScreenScheme( - parameters: Parameters.UpdateIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Deletes an issue type screen 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 deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme, - callback?: never, - ): Promise; - async deleteIssueTypeScreenScheme( - parameters: Parameters.DeleteIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Appends issue type to screen scheme mappings to an issue type screen 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 appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async appendMappingsForIssueTypeScreenScheme( - parameters: Parameters.AppendMappingsForIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping`, - method: 'PUT', - data: { - issueTypeMappings: parameters.issueTypeMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback: Callback, - ): Promise; - /** - * Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all - * unmapped issue types. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: never, - ): Promise; - async updateDefaultScreenScheme( - parameters: Parameters.UpdateDefaultScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/default`, - method: 'PUT', - data: { - screenSchemeId: parameters.screenSchemeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Removes issue type to screen scheme mappings from an issue type screen 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 removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: never, - ): Promise; - async removeMappingsFromIssueTypeScreenScheme( - parameters: Parameters.RemoveMappingsFromIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/mapping/remove`, - method: 'POST', - data: { - issueTypeIds: parameters.issueTypeIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme 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). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects associated with an issue type screen scheme. - * - * Only company-managed projects associated with an issue type screen scheme 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). - */ - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme, - callback?: never, - ): Promise; - async getProjectsForIssueTypeScreenScheme( - parameters: Parameters.GetProjectsForIssueTypeScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}/project`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - query: parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueTypes.mts b/src/version3/issueTypes.mts new file mode 100644 index 0000000000..7c9fbffe15 --- /dev/null +++ b/src/version3/issueTypes.mts @@ -0,0 +1,336 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueTypes { + constructor(private client: Client) {} + + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback: Callback): Promise; + /** + * Returns all issue types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue + * types are only returned as follows: + * + * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue + * types are returned. + * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or + * more projects, the issue types associated with the projects the user has permission to browse are returned. + */ + async getIssueAllTypes(callback?: never): Promise; + async getIssueAllTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetype', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue type and adds it to the default issue type 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 createIssueType( + parameters: Parameters.CreateIssueType | undefined, + callback: Callback, + ): Promise; + /** + * Creates an issue type and adds it to the default issue type 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 createIssueType( + parameters?: Parameters.CreateIssueType, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns issue types for a project. + * + * 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) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback: Callback, + ): Promise; + /** + * Returns issue types for a project. + * + * 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) in the relevant project or _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: never, + ): Promise; + async getIssueTypesForProject( + parameters: Parameters.GetIssueTypesForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issuetype/project', + method: 'GET', + params: { + projectId: parameters.projectId, + level: parameters.level, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns an issue type. + * + * 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) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType( + parameters: Parameters.GetIssueType, + callback: Callback, + ): Promise; + /** + * Returns an issue type. + * + * 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) in a project the issue type is associated + * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueType(parameters: Parameters.GetIssueType, callback?: never): Promise; + async getIssueType( + parameters: Parameters.GetIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback: Callback, + ): Promise; + /** + * Updates the issue type. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: never, + ): Promise; + async updateIssueType( + parameters: Parameters.UpdateIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + avatarId: parameters.avatarId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback: Callback): Promise; + /** + * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type + * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue + * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: never): Promise; + async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}`, + method: 'DELETE', + params: { + alternativeIssueTypeId: parameters.alternativeIssueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those + * assigned to the same workflow scheme, field configuration scheme, and screen scheme. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes, + callback?: never, + ): Promise; + async getAlternativeIssueTypes( + parameters: Parameters.GetAlternativeIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}/alternatives`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback: Callback, + ): Promise; + /** + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: never, + ): Promise; + async createIssueTypeAvatar( + parameters: Parameters.CreateIssueTypeAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issuetype/${parameters.id}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueTypes.ts b/src/version3/issueTypes.ts deleted file mode 100644 index a91e4834ec..0000000000 --- a/src/version3/issueTypes.ts +++ /dev/null @@ -1,336 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueTypes { - constructor(private client: Client) {} - - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback: Callback): Promise; - /** - * Returns all issue types. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issue - * types are only returned as follows: - * - * - If the user has the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue - * types are returned. - * - If the user has the _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or - * more projects, the issue types associated with the projects the user has permission to browse are returned. - */ - async getIssueAllTypes(callback?: never): Promise; - async getIssueAllTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetype', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue type and adds it to the default issue type 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 createIssueType( - parameters: Parameters.CreateIssueType | undefined, - callback: Callback, - ): Promise; - /** - * Creates an issue type and adds it to the default issue type 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 createIssueType( - parameters?: Parameters.CreateIssueType, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns issue types for a project. - * - * 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) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback: Callback, - ): Promise; - /** - * Returns issue types for a project. - * - * 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) in the relevant project or _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: never, - ): Promise; - async getIssueTypesForProject( - parameters: Parameters.GetIssueTypesForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issuetype/project', - method: 'GET', - params: { - projectId: parameters.projectId, - level: parameters.level, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns an issue type. - * - * 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) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType( - parameters: Parameters.GetIssueType, - callback: Callback, - ): Promise; - /** - * Returns an issue type. - * - * 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) in a project the issue type is associated - * with or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getIssueType(parameters: Parameters.GetIssueType, callback?: never): Promise; - async getIssueType( - parameters: Parameters.GetIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback: Callback, - ): Promise; - /** - * Updates the issue type. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: never, - ): Promise; - async updateIssueType( - parameters: Parameters.UpdateIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - avatarId: parameters.avatarId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback: Callback): Promise; - /** - * Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type - * (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue - * types](#api-rest-api-3-issuetype-id-alternatives-get) resource. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: never): Promise; - async deleteIssueType(parameters: Parameters.DeleteIssueType, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}`, - method: 'DELETE', - params: { - alternativeIssueTypeId: parameters.alternativeIssueTypeId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, - callback: Callback, - ): Promise; - /** - * Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those - * assigned to the same workflow scheme, field configuration scheme, and screen scheme. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, - callback?: never, - ): Promise; - async getAlternativeIssueTypes( - parameters: Parameters.GetAlternativeIssueTypes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}/alternatives`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback: Callback, - ): Promise; - /** - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: never, - ): Promise; - async createIssueTypeAvatar( - parameters: Parameters.CreateIssueTypeAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issuetype/${parameters.id}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueVotes.mts b/src/version3/issueVotes.mts new file mode 100644 index 0000000000..6eecf2cbc2 --- /dev/null +++ b/src/version3/issueVotes.mts @@ -0,0 +1,139 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueVotes { + constructor(private client: Client) {} + + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes, callback: Callback): Promise; + /** + * Returns details about the votes on an issue. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * + * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ + * project permissions are not returned details in the `voters` field. + */ + async getVotes(parameters: Parameters.GetVotes, callback?: never): Promise; + async getVotes(parameters: Parameters.GetVotes, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 addVote(parameters: Parameters.AddVote, callback: Callback): Promise; + /** + * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 addVote(parameters: Parameters.AddVote, callback?: never): Promise; + async addVote(parameters: Parameters.AddVote, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 removeVote(parameters: Parameters.RemoveVote, callback: Callback): Promise; + /** + * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. + * + * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 removeVote(parameters: Parameters.RemoveVote, callback?: never): Promise; + async removeVote(parameters: Parameters.RemoveVote, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueVotes.ts b/src/version3/issueVotes.ts deleted file mode 100644 index f115e57588..0000000000 --- a/src/version3/issueVotes.ts +++ /dev/null @@ -1,139 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueVotes { - constructor(private client: Client) {} - - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes, callback: Callback): Promise; - /** - * Returns details about the votes on an issue. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - * Note that users with the necessary permissions for this operation but without the _View voters and watchers_ - * project permissions are not returned details in the `voters` field. - */ - async getVotes(parameters: Parameters.GetVotes, callback?: never): Promise; - async getVotes(parameters: Parameters.GetVotes, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 addVote(parameters: Parameters.AddVote, callback: Callback): Promise; - /** - * Adds the user's vote to an issue. This is the equivalent of the user clicking _Vote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 addVote(parameters: Parameters.AddVote, callback?: never): Promise; - async addVote(parameters: Parameters.AddVote, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 removeVote(parameters: Parameters.RemoveVote, callback: Callback): Promise; - /** - * Deletes a user's vote from an issue. This is the equivalent of the user clicking _Unvote_ on an issue in Jira. - * - * This operation requires the **Allow users to vote on issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 removeVote(parameters: Parameters.RemoveVote, callback?: never): Promise; - async removeVote(parameters: Parameters.RemoveVote, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/votes`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueWatchers.mts b/src/version3/issueWatchers.mts new file mode 100644 index 0000000000..a3ff203ba1 --- /dev/null +++ b/src/version3/issueWatchers.mts @@ -0,0 +1,211 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWatchers { + constructor(private client: Client) {} + + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 getIsWatchingIssueBulk( + parameters: Parameters.GetIsWatchingIssueBulk | undefined, + callback: Callback, + ): Promise; + /** + * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned + * watched status is `false`. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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 getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: never, + ): Promise; + async getIsWatchingIssueBulk( + parameters?: Parameters.GetIsWatchingIssueBulk, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/watching', + method: 'POST', + data: { + issueIds: parameters?.issueIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers, + callback: Callback, + ): Promise; + /** + * Returns the watchers for an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * 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 that the issue is + * ini + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async getIssueWatchers(parameters: Parameters.GetIssueWatchers, callback?: never): Promise; + async getIssueWatchers( + parameters: Parameters.GetIssueWatchers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; + /** + * Adds a user as a watcher of an issue by passing the account ID of the user. For example, + * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To add users other than themselves to the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; + async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: parameters.accountId, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; + /** + * Deletes a user as a watcher of an issue. + * + * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General + * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for + * details. + * + * **[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 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. + * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + */ + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; + async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, + method: 'DELETE', + params: { + username: parameters.username, + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueWatchers.ts b/src/version3/issueWatchers.ts deleted file mode 100644 index 69e2c03035..0000000000 --- a/src/version3/issueWatchers.ts +++ /dev/null @@ -1,211 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueWatchers { - constructor(private client: Client) {} - - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 getIsWatchingIssueBulk( - parameters: Parameters.GetIsWatchingIssueBulk | undefined, - callback: Callback, - ): Promise; - /** - * Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned - * watched status is `false`. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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 getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: never, - ): Promise; - async getIsWatchingIssueBulk( - parameters?: Parameters.GetIsWatchingIssueBulk, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/watching', - method: 'POST', - data: { - issueIds: parameters?.issueIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers, - callback: Callback, - ): Promise; - /** - * Returns the watchers for an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * 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 that the issue is - * ini - * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission - * to view the issue. - * - To see details of users on the watchlist other than themselves, _View voters and watchers_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async getIssueWatchers(parameters: Parameters.GetIssueWatchers, callback?: never): Promise; - async getIssueWatchers( - parameters: Parameters.GetIssueWatchers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback: Callback): Promise; - /** - * Adds a user as a watcher of an issue by passing the account ID of the user. For example, - * `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To add users other than themselves to the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async addWatcher(parameters: Parameters.AddWatcher, callback?: never): Promise; - async addWatcher(parameters: Parameters.AddWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - data: parameters.accountId, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback: Callback): Promise; - /** - * Deletes a user as a watcher of an issue. - * - * This operation requires the **Allow users to watch issues** option to be _ON_. This option is set in General - * configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for - * details. - * - * **[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 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. - * - To remove users other than themselves from the watchlist, _Manage watcher list_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. - */ - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: never): Promise; - async removeWatcher(parameters: Parameters.RemoveWatcher, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/watchers`, - method: 'DELETE', - params: { - username: parameters.username, - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueWorklogProperties.mts b/src/version3/issueWorklogProperties.mts new file mode 100644 index 0000000000..11e741db87 --- /dev/null +++ b/src/version3/issueWorklogProperties.mts @@ -0,0 +1,197 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class IssueWorklogProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a worklog. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a worklog. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: never, + ): Promise; + async getWorklogPropertyKeys( + parameters: Parameters.GetWorklogPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: never, + ): Promise; + async getWorklogProperty( + parameters: Parameters.GetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of a worklog property. Use this operation to store custom data against the worklog. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; + async setWorklogProperty( + parameters: Parameters.SetWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback: Callback, + ): Promise; + /** + * Deletes a worklog property. + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; + async deleteWorklogProperty( + parameters: Parameters.DeleteWorklogProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueWorklogProperties.ts b/src/version3/issueWorklogProperties.ts deleted file mode 100644 index 14a743ca9f..0000000000 --- a/src/version3/issueWorklogProperties.ts +++ /dev/null @@ -1,197 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class IssueWorklogProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a worklog. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a worklog. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: never, - ): Promise; - async getWorklogPropertyKeys( - parameters: Parameters.GetWorklogPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: never, - ): Promise; - async getWorklogProperty( - parameters: Parameters.GetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of a worklog property. Use this operation to store custom data against the worklog. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async setWorklogProperty(parameters: Parameters.SetWorklogProperty, callback?: never): Promise; - async setWorklogProperty( - parameters: Parameters.SetWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback: Callback, - ): Promise; - /** - * Deletes a worklog property. - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklogProperty(parameters: Parameters.DeleteWorklogProperty, callback?: never): Promise; - async deleteWorklogProperty( - parameters: Parameters.DeleteWorklogProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.worklogId}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issueWorklogs.mts b/src/version3/issueWorklogs.mts new file mode 100644 index 0000000000..73ebb37a2a --- /dev/null +++ b/src/version3/issueWorklogs.mts @@ -0,0 +1,498 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +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. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Workloads are only returned 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog, + 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. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Workloads are only returned 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog, + callback?: never, + ): Promise; + async getIssueWorklog( + parameters: Parameters.GetIssueWorklog, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + startedAfter: parameters.startedAfter, + startedBefore: parameters.startedBefore, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a worklog to an issue. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; + /** + * Adds a worklog to an issue. + * + * 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). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; + async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { + let comment: Models.Document | undefined; + + if (typeof parameters.comment === 'string') { + comment = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + type: 'text', + text: parameters.comment, + }, + ], + }, + ], + }; + } else { + comment = parameters.comment; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, + method: 'POST', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + reduceBy: parameters.reduceBy, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + self: parameters.self, + author: parameters.author, + updateAuthor: parameters.updateAuthor, + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a worklog. + * + * 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). + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; + /** + * Returns a worklog. + * + * 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). + * + * 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 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. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; + async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a worklog. + * + * 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). + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; + /** + * Updates a worklog. + * + * 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). + * + * 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 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. + * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit + * own worklogs_ to update worklogs created by the user. + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; + async updateWorklog( + parameters: Parameters.UpdateWorklog, + callback?: Callback, + ): Promise { + let comment: Models.Document | undefined; + + if (typeof parameters.comment === 'string') { + comment = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + type: 'text', + text: parameters.comment, + }, + ], + }, + ], + }; + } else { + comment = parameters.comment; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + expand: parameters.expand, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + comment, + visibility: parameters.visibility, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a worklog from an issue. + * + * 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). + * + * 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 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. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; + /** + * Deletes a worklog from an issue. + * + * 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). + * + * 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 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. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or + * _Delete own worklogs_ to delete worklogs created by the user, + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; + async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, + method: 'DELETE', + params: { + notifyUsers: parameters.notifyUsers, + adjustEstimate: parameters.adjustEstimate, + newEstimate: parameters.newEstimate, + increaseBy: parameters.increaseBy, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs deleted during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsDeletedSince( + parameters?: Parameters.GetIdsOfWorklogsDeletedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/worklog/deleted', + method: 'GET', + params: { + since: parameters?.since, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters: Parameters.GetWorklogsForIds | undefined, + callback: Callback, + ): Promise; + /** + * Returns worklog details for a list of worklog IDs. + * + * The returned list of worklogs is limited to 1000 items. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: never, + ): Promise; + async getWorklogsForIds( + parameters?: Parameters.GetWorklogsForIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/worklog/list', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ids: parameters?.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of IDs and update timestamps for worklogs updated after a date and time. + * + * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to + * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest + * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set + * to true on the last page of worklogs. + * + * This resource does not return worklogs updated during the minute preceding the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira, however, worklogs are only returned where either of the following is true: + * + * - The worklog is set as _Viewable by All Users_. + * - The user is a member of a project role or group with permission to view the worklog. + */ + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: never, + ): Promise; + async getIdsOfWorklogsModifiedSince( + parameters?: Parameters.GetIdsOfWorklogsModifiedSince, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/worklog/updated', + method: 'GET', + params: { + since: parameters?.since, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueWorklogs.ts b/src/version3/issueWorklogs.ts deleted file mode 100644 index 2b467b6c1e..0000000000 --- a/src/version3/issueWorklogs.ts +++ /dev/null @@ -1,498 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -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. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Workloads are only returned 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, - 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. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Workloads are only returned 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, - callback?: never, - ): Promise; - async getIssueWorklog( - parameters: Parameters.GetIssueWorklog, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - startedAfter: parameters.startedAfter, - startedBefore: parameters.startedBefore, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a worklog to an issue. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback: Callback): Promise; - /** - * Adds a worklog to an issue. - * - * 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). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Work on issues_ [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 addWorklog(parameters: Parameters.AddWorklog, callback?: never): Promise; - async addWorklog(parameters: Parameters.AddWorklog, callback?: Callback): Promise { - let comment: Models.Document | undefined; - - if (typeof parameters.comment === 'string') { - comment = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - type: 'text', - text: parameters.comment, - }, - ], - }, - ], - }; - } else { - comment = parameters.comment; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, - method: 'POST', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - reduceBy: parameters.reduceBy, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - self: parameters.self, - author: parameters.author, - updateAuthor: parameters.updateAuthor, - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a worklog. - * - * 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). - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback: Callback): Promise; - /** - * Returns a worklog. - * - * 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). - * - * 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 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. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async getWorklog(parameters: Parameters.GetWorklog, callback?: never): Promise; - async getWorklog(parameters: Parameters.GetWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a worklog. - * - * 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). - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback: Callback): Promise; - /** - * Updates a worklog. - * - * 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). - * - * 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 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. - * - _Edit all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or _Edit - * own worklogs_ to update worklogs created by the user. - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async updateWorklog(parameters: Parameters.UpdateWorklog, callback?: never): Promise; - async updateWorklog( - parameters: Parameters.UpdateWorklog, - callback?: Callback, - ): Promise { - let comment: Models.Document | undefined; - - if (typeof parameters.comment === 'string') { - comment = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - type: 'text', - text: parameters.comment, - }, - ], - }, - ], - }; - } else { - comment = parameters.comment; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - expand: parameters.expand, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - data: { - comment, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, - properties: parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a worklog from an issue. - * - * 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). - * - * 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 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. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback: Callback): Promise; - /** - * Deletes a worklog from an issue. - * - * 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). - * - * 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 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. - * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or - * _Delete own worklogs_ to delete worklogs created by the user, - * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. - */ - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: never): Promise; - async deleteWorklog(parameters: Parameters.DeleteWorklog, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/${parameters.id}`, - method: 'DELETE', - params: { - notifyUsers: parameters.notifyUsers, - adjustEstimate: parameters.adjustEstimate, - newEstimate: parameters.newEstimate, - increaseBy: parameters.increaseBy, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters: Parameters.GetIdsOfWorklogsDeletedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs deleted during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsDeletedSince( - parameters?: Parameters.GetIdsOfWorklogsDeletedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/worklog/deleted', - method: 'GET', - params: { - since: parameters?.since, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters: Parameters.GetWorklogsForIds | undefined, - callback: Callback, - ): Promise; - /** - * Returns worklog details for a list of worklog IDs. - * - * The returned list of worklogs is limited to 1000 items. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: never, - ): Promise; - async getWorklogsForIds( - parameters?: Parameters.GetWorklogsForIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/worklog/list', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ids: parameters?.ids, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters: Parameters.GetIdsOfWorklogsModifiedSince | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of IDs and update timestamps for worklogs updated after a date and time. - * - * This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to - * youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest - * item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set - * to true on the last page of worklogs. - * - * This resource does not return worklogs updated during the minute preceding the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira, however, worklogs are only returned where either of the following is true: - * - * - The worklog is set as _Viewable by All Users_. - * - The user is a member of a project role or group with permission to view the worklog. - */ - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: never, - ): Promise; - async getIdsOfWorklogsModifiedSince( - parameters?: Parameters.GetIdsOfWorklogsModifiedSince, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/worklog/updated', - method: 'GET', - params: { - since: parameters?.since, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/issues.mts b/src/version3/issues.mts new file mode 100644 index 0000000000..e2ea96e11e --- /dev/null +++ b/src/version3/issues.mts @@ -0,0 +1,1119 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Issues { + constructor(private client: Client) {} + + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback: Callback): Promise; + /** + * Returns all issue events. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getEvents(callback?: never): Promise; + async getEvents(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/events', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * In a next-gen project any issue may be made a child providing that the parent and child are members of the same + * project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; + /** + * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be + * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties + * set. + * + * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue + * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are + * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` must contain the ID or key of the parent issue. + * + * In a next-gen project any issue may be made a child providing that the parent and child are members of the same + * project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which the issue or subtask is created. + */ + async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; + async createIssue( + parameters: Parameters.CreateIssue, + callback?: Callback, + ): Promise { + if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + parameters.fields.description = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: parameters.fields.description, + type: 'text', + }, + ], + }, + ], + }; + } + + const config: RequestConfig = { + url: '/rest/api/3/issue', + method: 'POST', + params: { + updateHistory: parameters.updateHistory, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **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. + */ + 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) + * and [cancel + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * APIs to manage the request. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **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. + */ + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( + parameters: Parameters.ArchiveIssuesAsync, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/archive', + method: 'POST', + data: { + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback: Callback, + ): Promise; + /** + * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the + * issue(s) archived in the process and the errors encountered, if any. + * + * **Note that:** + * + * - You can't archive subtasks directly, only through their parent issues + * - You can only archive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; + async archiveIssues( + parameters: Parameters.ArchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/archive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues( + parameters: Parameters.CreateIssues | undefined, + callback: Callback, + ): Promise; + /** + * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may + * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue + * properties set. + * + * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the + * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These + * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any + * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom + * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. + * + * Creating a subtask differs from creating an issue as follows: + * + * - `issueType` must be set to a subtask issue type (use [ Get create issue + * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). + * - `parent` the must contain the ID or key of the parent issue. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in + * which each issue or subtask is created. + */ + async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; + async createIssues( + parameters?: Parameters.CreateIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/bulk', + method: 'POST', + data: { + issueUpdates: parameters?.issueUpdates, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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). + * + * 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). + * + * 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, + callback?: never, + ): Promise; + async getCreateIssueMeta( + parameters?: Parameters.GetCreateIssueMeta, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/createmeta', + method: 'GET', + params: { + projectIds: parameters?.projectIds, + projectKeys: parameters?.projectKeys, + issuetypeIds: parameters?.issuetypeIds, + issuetypeNames: parameters?.issuetypeNames, + expand: parameters?.expand, + }, + }; + + 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. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback: Callback, + ): Promise; + /** + * 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. + * + * **Note that:** + * + * - You can't unarchive subtasks directly, only through their parent issues + * - You can only unarchive issues from software, service management, and business projects + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + */ + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: never, + ): Promise; + async unarchiveIssues( + parameters: Parameters.UnarchiveIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/unarchive', + method: 'PUT', + data: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the details for an issue. + * + * The 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 issue key returned in the response is the key of the issue found. + * + * 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 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 getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; + /** + * Returns the details for an issue. + * + * The 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 issue key returned in the response is the key of the issue found. + * + * 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 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 getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; + async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, + method: 'GET', + params: { + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + expand: parameters.expand, + properties: parameters.properties, + updateHistory: parameters.updateHistory, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * 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). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom + * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) + * accept a string and don't handle Atlassian Document Format content. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; + /** + * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * + * 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). + * + * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting + * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom + * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) + * accept a string and don't handle Atlassian Document Format content. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security + * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; + async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { + if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + const { + fields: { description }, + } = await this.getIssue({ issueIdOrKey: parameters.issueIdOrKey }); + + parameters.fields.description = { + type: 'doc', + version: description?.version ?? 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: parameters.fields.description, + type: 'text', + }, + ], + }, + ], + }; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, + method: 'PUT', + params: { + notifyUsers: parameters.notifyUsers, + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + returnIssue: parameters.returnIssue, + expand: parameters.expand, + }, + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue, callback: Callback): Promise; + /** + * Deletes an issue. + * + * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. + * This causes the issue's subtasks to be deleted with the issue. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue, callback?: never): Promise; + async deleteIssue(parameters: Parameters.DeleteIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, + method: 'DELETE', + params: { + deleteSubtasks: parameters.deleteSubtasks, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; + /** + * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but + * has the _Assign issue_ permission for the project that the issue is in. + * + * If `name` or `accountId` is set to: + * + * - `"-1"`, the issue is assigned to the default assignee for the project. + * - `null`, the issue is set to unassigned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; + async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/assignee`, + method: 'PUT', + data: { + accountId: parameters.accountId, + accountType: parameters.accountType, + active: parameters.active, + applicationRoles: parameters.applicationRoles, + avatarUrls: parameters.avatarUrls, + displayName: parameters.displayName, + emailAddress: parameters.emailAddress, + expand: parameters.expand, + groups: parameters.groups, + key: parameters.key, + locale: parameters.locale, + name: parameters.name, + self: parameters.self, + timeZone: parameters.timeZone, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * 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 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 getChangeLogs( + parameters: Parameters.GetChangeLogs, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * changelogs for an issue sorted by date, starting from the oldest. + * + * 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 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 getChangeLogs(parameters: Parameters.GetChangeLogs, callback?: never): Promise; + async getChangeLogs( + parameters: Parameters.GetChangeLogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * 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 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 getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback: Callback, + ): Promise; + /** + * Returns changelogs for an issue specified by a list of changelog IDs. + * + * 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 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 getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: never, + ): Promise; + async getChangeLogsByIds( + parameters: Parameters.GetChangeLogsByIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog/list`, + method: 'POST', + data: { + changelogIds: parameters.changelogIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * 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 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. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta, + callback: Callback, + ): Promise; + /** + * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to + * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). + * + * This endpoint will check for these conditions: + * + * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type + * scheme configuration. `overrideScreenSecurity=true` skips this condition. + * 2. Field is visible in the [field + * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). + * `overrideScreenSecurity=true` skips this condition. + * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if + * attachments are enabled. Assignee only shows if user has permissions to assign the issue. + * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All + * system fields are assumed to have context in all projects and all issue types. + * 5. Issue has a project, issue type, and status defined. + * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. + * `overrideEditableFlag=true` skips this condition. + * 7. The current workflow step is editable. This is true by default, but [can be disabled by + * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the + * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. + * 8. User has [Edit issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). + * 9. Workflow permissions allow editing a field. This is true by default but [can be + * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using + * `jira.permission.*` workflow properties. + * + * Fields hidden using [Issue layout settings + * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain + * editable. + * + * Connect apps having an app user with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer + * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: + * + * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available + * through screens, and field configuration (conditions 1. and 2. from the list above). + * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if + * the current step is editable (conditions 6. and 7. from the list above). + * + * 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 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. + * + * Note: For any fields to be editable the user must have the _Edit issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + */ + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta, + callback?: never, + ): Promise; + async getEditIssueMeta( + parameters: Parameters.GetEditIssueMeta, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/editmeta`, + method: 'GET', + params: { + overrideScreenSecurity: parameters.overrideScreenSecurity, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[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 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 notify(parameters: Parameters.Notify, callback: Callback): Promise; + /** + * Creates an email notification for an issue and adds it to the mail queue. + * + * **[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 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 notify(parameters: Parameters.Notify, callback?: never): Promise; + async notify(parameters: Parameters.Notify, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/notify`, + method: 'POST', + data: { + htmlBody: parameters.htmlBody, + restrict: parameters.restrict, + subject: parameters.subject, + textBody: parameters.textBody, + to: parameters.to, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or + * transition is returned only when 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. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions( + parameters: Parameters.GetTransitions, + callback: Callback, + ): Promise; + /** + * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's + * status. + * + * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its + * status, the response will return any empty transitions list. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or + * transition is returned only when 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. + * + * However, if the user does not have the _Transition issues_ [ project + * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + */ + async getTransitions(parameters: Parameters.GetTransitions, callback?: never): Promise; + async getTransitions( + parameters: Parameters.GetTransitions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, + method: 'GET', + params: { + expand: parameters.expand, + transitionId: parameters.transitionId, + skipRemoteOnlyCondition: parameters.skipRemoteOnlyCondition, + includeUnavailableTransitions: parameters.includeUnavailableTransitions, + sortByOpsBarAndStatus: parameters.sortByOpsBarAndStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; + /** + * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. + * + * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` + * parameters in the request body. Get details about the fields using [ Get + * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; + async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { + if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + parameters.fields.description = { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [ + { + text: parameters.fields.description, + type: 'text', + }, + ], + }, + ], + }; + } + + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, + method: 'POST', + data: { + fields: parameters.fields, + historyMetadata: parameters.historyMetadata, + properties: parameters.properties, + transition: parameters.transition, + update: parameters.update, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters: Parameters.ExportArchivedIssues | undefined, + callback: Callback, + ): Promise; + /** + * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it + * will receive an email with a link to download a CSV file with the issue details. + * + * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and + * `ArchivedDate`). Custom fields aren't supported. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira + * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * **License required:** Premium or Enterprise + * + * **Signed-in users only:** This API can't be accessed anonymously. + * + * **Rate limiting:** Only a single request can be active at any given time. + */ + async exportArchivedIssues( + parameters?: Parameters.ExportArchivedIssues, + callback?: never, + ): Promise; + async exportArchivedIssues( + parameters?: Parameters.ExportArchivedIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issues/archive/export', + method: 'PUT', + data: { + archivedBy: parameters?.archivedBy, + archivedDateRange: parameters?.archivedDateRange, + issueTypes: parameters?.issueTypes, + projects: parameters?.projects, + reporters: parameters?.reporters, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issues.ts b/src/version3/issues.ts deleted file mode 100644 index d7a916b21d..0000000000 --- a/src/version3/issues.ts +++ /dev/null @@ -1,1119 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Issues { - constructor(private client: Client) {} - - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback: Callback): Promise; - /** - * Returns all issue events. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getEvents(callback?: never): Promise; - async getEvents(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/events', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * In a next-gen project any issue may be made a child providing that the parent and child are members of the same - * project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback: Callback): Promise; - /** - * Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be - * applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties - * set. - * - * The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue - * or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are - * the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` must contain the ID or key of the parent issue. - * - * In a next-gen project any issue may be made a child providing that the parent and child are members of the same - * project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which the issue or subtask is created. - */ - async createIssue(parameters: Parameters.CreateIssue, callback?: never): Promise; - async createIssue( - parameters: Parameters.CreateIssue, - callback?: Callback, - ): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { - parameters.fields.description = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: parameters.fields.description, - type: 'text', - }, - ], - }, - ], - }; - } - - const config: RequestConfig = { - url: '/rest/api/3/issue', - method: 'POST', - params: { - updateHistory: parameters.updateHistory, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **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. - */ - 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) - * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) - * APIs to manage the request. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **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. - */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/archive', - method: 'POST', - data: { - jql: parameters.jql, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback: Callback, - ): Promise; - /** - * Enables admins to archive up to 1000 issues in a single request using issue ID/key, returning details of the - * issue(s) archived in the process and the errors encountered, if any. - * - * **Note that:** - * - * - You can't archive subtasks directly, only through their parent issues - * - You can only archive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async archiveIssues(parameters: Parameters.ArchiveIssues, callback?: never): Promise; - async archiveIssues( - parameters: Parameters.ArchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/archive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues( - parameters: Parameters.CreateIssues | undefined, - callback: Callback, - ): Promise; - /** - * Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may - * be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue - * properties set. - * - * The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the - * issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These - * are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any - * `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom - * fields (`textfield`) accept a string and don't handle Atlassian Document Format content. - * - * Creating a subtask differs from creating an issue as follows: - * - * - `issueType` must be set to a subtask issue type (use [ Get create issue - * metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). - * - `parent` the must contain the ID or key of the parent issue. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ and _Create issues_ [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in - * which each issue or subtask is created. - */ - async createIssues(parameters?: Parameters.CreateIssues, callback?: never): Promise; - async createIssues( - parameters?: Parameters.CreateIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/bulk', - method: 'POST', - data: { - issueUpdates: parameters?.issueUpdates, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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). - * - * 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). - * - * 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, - callback?: never, - ): Promise; - async getCreateIssueMeta( - parameters?: Parameters.GetCreateIssueMeta, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/createmeta', - method: 'GET', - params: { - projectIds: parameters?.projectIds, - projectKeys: parameters?.projectKeys, - issuetypeIds: parameters?.issuetypeIds, - issuetypeNames: parameters?.issuetypeNames, - expand: parameters?.expand, - }, - }; - - 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. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback: Callback, - ): Promise; - /** - * 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. - * - * **Note that:** - * - * - You can't unarchive subtasks directly, only through their parent issues - * - You can only unarchive issues from software, service management, and business projects - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - */ - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: never, - ): Promise; - async unarchiveIssues( - parameters: Parameters.UnarchiveIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issue/unarchive', - method: 'PUT', - data: { - issueIdsOrKeys: parameters.issueIdsOrKeys, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the details for an issue. - * - * The 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 issue key returned in the response is the key of the issue found. - * - * 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 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 getIssue(parameters: Parameters.GetIssue, callback: Callback): Promise; - /** - * Returns the details for an issue. - * - * The 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 issue key returned in the response is the key of the issue found. - * - * 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 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 getIssue(parameters: Parameters.GetIssue, callback?: never): Promise; - async getIssue(parameters: Parameters.GetIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, - method: 'GET', - params: { - fields: parameters.fields, - fieldsByKeys: parameters.fieldsByKeys, - expand: parameters.expand, - properties: parameters.properties, - updateHistory: parameters.updateHistory, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * 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). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom - * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) - * accept a string and don't handle Atlassian Document Format content. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; - /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. - * - * 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). - * - * The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting - * `update.parent.set.none` to _true_. Note that the `description`, `environment`, and any `textarea` type custom - * fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) - * accept a string and don't handle Atlassian Document Format content. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security - * configuration using `overrideScreenSecurity` and `overrideEditableFlag`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Edit issues_ [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 editIssue(parameters: Parameters.EditIssue, callback?: never): Promise; - async editIssue(parameters: Parameters.EditIssue, callback?: Callback): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { - const { - fields: { description }, - } = await this.getIssue({ issueIdOrKey: parameters.issueIdOrKey }); - - parameters.fields.description = { - type: 'doc', - version: description?.version ?? 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: parameters.fields.description, - type: 'text', - }, - ], - }, - ], - }; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, - method: 'PUT', - params: { - notifyUsers: parameters.notifyUsers, - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - returnIssue: parameters.returnIssue, - expand: parameters.expand, - }, - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue, callback: Callback): Promise; - /** - * Deletes an issue. - * - * An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. - * This causes the issue's subtasks to be deleted with the issue. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Delete issues_ [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 deleteIssue(parameters: Parameters.DeleteIssue, callback?: never): Promise; - async deleteIssue(parameters: Parameters.DeleteIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}`, - method: 'DELETE', - params: { - deleteSubtasks: parameters.deleteSubtasks, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback: Callback): Promise; - /** - * Assigns an issue to a user. Use this operation when the calling user does not have the _Edit Issues_ permission but - * has the _Assign issue_ permission for the project that the issue is in. - * - * If `name` or `accountId` is set to: - * - * - `"-1"`, the issue is assigned to the default assignee for the project. - * - `null`, the issue is set to unassigned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse Projects_ and _Assign Issues_ [ 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 assignIssue(parameters: Parameters.AssignIssue, callback?: never): Promise; - async assignIssue(parameters: Parameters.AssignIssue, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/assignee`, - method: 'PUT', - data: { - accountId: parameters.accountId, - accountType: parameters.accountType, - active: parameters.active, - applicationRoles: parameters.applicationRoles, - avatarUrls: parameters.avatarUrls, - displayName: parameters.displayName, - emailAddress: parameters.emailAddress, - expand: parameters.expand, - groups: parameters.groups, - key: parameters.key, - locale: parameters.locale, - name: parameters.name, - self: parameters.self, - timeZone: parameters.timeZone, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * 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 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 getChangeLogs( - parameters: Parameters.GetChangeLogs, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * changelogs for an issue sorted by date, starting from the oldest. - * - * 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 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 getChangeLogs(parameters: Parameters.GetChangeLogs, callback?: never): Promise; - async getChangeLogs( - parameters: Parameters.GetChangeLogs, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * 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 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 getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback: Callback, - ): Promise; - /** - * Returns changelogs for an issue specified by a list of changelog IDs. - * - * 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 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 getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: never, - ): Promise; - async getChangeLogsByIds( - parameters: Parameters.GetChangeLogsByIds, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/changelog/list`, - method: 'POST', - data: { - changelogIds: parameters.changelogIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * 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 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. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, - callback: Callback, - ): Promise; - /** - * Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to - * populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). - * - * This endpoint will check for these conditions: - * - * 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type - * scheme configuration. `overrideScreenSecurity=true` skips this condition. - * 2. Field is visible in the [field - * configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). - * `overrideScreenSecurity=true` skips this condition. - * 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if - * attachments are enabled. Assignee only shows if user has permissions to assign the issue. - * 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All - * system fields are assumed to have context in all projects and all issue types. - * 5. Issue has a project, issue type, and status defined. - * 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. - * `overrideEditableFlag=true` skips this condition. - * 7. The current workflow step is editable. This is true by default, but [can be disabled by - * setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the - * `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. - * 8. User has [Edit issues - * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). - * 9. Workflow permissions allow editing a field. This is true by default but [can be - * modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using - * `jira.permission.*` workflow properties. - * - * Fields hidden using [Issue layout settings - * page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain - * editable. - * - * Connect apps having an app user with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with _Administer - * Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: - * - * - `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available - * through screens, and field configuration (conditions 1. and 2. from the list above). - * - `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if - * the current step is editable (conditions 6. and 7. from the list above). - * - * 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 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. - * - * Note: For any fields to be editable the user must have the _Edit issues_ [project - * permission](https://confluence.atlassian.com/x/yodKLg) for the issue. - */ - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, - callback?: never, - ): Promise; - async getEditIssueMeta( - parameters: Parameters.GetEditIssueMeta, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/editmeta`, - method: 'GET', - params: { - overrideScreenSecurity: parameters.overrideScreenSecurity, - overrideEditableFlag: parameters.overrideEditableFlag, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[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 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 notify(parameters: Parameters.Notify, callback: Callback): Promise; - /** - * Creates an email notification for an issue and adds it to the mail queue. - * - * **[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 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 notify(parameters: Parameters.Notify, callback?: never): Promise; - async notify(parameters: Parameters.Notify, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/notify`, - method: 'POST', - data: { - htmlBody: parameters.htmlBody, - restrict: parameters.restrict, - subject: parameters.subject, - textBody: parameters.textBody, - to: parameters.to, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or - * transition is returned only when 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. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions( - parameters: Parameters.GetTransitions, - callback: Callback, - ): Promise; - /** - * Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's - * status. - * - * Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its - * status, the response will return any empty transitions list. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: A list or - * transition is returned only when 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. - * - * However, if the user does not have the _Transition issues_ [ project - * permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. - */ - async getTransitions(parameters: Parameters.GetTransitions, callback?: never): Promise; - async getTransitions( - parameters: Parameters.GetTransitions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, - method: 'GET', - params: { - expand: parameters.expand, - transitionId: parameters.transitionId, - skipRemoteOnlyCondition: parameters.skipRemoteOnlyCondition, - includeUnavailableTransitions: parameters.includeUnavailableTransitions, - sortByOpsBarAndStatus: parameters.sortByOpsBarAndStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback: Callback): Promise; - /** - * Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. - * - * SortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` - * parameters in the request body. Get details about the fields using [ Get - * transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Browse projects_ and _Transition issues_ [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 doTransition(parameters: Parameters.DoTransition, callback?: never): Promise; - async doTransition(parameters: Parameters.DoTransition, callback?: Callback): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { - parameters.fields.description = { - type: 'doc', - version: 1, - content: [ - { - type: 'paragraph', - content: [ - { - text: parameters.fields.description, - type: 'text', - }, - ], - }, - ], - }; - } - - const config: RequestConfig = { - url: `/rest/api/3/issue/${parameters.issueIdOrKey}/transitions`, - method: 'POST', - data: { - fields: parameters.fields, - historyMetadata: parameters.historyMetadata, - properties: parameters.properties, - transition: parameters.transition, - update: parameters.update, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters: Parameters.ExportArchivedIssues | undefined, - callback: Callback, - ): Promise; - /** - * Enables admins to retrieve details of all archived issues. Upon a successful request, the admin who submitted it - * will receive an email with a link to download a CSV file with the issue details. - * - * Note that this API only exports the values of system fields and archival-specific fields (`ArchivedBy` and - * `ArchivedDate`). Custom fields aren't supported. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Jira - * admin or site admin: [global permission](https://confluence.atlassian.com/x/x4dKLg) - * - * **License required:** Premium or Enterprise - * - * **Signed-in users only:** This API can't be accessed anonymously. - * - * **Rate limiting:** Only a single request can be active at any given time. - */ - async exportArchivedIssues( - parameters?: Parameters.ExportArchivedIssues, - callback?: never, - ): Promise; - async exportArchivedIssues( - parameters?: Parameters.ExportArchivedIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/issues/archive/export', - method: 'PUT', - data: { - archivedBy: parameters?.archivedBy, - archivedDateRange: parameters?.archivedDateRange, - issueTypes: parameters?.issueTypes, - projects: parameters?.projects, - reporters: parameters?.reporters, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jQL.ts b/src/version3/jQL.ts deleted file mode 100644 index e630da739d..0000000000 --- a/src/version3/jQL.ts +++ /dev/null @@ -1,312 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JQL { - constructor(private client: Client) {} - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoComplete(callback: Callback): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference - * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoComplete(callback?: never): Promise; - async getAutoComplete(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/autocompletedata', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters: Parameters.GetAutoCompletePost | undefined, - callback: Callback, - ): Promise; - /** - * Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions - * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this - * information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom - * query builder. - * - * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. - * System fields are always returned. - * - * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across - * all fields with the same name and of the same field type. For example, the collapsed field `Component - - * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched - * simultaneously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: never, - ): Promise; - async getAutoCompletePost( - parameters?: Parameters.GetAutoCompletePost, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/autocompletedata', - method: 'POST', - data: { - projectIds: parameters?.projectIds, - includeCollapsedFields: parameters?.includeCollapsedFields, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, - callback: Callback, - ): Promise; - /** - * Returns the JQL search auto complete suggestions for a field. - * - * Suggestions can be obtained by providing: - * - * - `fieldName` to get a list of all values for the field. - * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. - * - `fieldName` and `predicateName` to get a list of all predicate values for the field. - * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in - * `predicateValue`. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: never, - ): Promise; - async getFieldAutoCompleteForQueryString( - parameters?: Parameters.GetFieldAutoCompleteForQueryString, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/autocompletedata/suggestions', - method: 'GET', - params: { - fieldName: parameters?.fieldName, - fieldValue: parameters?.fieldValue, - predicateName: parameters?.predicateName, - predicateValue: parameters?.predicateValue, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters: Parameters.ParseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Parses and validates JQL queries. - * - * Validation is performed in context of the current user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: never, - ): Promise; - async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/parse', - method: 'POST', - params: { - validation: parameters?.validation, - }, - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters: Parameters.MigrateQueries | undefined, - callback: Callback, - ): Promise; - /** - * Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with - * account IDs. - * - * You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For - * more information about GDPR-related changes, see the [migration - * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: never, - ): Promise; - async migrateQueries( - parameters?: Parameters.MigrateQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/pdcleaner', - method: 'POST', - data: { - queryStrings: parameters?.queryStrings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * 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). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters: Parameters.SanitiseJqlQueries | undefined, - callback: Callback, - ): Promise; - /** - * Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to - * view the entity. - * - * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse - * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where - * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account - * ID is null, sanitizing is performed for an anonymous user. - * - * 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). - * - * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: never, - ): Promise; - async sanitiseJqlQueries( - parameters?: Parameters.SanitiseJqlQueries, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/sanitize', - method: 'POST', - data: { - queries: parameters?.queries, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jiraExpressions.mts b/src/version3/jiraExpressions.mts new file mode 100644 index 0000000000..032567299e --- /dev/null +++ b/src/version3/jiraExpressions.mts @@ -0,0 +1,193 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraExpressions { + constructor(private client: Client) {} + + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters: Parameters.AnalyseExpression | undefined, + callback: Callback, + ): Promise; + /** + * Analyses and validates Jira expressions. + * + * As an experimental feature, this operation can also attempt to type-check the expressions. + * + * Learn more about Jira expressions in the + * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + */ + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: never, + ): Promise; + async analyseExpression( + parameters?: Parameters.AnalyseExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/expression/analyse', + method: 'POST', + params: { + check: parameters?.check, + }, + data: { + expressions: parameters?.expressions, + contextVariables: parameters?.contextVariables, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Evaluates a Jira expression and returns its value. + * + * 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. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. 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. + * + * 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 evaluateJiraExpression( + parameters: Parameters.EvaluateJiraExpression | undefined, + callback: Callback, + ): Promise; + /** + * Evaluates a Jira expression and returns its value. + * + * 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. + * + * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by + * key in the Jira expression. 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. + * + * 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 evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: never, + ): Promise; + async evaluateJiraExpression( + parameters?: Parameters.EvaluateJiraExpression, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/expression/eval', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + expression: parameters?.expression, + context: parameters?.context, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jiraExpressions.ts b/src/version3/jiraExpressions.ts deleted file mode 100644 index 934f92417f..0000000000 --- a/src/version3/jiraExpressions.ts +++ /dev/null @@ -1,193 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JiraExpressions { - constructor(private client: Client) {} - - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters: Parameters.AnalyseExpression | undefined, - callback: Callback, - ): Promise; - /** - * Analyses and validates Jira expressions. - * - * As an experimental feature, this operation can also attempt to type-check the expressions. - * - * Learn more about Jira expressions in the - * [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. - */ - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: never, - ): Promise; - async analyseExpression( - parameters?: Parameters.AnalyseExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/expression/analyse', - method: 'POST', - params: { - check: parameters?.check, - }, - data: { - expressions: parameters?.expressions, - contextVariables: parameters?.contextVariables, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Evaluates a Jira expression and returns its value. - * - * 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. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. 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. - * - * 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 evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, - callback: Callback, - ): Promise; - /** - * Evaluates a Jira expression and returns its value. - * - * 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. - * - * Also, custom context variables can be passed in the request with their types. Those variables can be accessed by - * key in the Jira expression. 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. - * - * 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 evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: never, - ): Promise; - async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/expression/eval', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - expression: parameters?.expression, - context: parameters?.context, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jiraSettings.mts b/src/version3/jiraSettings.mts new file mode 100644 index 0000000000..fef1c5704f --- /dev/null +++ b/src/version3/jiraSettings.mts @@ -0,0 +1,241 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JiraSettings { + constructor(private client: Client) {} + + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters: Parameters.GetApplicationProperty | undefined, + callback: Callback, + ): Promise; + /** + * Returns all application properties or an application property. + * + * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an + * array). Otherwise, an array of all editable application properties is returned. See [Set application + * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: never, + ): Promise; + async getApplicationProperty( + parameters?: Parameters.GetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/application-properties', + method: 'GET', + params: { + key: parameters?.key, + permissionLevel: parameters?.permissionLevel, + keyFilter: parameters?.keyFilter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback: Callback): Promise; + /** + * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the + * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** + * and then click **Advanced Settings** (in the upper right). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAdvancedSettings(callback?: never): Promise; + async getAdvancedSettings(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/application-properties/advanced-settings', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * 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` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback: Callback, + ): Promise; + /** + * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from + * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are + * described below along with their default values. + * + * #### Advanced settings + * + * 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` | + * + * #### Look and feel + * + * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). + * + * | Key | Description | Default value | + * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | + * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | + * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | + * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | + * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | + * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | + * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | + * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | + * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | + * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | + * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | + * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | + * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | + * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | + * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | + * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | + * + * #### Other settings + * + * | Key | Description | Default value | + * | ----------------------------------- | ----------------------------------------------------- | ------------- | + * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | + * + * _Note: Be careful when changing [application properties and advanced + * settings](https://confluence.atlassian.com/x/vYXKM)._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: never, + ): Promise; + async setApplicationProperty( + parameters: Parameters.SetApplicationProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/application-properties/${parameters.id}`, + method: 'PUT', + data: parameters.body, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback: Callback): Promise; + /** + * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether + * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this + * operation also returns the time tracking configuration. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getConfiguration(callback?: never): Promise; + async getConfiguration(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jiraSettings.ts b/src/version3/jiraSettings.ts deleted file mode 100644 index 530adff118..0000000000 --- a/src/version3/jiraSettings.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JiraSettings { - constructor(private client: Client) {} - - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters: Parameters.GetApplicationProperty | undefined, - callback: Callback, - ): Promise; - /** - * Returns all application properties or an application property. - * - * If you specify a value for the `key` parameter, then an application property is returned as an object (not in an - * array). Otherwise, an array of all editable application properties is returned. See [Set application - * property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: never, - ): Promise; - async getApplicationProperty( - parameters?: Parameters.GetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/application-properties', - method: 'GET', - params: { - key: parameters?.key, - permissionLevel: parameters?.permissionLevel, - keyFilter: parameters?.keyFilter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback: Callback): Promise; - /** - * Returns the application properties that are accessible on the _Advanced Settings_ page. To navigate to the - * _Advanced Settings_ page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** - * and then click **Advanced Settings** (in the upper right). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAdvancedSettings(callback?: never): Promise; - async getAdvancedSettings(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/application-properties/advanced-settings', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * 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` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback: Callback, - ): Promise; - /** - * Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from - * its default value of _CLONE -_ to _Clone -_ if you prefer sentence case capitalization. Editable properties are - * described below along with their default values. - * - * #### Advanced settings - * - * 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` | - * - * #### Look and feel - * - * The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). - * - * | Key | Description | Default value | - * | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ---------------------------- | - * | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | - * | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | - * | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | - * | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | - * | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | - * | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | - * | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | - * | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | - * | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | - * | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | - * | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | - * | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | - * | `jira.title` | The text for the application title. The application title can also be set in _General settings_. | `Jira` | - * | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | - * | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | - * - * #### Other settings - * - * | Key | Description | Default value | - * | ----------------------------------- | ----------------------------------------------------- | ------------- | - * | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | - * - * _Note: Be careful when changing [application properties and advanced - * settings](https://confluence.atlassian.com/x/vYXKM)._ - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: never, - ): Promise; - async setApplicationProperty( - parameters: Parameters.SetApplicationProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/application-properties/${parameters.id}`, - method: 'PUT', - data: parameters.body, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback: Callback): Promise; - /** - * Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether - * optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this - * operation also returns the time tracking configuration. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getConfiguration(callback?: never): Promise; - async getConfiguration(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/jql.mts b/src/version3/jql.mts new file mode 100644 index 0000000000..f7a491ccfc --- /dev/null +++ b/src/version3/jql.mts @@ -0,0 +1,312 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JQL { + constructor(private client: Client) {} + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoComplete(callback: Callback): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * To filter visible field details by project or collapse non-unique fields by field type then [Get field reference + * data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoComplete(callback?: never): Promise; + async getAutoComplete(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/autocompletedata', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters: Parameters.GetAutoCompletePost | undefined, + callback: Callback, + ): Promise; + /** + * Returns reference data for Jql searches. This is a downloadable version of the documentation provided in [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions + * reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of Jql-reserved words. Use this + * information to assist with the programmatic creation of Jql queries or the validation of queries built in a custom + * query builder. + * + * This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. + * System fields are always returned. + * + * It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across + * all fields with the same name and of the same field type. For example, the collapsed field `Component - + * Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched + * simultaneously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: never, + ): Promise; + async getAutoCompletePost( + parameters?: Parameters.GetAutoCompletePost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/autocompletedata', + method: 'POST', + data: { + projectIds: parameters?.projectIds, + includeCollapsedFields: parameters?.includeCollapsedFields, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters: Parameters.GetFieldAutoCompleteForQueryString | undefined, + callback: Callback, + ): Promise; + /** + * Returns the Jql search auto complete suggestions for a field. + * + * Suggestions can be obtained by providing: + * + * - `fieldName` to get a list of all values for the field. + * - `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. + * - `fieldName` and `predicateName` to get a list of all predicate values for the field. + * - `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in + * `predicateValue`. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: never, + ): Promise; + async getFieldAutoCompleteForQueryString( + parameters?: Parameters.GetFieldAutoCompleteForQueryString, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/autocompletedata/suggestions', + method: 'GET', + params: { + fieldName: parameters?.fieldName, + fieldValue: parameters?.fieldValue, + predicateName: parameters?.predicateName, + predicateValue: parameters?.predicateValue, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters: Parameters.ParseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Parses and validates Jql queries. + * + * Validation is performed in context of the current user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: never, + ): Promise; + async parseJqlQueries( + parameters?: Parameters.ParseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/parse', + method: 'POST', + params: { + validation: parameters?.validation, + }, + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters: Parameters.MigrateQueries | undefined, + callback: Callback, + ): Promise; + /** + * Converts one or more Jql queries with user identifiers (username or user key) to equivalent Jql queries with + * account IDs. + * + * You may wish to use this operation if your system stores Jql queries and you want to make them GDPR-compliant. For + * more information about GDPR-related changes, see the [migration + * guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: never, + ): Promise; + async migrateQueries( + parameters?: Parameters.MigrateQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/pdcleaner', + method: 'POST', + data: { + queryStrings: parameters?.queryStrings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * 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). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters: Parameters.SanitiseJqlQueries | undefined, + callback: Callback, + ): Promise; + /** + * Sanitizes one or more Jql queries by converting readable details into IDs where a user doesn't have permission to + * view the entity. + * + * For example, if the query contains the clause _project = 'Secret project'_, and a user does not have browse + * permission for the project "Secret project", the sanitized query replaces the clause with _project = 12345"_ (where + * 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account + * ID is null, sanitizing is performed for an anonymous user. + * + * 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). + * + * Before sanitization each Jql query is parsed. The queries are returned in the same order that they were passed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: never, + ): Promise; + async sanitiseJqlQueries( + parameters?: Parameters.SanitiseJqlQueries, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/sanitize', + method: 'POST', + data: { + queries: parameters?.queries, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jqlFunctionsApps.mts b/src/version3/jqlFunctionsApps.mts new file mode 100644 index 0000000000..7fd01e2048 --- /dev/null +++ b/src/version3/jqlFunctionsApps.mts @@ -0,0 +1,82 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class JqlFunctionsApps { + constructor(private client: Client) {} + + /** + * Returns the list of a function's precomputations 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. + */ + async getPrecomputations( + parameters: Parameters.GetPrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of a function's precomputations 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. + */ + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: never, + ): Promise; + async getPrecomputations( + parameters?: Parameters.GetPrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/function/computation', + method: 'GET', + params: { + functionKey: parameters?.functionKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + filter: parameters?.filter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations( + parameters: Parameters.UpdatePrecomputations | undefined, + callback: Callback, + ): Promise; + /** + * Update the precomputation value of a function created by a Forge/Connect app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API + * for apps to update their own precomputations. + */ + async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations( + parameters?: Parameters.UpdatePrecomputations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/function/computation', + method: 'POST', + data: { + values: parameters?.values, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/jqlFunctionsApps.ts b/src/version3/jqlFunctionsApps.ts deleted file mode 100644 index d45dcf0020..0000000000 --- a/src/version3/jqlFunctionsApps.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class JqlFunctionsApps { - constructor(private client: Client) {} - - /** - * Returns the list of a function's precomputations 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. - */ - async getPrecomputations( - parameters: Parameters.GetPrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Returns the list of a function's precomputations 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. - */ - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: never, - ): Promise; - async getPrecomputations( - parameters?: Parameters.GetPrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/function/computation', - method: 'GET', - params: { - functionKey: parameters?.functionKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - filter: parameters?.filter, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, - callback: Callback, - ): Promise; - /** - * Update the precomputation value of a function created by a Forge/Connect app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API - * for apps to update their own precomputations. - */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; - async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/jql/function/computation', - method: 'POST', - data: { - values: parameters?.values, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/labels.mts b/src/version3/labels.mts new file mode 100644 index 0000000000..598a05a0c8 --- /dev/null +++ b/src/version3/labels.mts @@ -0,0 +1,38 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Labels { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * labels. + */ + async getAllLabels( + parameters: Parameters.GetAllLabels | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * labels. + */ + async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; + async getAllLabels( + parameters?: Parameters.GetAllLabels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/label', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/labels.ts b/src/version3/labels.ts deleted file mode 100644 index d05b19261f..0000000000 --- a/src/version3/labels.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Labels { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * labels. - */ - async getAllLabels( - parameters: Parameters.GetAllLabels | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * labels. - */ - async getAllLabels(parameters?: Parameters.GetAllLabels, callback?: never): Promise; - async getAllLabels( - parameters?: Parameters.GetAllLabels, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/label', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/licenseMetrics.mts b/src/version3/licenseMetrics.mts new file mode 100644 index 0000000000..0f6a178b8a --- /dev/null +++ b/src/version3/licenseMetrics.mts @@ -0,0 +1,88 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class LicenseMetrics { + constructor(private client: Client) {} + + /** + * Returns licensing information about the Jira instance. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + 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. + */ + async getLicense(callback?: never): Promise; + async getLicense(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/instance/license', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback: Callback): Promise; + /** + * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with + * a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateLicenseCount(callback?: never): Promise; + async getApproximateLicenseCount(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/license/approximateLicenseCount', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback: Callback, + ): Promise; + /** + * Returns the total approximate number of user accounts for a single Jira license. Note that this information is + * cached with a 7-day lifecycle and could be stale at the time of call. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: never, + ): Promise; + async getApproximateApplicationLicenseCount( + applicationKey: string, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/license/approximateLicenseCount/product/${applicationKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/licenseMetrics.ts b/src/version3/licenseMetrics.ts deleted file mode 100644 index 4cd2204fac..0000000000 --- a/src/version3/licenseMetrics.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class LicenseMetrics { - constructor(private client: Client) {} - - /** - * Returns licensing information about the Jira instance. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - 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. - */ - async getLicense(callback?: never): Promise; - async getLicense(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/instance/license', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback: Callback): Promise; - /** - * Returns the approximate number of user accounts across all Jira licenses. Note that this information is cached with - * a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateLicenseCount(callback?: never): Promise; - async getApproximateLicenseCount(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/license/approximateLicenseCount', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback: Callback, - ): Promise; - /** - * Returns the total approximate number of user accounts for a single Jira license. Note that this information is - * cached with a 7-day lifecycle and could be stale at the time of call. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: never, - ): Promise; - async getApproximateApplicationLicenseCount( - applicationKey: string, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/license/approximateLicenseCount/product/${applicationKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/models/actorInput.ts b/src/version3/models/actorInput.mts similarity index 100% rename from src/version3/models/actorInput.ts rename to src/version3/models/actorInput.mts diff --git a/src/version3/models/actorsMap.ts b/src/version3/models/actorsMap.mts similarity index 100% rename from src/version3/models/actorsMap.ts rename to src/version3/models/actorsMap.mts diff --git a/src/version3/models/addField.ts b/src/version3/models/addField.mts similarity index 100% rename from src/version3/models/addField.ts rename to src/version3/models/addField.mts diff --git a/src/version3/models/addGroup.ts b/src/version3/models/addGroup.mts similarity index 100% rename from src/version3/models/addGroup.ts rename to src/version3/models/addGroup.mts diff --git a/src/version3/models/addSecuritySchemeLevelsRequest.mts b/src/version3/models/addSecuritySchemeLevelsRequest.mts new file mode 100644 index 0000000000..7d3c515ac9 --- /dev/null +++ b/src/version3/models/addSecuritySchemeLevelsRequest.mts @@ -0,0 +1,6 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +export interface AddSecuritySchemeLevelsRequest { + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevel[]; +} diff --git a/src/version3/models/addSecuritySchemeLevelsRequest.ts b/src/version3/models/addSecuritySchemeLevelsRequest.ts deleted file mode 100644 index 5111d85cdd..0000000000 --- a/src/version3/models/addSecuritySchemeLevelsRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SecuritySchemeLevel } from './securitySchemeLevel'; - -export interface AddSecuritySchemeLevelsRequest { - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; -} diff --git a/src/version3/models/announcementBannerConfiguration.ts b/src/version3/models/announcementBannerConfiguration.mts similarity index 100% rename from src/version3/models/announcementBannerConfiguration.ts rename to src/version3/models/announcementBannerConfiguration.mts diff --git a/src/version3/models/announcementBannerConfigurationUpdate.ts b/src/version3/models/announcementBannerConfigurationUpdate.mts similarity index 100% rename from src/version3/models/announcementBannerConfigurationUpdate.ts rename to src/version3/models/announcementBannerConfigurationUpdate.mts diff --git a/src/version3/models/application.ts b/src/version3/models/application.mts similarity index 100% rename from src/version3/models/application.ts rename to src/version3/models/application.mts diff --git a/src/version3/models/applicationProperty.ts b/src/version3/models/applicationProperty.mts similarity index 100% rename from src/version3/models/applicationProperty.ts rename to src/version3/models/applicationProperty.mts diff --git a/src/version3/models/applicationRole.mts b/src/version3/models/applicationRole.mts new file mode 100644 index 0000000000..48ea67c92d --- /dev/null +++ b/src/version3/models/applicationRole.mts @@ -0,0 +1,36 @@ +import type { GroupName } from './groupName.mjs'; + +/** Details of an application role. */ +export interface ApplicationRole { + /** The key of the application role. */ + key?: string; + /** + * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended + * to identify a groups. + */ + groups?: string[]; + /** The groups associated with the application role. */ + groupDetails?: GroupName[]; + /** The display name of the application role. */ + name?: string; + /** + * The groups that are granted default access for this application role. As a group's name can change, use of + * `defaultGroupsDetails` is recommended to identify a groups. + */ + defaultGroups?: string[]; + /** The groups that are granted default access for this application role. */ + defaultGroupsDetails?: GroupName[]; + /** Determines whether this application role should be selected by default on user creation. */ + selectedByDefault?: boolean; + /** The maximum count of users on your license. */ + numberOfSeats?: number; + /** The count of users remaining on your license. */ + remainingSeats?: number; + /** The number of users counting against your license. */ + userCount?: number; + /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ + userCountDescription?: string; + hasUnlimitedSeats?: boolean; + /** Indicates if the application role belongs to Jira platform (`jira-core`). */ + platform?: boolean; +} diff --git a/src/version3/models/applicationRole.ts b/src/version3/models/applicationRole.ts deleted file mode 100644 index ebdbb7cc4f..0000000000 --- a/src/version3/models/applicationRole.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { GroupName } from './groupName'; - -/** Details of an application role. */ -export interface ApplicationRole { - /** The key of the application role. */ - key?: string; - /** - * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended - * to identify a groups. - */ - groups?: string[]; - /** The groups associated with the application role. */ - groupDetails?: GroupName[]; - /** The display name of the application role. */ - name?: string; - /** - * The groups that are granted default access for this application role. As a group's name can change, use of - * `defaultGroupsDetails` is recommended to identify a groups. - */ - defaultGroups?: string[]; - /** The groups that are granted default access for this application role. */ - defaultGroupsDetails?: GroupName[]; - /** Determines whether this application role should be selected by default on user creation. */ - selectedByDefault?: boolean; - /** The maximum count of users on your license. */ - numberOfSeats?: number; - /** The count of users remaining on your license. */ - remainingSeats?: number; - /** The number of users counting against your license. */ - userCount?: number; - /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ - userCountDescription?: string; - hasUnlimitedSeats?: boolean; - /** Indicates if the application role belongs to Jira platform (`jira-core`). */ - platform?: boolean; -} diff --git a/src/version3/models/archiveIssueAsyncRequest.ts b/src/version3/models/archiveIssueAsyncRequest.mts similarity index 100% rename from src/version3/models/archiveIssueAsyncRequest.ts rename to src/version3/models/archiveIssueAsyncRequest.mts diff --git a/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts b/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts new file mode 100644 index 0000000000..f829c744b7 --- /dev/null +++ b/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping.mjs'; + +/** Details of a field configuration to issue type mappings. */ +export interface AssociateFieldConfigurationsWithIssueTypesRequest { + /** Field configuration to issue type mappings. */ + mappings: FieldConfigurationToIssueTypeMapping[]; +} diff --git a/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts b/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts deleted file mode 100644 index 61cd83082a..0000000000 --- a/src/version3/models/associateFieldConfigurationsWithIssueTypesRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { FieldConfigurationToIssueTypeMapping } from './fieldConfigurationToIssueTypeMapping'; - -/** Details of a field configuration to issue type mappings. */ -export interface AssociateFieldConfigurationsWithIssueTypesRequest { - /** Field configuration to issue type mappings. */ - mappings: FieldConfigurationToIssueTypeMapping[]; -} diff --git a/src/version3/models/associatedItem.ts b/src/version3/models/associatedItem.mts similarity index 100% rename from src/version3/models/associatedItem.ts rename to src/version3/models/associatedItem.mts diff --git a/src/version3/models/attachment.mts b/src/version3/models/attachment.mts new file mode 100644 index 0000000000..a7601a44c6 --- /dev/null +++ b/src/version3/models/attachment.mts @@ -0,0 +1,22 @@ +import { UserDetails } from './userDetails.mjs'; + +/** Details about an attachment. */ +export interface Attachment { + /** The URL of the attachment details response. */ + self?: string; + /** The ID of the attachment. */ + id: string; + /** The file name of the attachment. */ + filename?: string; + author?: UserDetails; + /** The datetime the attachment was created. */ + created?: string; + /** The size of the attachment. */ + size?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** The content of the attachment. */ + content?: string; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; +} diff --git a/src/version3/models/attachment.ts b/src/version3/models/attachment.ts deleted file mode 100644 index c646b9a48b..0000000000 --- a/src/version3/models/attachment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** Details about an attachment. */ -export interface Attachment { - /** The URL of the attachment details response. */ - self?: string; - /** The ID of the attachment. */ - id: string; - /** The file name of the attachment. */ - filename?: string; - author?: UserDetails; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** The content of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; -} diff --git a/src/version3/models/attachmentArchiveEntry.ts b/src/version3/models/attachmentArchiveEntry.mts similarity index 100% rename from src/version3/models/attachmentArchiveEntry.ts rename to src/version3/models/attachmentArchiveEntry.mts diff --git a/src/version3/models/attachmentArchiveImpl.mts b/src/version3/models/attachmentArchiveImpl.mts new file mode 100644 index 0000000000..05d3d8c9b3 --- /dev/null +++ b/src/version3/models/attachmentArchiveImpl.mts @@ -0,0 +1,8 @@ +import { AttachmentArchiveEntry } from './attachmentArchiveEntry.mjs'; + +export interface AttachmentArchiveImpl { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveEntry[]; + /** The number of items in the archive. */ + totalEntryCount?: number; +} diff --git a/src/version3/models/attachmentArchiveImpl.ts b/src/version3/models/attachmentArchiveImpl.ts deleted file mode 100644 index 9af03cd0f7..0000000000 --- a/src/version3/models/attachmentArchiveImpl.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AttachmentArchiveEntry } from './attachmentArchiveEntry'; - -export interface AttachmentArchiveImpl { - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveEntry[]; - /** The number of items in the archive. */ - totalEntryCount?: number; -} diff --git a/src/version3/models/attachmentArchiveItemReadable.ts b/src/version3/models/attachmentArchiveItemReadable.mts similarity index 100% rename from src/version3/models/attachmentArchiveItemReadable.ts rename to src/version3/models/attachmentArchiveItemReadable.mts diff --git a/src/version3/models/attachmentArchiveMetadataReadable.mts b/src/version3/models/attachmentArchiveMetadataReadable.mts new file mode 100644 index 0000000000..6dc62a5780 --- /dev/null +++ b/src/version3/models/attachmentArchiveMetadataReadable.mts @@ -0,0 +1,15 @@ +import { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable.mjs'; + +/** Metadata for an archive (for example a zip) and its contents. */ +export interface AttachmentArchiveMetadataReadable { + /** The ID of the attachment. */ + id?: number; + /** The name of the archive file. */ + name?: string; + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveItemReadable[]; + /** The number of items included in the archive. */ + totalEntryCount?: number; + /** The MIME type of the attachment. */ + mediaType?: string; +} diff --git a/src/version3/models/attachmentArchiveMetadataReadable.ts b/src/version3/models/attachmentArchiveMetadataReadable.ts deleted file mode 100644 index c0ed85f963..0000000000 --- a/src/version3/models/attachmentArchiveMetadataReadable.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { AttachmentArchiveItemReadable } from './attachmentArchiveItemReadable'; - -/** Metadata for an archive (for example a zip) and its contents. */ -export interface AttachmentArchiveMetadataReadable { - /** The ID of the attachment. */ - id?: number; - /** The name of the archive file. */ - name?: string; - /** The list of the items included in the archive. */ - entries?: AttachmentArchiveItemReadable[]; - /** The number of items included in the archive. */ - totalEntryCount?: number; - /** The MIME type of the attachment. */ - mediaType?: string; -} diff --git a/src/version3/models/attachmentMetadata.mts b/src/version3/models/attachmentMetadata.mts new file mode 100644 index 0000000000..a572eb9c00 --- /dev/null +++ b/src/version3/models/attachmentMetadata.mts @@ -0,0 +1,29 @@ +import { User } from './user.mjs'; + +/** Metadata for an issue attachment. */ +export interface AttachmentMetadata { + /** The ID of the attachment. */ + id?: number; + /** The URL of the attachment metadata details. */ + self?: string; + /** The name of the attachment file. */ + filename?: string; + author?: User; + /** The datetime the attachment was created. */ + created?: string; + /** The size of the attachment. */ + size?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** Additional properties of the attachment. */ + properties?: {}; + /** The URL of the attachment. */ + content?: string; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; + /** + * File ID of the attachment in Media Store. See [ for more details on the Media + * API.](https://developer.atlassian.com/platform/media/) + */ + mediaApiFileId?: string; +} diff --git a/src/version3/models/attachmentMetadata.ts b/src/version3/models/attachmentMetadata.ts deleted file mode 100644 index 00385665ae..0000000000 --- a/src/version3/models/attachmentMetadata.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { User } from './user'; - -/** Metadata for an issue attachment. */ -export interface AttachmentMetadata { - /** The ID of the attachment. */ - id?: number; - /** The URL of the attachment metadata details. */ - self?: string; - /** The name of the attachment file. */ - filename?: string; - author?: User; - /** The datetime the attachment was created. */ - created?: string; - /** The size of the attachment. */ - size?: number; - /** The MIME type of the attachment. */ - mimeType?: string; - /** Additional properties of the attachment. */ - properties?: {}; - /** The URL of the attachment. */ - content?: string; - /** The URL of a thumbnail representing the attachment. */ - thumbnail?: string; - /** - * File ID of the attachment in Media Store. See [ for more details on the Media - * API.](https://developer.atlassian.com/platform/media/) - */ - mediaApiFileId?: string; -} diff --git a/src/version3/models/attachmentSettings.ts b/src/version3/models/attachmentSettings.mts similarity index 100% rename from src/version3/models/attachmentSettings.ts rename to src/version3/models/attachmentSettings.mts diff --git a/src/version3/models/auditRecord.mts b/src/version3/models/auditRecord.mts new file mode 100644 index 0000000000..771cc5b916 --- /dev/null +++ b/src/version3/models/auditRecord.mts @@ -0,0 +1,28 @@ +import { AssociatedItem } from './associatedItem.mjs'; +import { ChangedValue } from './changedValue.mjs'; + +/** An audit record. */ +export interface AuditRecord { + /** The ID of the audit record. */ + id?: number; + /** The summary of the audit record. */ + summary?: string; + /** The URL of the computer where the creation of the audit record was initiated. */ + remoteAddress?: string; + /** The date and time on which the audit record was created. */ + created?: string; + /** + * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira + * applications](https://confluence.atlassian.com/x/noXKM). + */ + category?: string; + /** The event the audit record originated from. */ + eventSource?: string; + /** The description of the audit record. */ + description?: string; + objectItem?: AssociatedItem; + /** The list of values changed in the record event. */ + changedValues?: ChangedValue[]; + /** The list of items associated with the changed record. */ + associatedItems?: AssociatedItem[]; +} diff --git a/src/version3/models/auditRecord.ts b/src/version3/models/auditRecord.ts deleted file mode 100644 index 5b294091e0..0000000000 --- a/src/version3/models/auditRecord.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { AssociatedItem } from './associatedItem'; -import { ChangedValue } from './changedValue'; - -/** An audit record. */ -export interface AuditRecord { - /** The ID of the audit record. */ - id?: number; - /** The summary of the audit record. */ - summary?: string; - /** The URL of the computer where the creation of the audit record was initiated. */ - remoteAddress?: string; - /** The date and time on which the audit record was created. */ - created?: string; - /** - * The category of the audit record. For a list of these categories, see the help article [Auditing in Jira - * applications](https://confluence.atlassian.com/x/noXKM). - */ - category?: string; - /** The event the audit record originated from. */ - eventSource?: string; - /** The description of the audit record. */ - description?: string; - objectItem?: AssociatedItem; - /** The list of values changed in the record event. */ - changedValues?: ChangedValue[]; - /** The list of items associated with the changed record. */ - associatedItems?: AssociatedItem[]; -} diff --git a/src/version3/models/auditRecords.mts b/src/version3/models/auditRecords.mts new file mode 100644 index 0000000000..66953e8d64 --- /dev/null +++ b/src/version3/models/auditRecords.mts @@ -0,0 +1,13 @@ +import { AuditRecord } from './auditRecord.mjs'; + +/** Container for a list of audit records. */ +export interface AuditRecords { + /** The number of audit items skipped before the first item in this list. */ + offset?: number; + /** The requested or default limit on the number of audit items to be returned. */ + limit?: number; + /** The total number of audit items returned. */ + total?: number; + /** The list of audit items. */ + records?: AuditRecord[]; +} diff --git a/src/version3/models/auditRecords.ts b/src/version3/models/auditRecords.ts deleted file mode 100644 index 89bcc32404..0000000000 --- a/src/version3/models/auditRecords.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AuditRecord } from './auditRecord'; - -/** Container for a list of audit records. */ -export interface AuditRecords { - /** The number of audit items skipped before the first item in this list. */ - offset?: number; - /** The requested or default limit on the number of audit items to be returned. */ - limit?: number; - /** The total number of audit items returned. */ - total?: number; - /** The list of audit items. */ - records?: AuditRecord[]; -} diff --git a/src/version3/models/autoCompleteSuggestion.ts b/src/version3/models/autoCompleteSuggestion.mts similarity index 100% rename from src/version3/models/autoCompleteSuggestion.ts rename to src/version3/models/autoCompleteSuggestion.mts diff --git a/src/version3/models/autoCompleteSuggestions.mts b/src/version3/models/autoCompleteSuggestions.mts new file mode 100644 index 0000000000..c170b32c19 --- /dev/null +++ b/src/version3/models/autoCompleteSuggestions.mts @@ -0,0 +1,7 @@ +import { AutoCompleteSuggestion } from './autoCompleteSuggestion.mjs'; + +/** The results from a Jql query. */ +export interface AutoCompleteSuggestions { + /** The list of suggested item. */ + results?: AutoCompleteSuggestion[]; +} diff --git a/src/version3/models/autoCompleteSuggestions.ts b/src/version3/models/autoCompleteSuggestions.ts deleted file mode 100644 index d8a5e00228..0000000000 --- a/src/version3/models/autoCompleteSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AutoCompleteSuggestion } from './autoCompleteSuggestion'; - -/** The results from a JQL query. */ -export interface AutoCompleteSuggestions { - /** The list of suggested item. */ - results?: AutoCompleteSuggestion[]; -} diff --git a/src/version3/models/availableDashboardGadget.ts b/src/version3/models/availableDashboardGadget.mts similarity index 100% rename from src/version3/models/availableDashboardGadget.ts rename to src/version3/models/availableDashboardGadget.mts diff --git a/src/version3/models/availableDashboardGadgetsResponse.mts b/src/version3/models/availableDashboardGadgetsResponse.mts new file mode 100644 index 0000000000..5f40eeae32 --- /dev/null +++ b/src/version3/models/availableDashboardGadgetsResponse.mts @@ -0,0 +1,7 @@ +import { AvailableDashboardGadget } from './availableDashboardGadget.mjs'; + +/** The list of available gadgets. */ +export interface AvailableDashboardGadgetsResponse { + /** The list of available gadgets. */ + gadgets: AvailableDashboardGadget[]; +} diff --git a/src/version3/models/availableDashboardGadgetsResponse.ts b/src/version3/models/availableDashboardGadgetsResponse.ts deleted file mode 100644 index d6edf26553..0000000000 --- a/src/version3/models/availableDashboardGadgetsResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { AvailableDashboardGadget } from './availableDashboardGadget'; - -/** The list of available gadgets. */ -export interface AvailableDashboardGadgetsResponse { - /** The list of available gadgets. */ - gadgets: AvailableDashboardGadget[]; -} diff --git a/src/version3/models/avatar.ts b/src/version3/models/avatar.mts similarity index 100% rename from src/version3/models/avatar.ts rename to src/version3/models/avatar.mts diff --git a/src/version3/models/avatarUrls.ts b/src/version3/models/avatarUrls.mts similarity index 100% rename from src/version3/models/avatarUrls.ts rename to src/version3/models/avatarUrls.mts diff --git a/src/version3/models/avatarWithDetails.ts b/src/version3/models/avatarWithDetails.mts similarity index 100% rename from src/version3/models/avatarWithDetails.ts rename to src/version3/models/avatarWithDetails.mts diff --git a/src/version3/models/avatars.mts b/src/version3/models/avatars.mts new file mode 100644 index 0000000000..ae4e92054e --- /dev/null +++ b/src/version3/models/avatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** Details about system and custom avatars. */ +export interface Avatars { + /** System avatars list. */ + system?: Avatar[]; + /** Custom avatars list. */ + custom?: Avatar[]; +} diff --git a/src/version3/models/avatars.ts b/src/version3/models/avatars.ts deleted file mode 100644 index 9954aeb966..0000000000 --- a/src/version3/models/avatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Avatar } from './avatar'; - -/** Details about system and custom avatars. */ -export interface Avatars { - /** System avatars list. */ - system?: Avatar[]; - /** Custom avatars list. */ - custom?: Avatar[]; -} diff --git a/src/version3/models/bulkChangeOwnerDetails.ts b/src/version3/models/bulkChangeOwnerDetails.mts similarity index 100% rename from src/version3/models/bulkChangeOwnerDetails.ts rename to src/version3/models/bulkChangeOwnerDetails.mts diff --git a/src/version3/models/bulkCustomFieldOptionCreateRequest.mts b/src/version3/models/bulkCustomFieldOptionCreateRequest.mts new file mode 100644 index 0000000000..9374a43cc3 --- /dev/null +++ b/src/version3/models/bulkCustomFieldOptionCreateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionCreate } from './customFieldOptionCreate.mjs'; + +/** Details of the options to create for a custom field. */ +export interface BulkCustomFieldOptionCreateRequest { + /** Details of options to create. */ + options?: CustomFieldOptionCreate[]; +} diff --git a/src/version3/models/bulkCustomFieldOptionCreateRequest.ts b/src/version3/models/bulkCustomFieldOptionCreateRequest.ts deleted file mode 100644 index 0944e835e0..0000000000 --- a/src/version3/models/bulkCustomFieldOptionCreateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldOptionCreate } from './customFieldOptionCreate'; - -/** Details of the options to create for a custom field. */ -export interface BulkCustomFieldOptionCreateRequest { - /** Details of options to create. */ - options?: CustomFieldOptionCreate[]; -} diff --git a/src/version3/models/bulkCustomFieldOptionUpdateRequest.mts b/src/version3/models/bulkCustomFieldOptionUpdateRequest.mts new file mode 100644 index 0000000000..952315da41 --- /dev/null +++ b/src/version3/models/bulkCustomFieldOptionUpdateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** Details of the options to update for a custom field. */ +export interface BulkCustomFieldOptionUpdateRequest { + /** Details of the options to update. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version3/models/bulkCustomFieldOptionUpdateRequest.ts b/src/version3/models/bulkCustomFieldOptionUpdateRequest.ts deleted file mode 100644 index c7b8076989..0000000000 --- a/src/version3/models/bulkCustomFieldOptionUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldOptionUpdate } from './customFieldOptionUpdate'; - -/** Details of the options to update for a custom field. */ -export interface BulkCustomFieldOptionUpdateRequest { - /** Details of the options to update. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version3/models/bulkEditShareableEntity.ts b/src/version3/models/bulkEditShareableEntity.mts similarity index 100% rename from src/version3/models/bulkEditShareableEntity.ts rename to src/version3/models/bulkEditShareableEntity.mts diff --git a/src/version3/models/bulkIssueIsWatching.ts b/src/version3/models/bulkIssueIsWatching.mts similarity index 100% rename from src/version3/models/bulkIssueIsWatching.ts rename to src/version3/models/bulkIssueIsWatching.mts diff --git a/src/version3/models/bulkIssuePropertyUpdateRequest.mts b/src/version3/models/bulkIssuePropertyUpdateRequest.mts new file mode 100644 index 0000000000..6c04dde311 --- /dev/null +++ b/src/version3/models/bulkIssuePropertyUpdateRequest.mts @@ -0,0 +1,18 @@ +import { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet.mjs'; + +/** Bulk issue property update request details. */ +export interface BulkIssuePropertyUpdateRequest { + /** + * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. + * The maximum length is 32768 characters. + */ + value?: any; + /** + * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an + * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables + * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON + * representation is longer than 32768 characters are ignored. + */ + expression?: string; + filter?: IssueFilterForBulkPropertySet; +} diff --git a/src/version3/models/bulkIssuePropertyUpdateRequest.ts b/src/version3/models/bulkIssuePropertyUpdateRequest.ts deleted file mode 100644 index 2831b5b06b..0000000000 --- a/src/version3/models/bulkIssuePropertyUpdateRequest.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { IssueFilterForBulkPropertySet } from './issueFilterForBulkPropertySet'; - -/** Bulk issue property update request details. */ -export interface BulkIssuePropertyUpdateRequest { - /** - * The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. - * The maximum length is 32768 characters. - */ - value?: any; - /** - * EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an - * object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables - * available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON - * representation is longer than 32768 characters are ignored. - */ - expression?: string; - filter?: IssueFilterForBulkPropertySet; -} diff --git a/src/version3/models/bulkOperationErrorResult.mts b/src/version3/models/bulkOperationErrorResult.mts new file mode 100644 index 0000000000..5a4b5eee7c --- /dev/null +++ b/src/version3/models/bulkOperationErrorResult.mts @@ -0,0 +1,7 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +export interface BulkOperationErrorResult { + status?: number; + elementErrors?: ErrorCollection; + failedElementNumber?: number; +} diff --git a/src/version3/models/bulkOperationErrorResult.ts b/src/version3/models/bulkOperationErrorResult.ts deleted file mode 100644 index accfbdcfc7..0000000000 --- a/src/version3/models/bulkOperationErrorResult.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ErrorCollection } from './errorCollection'; - -export interface BulkOperationErrorResult { - status?: number; - elementErrors?: ErrorCollection; - failedElementNumber?: number; -} diff --git a/src/version3/models/bulkPermissionGrants.mts b/src/version3/models/bulkPermissionGrants.mts new file mode 100644 index 0000000000..c2e4687a57 --- /dev/null +++ b/src/version3/models/bulkPermissionGrants.mts @@ -0,0 +1,9 @@ +import { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants.mjs'; + +/** Details of global and project permissions granted to the user. */ +export interface BulkPermissionGrants { + /** List of project permissions and the projects and issues those permissions provide access to. */ + projectPermissions: BulkProjectPermissionGrants[]; + /** List of permissions granted to the user. */ + globalPermissions: string[]; +} diff --git a/src/version3/models/bulkPermissionGrants.ts b/src/version3/models/bulkPermissionGrants.ts deleted file mode 100644 index b94169b695..0000000000 --- a/src/version3/models/bulkPermissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { BulkProjectPermissionGrants } from './bulkProjectPermissionGrants'; - -/** Details of global and project permissions granted to the user. */ -export interface BulkPermissionGrants { - /** List of project permissions and the projects and issues those permissions provide access to. */ - projectPermissions: BulkProjectPermissionGrants[]; - /** List of permissions granted to the user. */ - globalPermissions: string[]; -} diff --git a/src/version3/models/bulkPermissionsRequest.mts b/src/version3/models/bulkPermissionsRequest.mts new file mode 100644 index 0000000000..09d00da8a1 --- /dev/null +++ b/src/version3/models/bulkPermissionsRequest.mts @@ -0,0 +1,11 @@ +import { BulkProjectPermissions } from './bulkProjectPermissions.mjs'; + +/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ +export interface BulkPermissionsRequest { + /** Project permissions with associated projects and issues to look up. */ + projectPermissions?: BulkProjectPermissions[]; + /** Global permissions to look up. */ + globalPermissions?: string[]; + /** The account ID of a user. */ + accountId?: string; +} diff --git a/src/version3/models/bulkPermissionsRequest.ts b/src/version3/models/bulkPermissionsRequest.ts deleted file mode 100644 index 5e2a3400c7..0000000000 --- a/src/version3/models/bulkPermissionsRequest.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BulkProjectPermissions } from './bulkProjectPermissions'; - -/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ -export interface BulkPermissionsRequest { - /** Project permissions with associated projects and issues to look up. */ - projectPermissions?: BulkProjectPermissions[]; - /** Global permissions to look up. */ - globalPermissions?: string[]; - /** The account ID of a user. */ - accountId?: string; -} diff --git a/src/version3/models/bulkProjectPermissionGrants.ts b/src/version3/models/bulkProjectPermissionGrants.mts similarity index 100% rename from src/version3/models/bulkProjectPermissionGrants.ts rename to src/version3/models/bulkProjectPermissionGrants.mts diff --git a/src/version3/models/bulkProjectPermissions.ts b/src/version3/models/bulkProjectPermissions.mts similarity index 100% rename from src/version3/models/bulkProjectPermissions.ts rename to src/version3/models/bulkProjectPermissions.mts diff --git a/src/version3/models/changeDetails.ts b/src/version3/models/changeDetails.mts similarity index 100% rename from src/version3/models/changeDetails.ts rename to src/version3/models/changeDetails.mts diff --git a/src/version3/models/changedValue.ts b/src/version3/models/changedValue.mts similarity index 100% rename from src/version3/models/changedValue.ts rename to src/version3/models/changedValue.mts diff --git a/src/version3/models/changedWorklog.mts b/src/version3/models/changedWorklog.mts new file mode 100644 index 0000000000..8bd87cf237 --- /dev/null +++ b/src/version3/models/changedWorklog.mts @@ -0,0 +1,11 @@ +import { EntityProperty } from './entityProperty.mjs'; + +/** Details of a changed worklog. */ +export interface ChangedWorklog { + /** The ID of the worklog. */ + worklogId?: number; + /** The datetime of the change. */ + updatedTime?: number; + /** Details of properties associated with the change. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/changedWorklog.ts b/src/version3/models/changedWorklog.ts deleted file mode 100644 index 007309c0a3..0000000000 --- a/src/version3/models/changedWorklog.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { EntityProperty } from './entityProperty'; - -/** Details of a changed worklog. */ -export interface ChangedWorklog { - /** The ID of the worklog. */ - worklogId?: number; - /** The datetime of the change. */ - updatedTime?: number; - /** Details of properties associated with the change. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/changedWorklogs.mts b/src/version3/models/changedWorklogs.mts new file mode 100644 index 0000000000..f0ea7d5957 --- /dev/null +++ b/src/version3/models/changedWorklogs.mts @@ -0,0 +1,16 @@ +import { ChangedWorklog } from './changedWorklog.mjs'; + +/** List of changed worklogs. */ +export interface ChangedWorklogs { + /** Changed worklog list. */ + values?: ChangedWorklog[]; + /** The datetime of the first worklog item in the list. */ + since?: number; + /** The datetime of the last worklog item in the list. */ + until?: number; + /** The URL of this changed worklogs list. */ + self?: string; + /** The URL of the next list of changed worklogs. */ + nextPage?: string; + lastPage?: boolean; +} diff --git a/src/version3/models/changedWorklogs.ts b/src/version3/models/changedWorklogs.ts deleted file mode 100644 index cd45c356b9..0000000000 --- a/src/version3/models/changedWorklogs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ChangedWorklog } from './changedWorklog'; - -/** List of changed worklogs. */ -export interface ChangedWorklogs { - /** Changed worklog list. */ - values?: ChangedWorklog[]; - /** The datetime of the first worklog item in the list. */ - since?: number; - /** The datetime of the last worklog item in the list. */ - until?: number; - /** The URL of this changed worklogs list. */ - self?: string; - /** The URL of the next list of changed worklogs. */ - nextPage?: string; - lastPage?: boolean; -} diff --git a/src/version3/models/changelog.mts b/src/version3/models/changelog.mts new file mode 100644 index 0000000000..261110fa96 --- /dev/null +++ b/src/version3/models/changelog.mts @@ -0,0 +1,15 @@ +import { ChangeDetails } from './changeDetails.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** A changelog. */ +export interface Changelog { + /** The ID of the changelog. */ + id?: string; + author?: UserDetails; + /** The date on which the change took place. */ + created?: string; + /** The list of items changed. */ + items?: ChangeDetails[]; + historyMetadata?: HistoryMetadata; +} diff --git a/src/version3/models/changelog.ts b/src/version3/models/changelog.ts deleted file mode 100644 index d5a5ea1006..0000000000 --- a/src/version3/models/changelog.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { ChangeDetails } from './changeDetails'; -import { HistoryMetadata } from './historyMetadata'; -import { UserDetails } from './userDetails'; - -/** A changelog. */ -export interface Changelog { - /** The ID of the changelog. */ - id?: string; - author?: UserDetails; - /** The date on which the change took place. */ - created?: string; - /** The list of items changed. */ - items?: ChangeDetails[]; - historyMetadata?: HistoryMetadata; -} diff --git a/src/version3/models/columnItem.ts b/src/version3/models/columnItem.mts similarity index 100% rename from src/version3/models/columnItem.ts rename to src/version3/models/columnItem.mts diff --git a/src/version3/models/comment.mts b/src/version3/models/comment.mts new file mode 100644 index 0000000000..632a8204d4 --- /dev/null +++ b/src/version3/models/comment.mts @@ -0,0 +1,44 @@ +import type { Document } from './document.mjs'; +import { EntityProperty } from './entityProperty.mjs'; +import { UserDetails } from './userDetails.mjs'; +import { Visibility } from './visibility.mjs'; + +/** A comment. */ +export interface Comment { + /** The URL of the comment. */ + self?: string; + /** The ID of the comment. */ + id?: string; + author?: UserDetails; + /** + * The comment text in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). + */ + body?: Document; + /** The rendered version of the comment. */ + renderedBody?: string; + updateAuthor?: UserDetails; + /** The date and time at which the comment was created. */ + created?: string; + /** The date and time at which the comment was updated last. */ + updated?: string; + visibility?: Visibility; + /** + * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud + * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk + * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its + * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request + * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) + * operation. + */ + jsdPublic?: boolean; + /** + * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external + * emails to be added as comments on + * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for + * information on setting up this feature. + */ + jsdAuthorCanSeeRequest?: boolean; + /** A list of comment properties. Optional on create and update. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/comment.ts b/src/version3/models/comment.ts deleted file mode 100644 index 20c65268f2..0000000000 --- a/src/version3/models/comment.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Document } from './document'; -import { EntityProperty } from './entityProperty'; -import { UserDetails } from './userDetails'; -import { Visibility } from './visibility'; - -/** A comment. */ -export interface Comment { - /** The URL of the comment. */ - self?: string; - /** The ID of the comment. */ - id?: string; - author?: UserDetails; - /** - * The comment text in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). - */ - body?: Document; - /** The rendered version of the comment. */ - renderedBody?: string; - updateAuthor?: UserDetails; - /** The date and time at which the comment was created. */ - created?: string; - /** The date and time at which the comment was updated last. */ - updated?: string; - visibility?: Visibility; - /** - * Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud - * Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk - * project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its - * visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request - * comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) - * operation. - */ - jsdPublic?: boolean; - /** - * Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external - * emails to be added as comments on - * issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for - * information on setting up this feature. - */ - jsdAuthorCanSeeRequest?: boolean; - /** A list of comment properties. Optional on create and update. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/componentIssuesCount.ts b/src/version3/models/componentIssuesCount.mts similarity index 100% rename from src/version3/models/componentIssuesCount.ts rename to src/version3/models/componentIssuesCount.mts diff --git a/src/version3/models/componentWithIssueCount.mts b/src/version3/models/componentWithIssueCount.mts new file mode 100644 index 0000000000..6fcdd84e82 --- /dev/null +++ b/src/version3/models/componentWithIssueCount.mts @@ -0,0 +1,51 @@ +import { User } from './user.mjs'; + +/** Details about a component with a count of the issues it contains. */ +export interface ComponentWithIssueCount { + /** Count of issues for the component. */ + issueCount?: number; + realAssignee?: User; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + assignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * 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. + */ + realAssigneeType?: string; + /** The description for the component. */ + description?: string; + /** The URL for this count of the issues contained in the component. */ + self?: string; + /** Not used. */ + projectId?: number; + /** The key of the project to which the component is assigned. */ + project?: string; + lead?: 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. Takes 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. + */ + assigneeType?: string; + /** The name for the component. */ + name?: string; + /** The unique identifier for the component. */ + id?: string; +} diff --git a/src/version3/models/componentWithIssueCount.ts b/src/version3/models/componentWithIssueCount.ts deleted file mode 100644 index 928ae00bcc..0000000000 --- a/src/version3/models/componentWithIssueCount.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { User } from './user'; - -/** Details about a component with a count of the issues it contains. */ -export interface ComponentWithIssueCount { - /** Count of issues for the component. */ - issueCount?: number; - realAssignee?: User; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - assignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * 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. - */ - realAssigneeType?: string; - /** The description for the component. */ - description?: string; - /** The URL for this count of the issues contained in the component. */ - self?: string; - /** Not used. */ - projectId?: number; - /** The key of the project to which the component is assigned. */ - project?: string; - lead?: 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. Takes 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. - */ - assigneeType?: string; - /** The name for the component. */ - name?: string; - /** The unique identifier for the component. */ - id?: string; -} diff --git a/src/version3/models/configuration.mts b/src/version3/models/configuration.mts new file mode 100644 index 0000000000..f6dfbe8ebf --- /dev/null +++ b/src/version3/models/configuration.mts @@ -0,0 +1,27 @@ +import { TimeTrackingConfiguration } from './timeTrackingConfiguration.mjs'; + +/** Details about the configuration of Jira. */ +export interface Configuration { + /** + * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + votingEnabled?: boolean; + /** + * Whether the ability for users to watch issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + watchingEnabled?: boolean; + /** + * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application + * options](https://confluence.atlassian.com/x/uYXKM) for details. + */ + unassignedIssuesAllowed?: boolean; + /** Whether the ability to create subtasks for issues is enabled. */ + subTasksEnabled?: boolean; + /** Whether the ability to link issues is enabled. */ + issueLinkingEnabled?: boolean; + /** Whether the ability to add attachments to issues is enabled. */ + attachmentsEnabled?: boolean; + timeTrackingConfiguration?: TimeTrackingConfiguration; +} diff --git a/src/version3/models/configuration.ts b/src/version3/models/configuration.ts deleted file mode 100644 index 45b8225c64..0000000000 --- a/src/version3/models/configuration.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { TimeTrackingConfiguration } from './timeTrackingConfiguration'; - -/** Details about the configuration of Jira. */ -export interface Configuration { - /** - * Whether the ability for users to vote on issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - votingEnabled?: boolean; - /** - * Whether the ability for users to watch issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - watchingEnabled?: boolean; - /** - * Whether the ability to create unassigned issues is enabled. See [Configuring Jira application - * options](https://confluence.atlassian.com/x/uYXKM) for details. - */ - unassignedIssuesAllowed?: boolean; - /** Whether the ability to create subtasks for issues is enabled. */ - subTasksEnabled?: boolean; - /** Whether the ability to link issues is enabled. */ - issueLinkingEnabled?: boolean; - /** Whether the ability to add attachments to issues is enabled. */ - attachmentsEnabled?: boolean; - timeTrackingConfiguration?: TimeTrackingConfiguration; -} diff --git a/src/version3/models/connectCustomFieldValue.ts b/src/version3/models/connectCustomFieldValue.mts similarity index 100% rename from src/version3/models/connectCustomFieldValue.ts rename to src/version3/models/connectCustomFieldValue.mts diff --git a/src/version3/models/connectCustomFieldValues.mts b/src/version3/models/connectCustomFieldValues.mts new file mode 100644 index 0000000000..c9a349f477 --- /dev/null +++ b/src/version3/models/connectCustomFieldValues.mts @@ -0,0 +1,7 @@ +import { ConnectCustomFieldValue } from './connectCustomFieldValue.mjs'; + +/** Details of updates for a custom field. */ +export interface ConnectCustomFieldValues { + /** The list of custom field update details. */ + updateValueList?: ConnectCustomFieldValue[]; +} diff --git a/src/version3/models/connectCustomFieldValues.ts b/src/version3/models/connectCustomFieldValues.ts deleted file mode 100644 index b54c2562f6..0000000000 --- a/src/version3/models/connectCustomFieldValues.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ConnectCustomFieldValue } from './connectCustomFieldValue'; - -/** Details of updates for a custom field. */ -export interface ConnectCustomFieldValues { - /** The list of custom field update details. */ - updateValueList?: ConnectCustomFieldValue[]; -} diff --git a/src/version3/models/connectModule.ts b/src/version3/models/connectModule.mts similarity index 100% rename from src/version3/models/connectModule.ts rename to src/version3/models/connectModule.mts diff --git a/src/version3/models/connectModules.mts b/src/version3/models/connectModules.mts new file mode 100644 index 0000000000..4d5fe7c19c --- /dev/null +++ b/src/version3/models/connectModules.mts @@ -0,0 +1,9 @@ +import { ConnectModule } from './connectModule.mjs'; + +export interface ConnectModules { + /** + * A list of app modules in the same format as the `modules` property in the [app + * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: ConnectModule[]; +} diff --git a/src/version3/models/connectModules.ts b/src/version3/models/connectModules.ts deleted file mode 100644 index 4800ca7b1c..0000000000 --- a/src/version3/models/connectModules.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ConnectModule } from './connectModule'; - -export interface ConnectModules { - /** - * A list of app modules in the same format as the `modules` property in the [app - * descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). - */ - modules: ConnectModule[]; -} diff --git a/src/version3/models/connectWorkflowTransitionRule.mts b/src/version3/models/connectWorkflowTransitionRule.mts new file mode 100644 index 0000000000..a165b09df0 --- /dev/null +++ b/src/version3/models/connectWorkflowTransitionRule.mts @@ -0,0 +1,12 @@ +import { RuleConfiguration } from './ruleConfiguration.mjs'; +import { WorkflowTransition } from './workflowTransition.mjs'; + +/** A workflow transition rule. */ +export interface ConnectWorkflowTransitionRule { + /** The ID of the transition rule. */ + id: string; + /** The key of the rule, as defined in the Connect app descriptor. */ + key: string; + configuration: RuleConfiguration; + transition?: WorkflowTransition; +} diff --git a/src/version3/models/connectWorkflowTransitionRule.ts b/src/version3/models/connectWorkflowTransitionRule.ts deleted file mode 100644 index 43168bcc94..0000000000 --- a/src/version3/models/connectWorkflowTransitionRule.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { RuleConfiguration } from './ruleConfiguration'; -import { WorkflowTransition } from './workflowTransition'; - -/** A workflow transition rule. */ -export interface ConnectWorkflowTransitionRule { - /** The ID of the transition rule. */ - id: string; - /** The key of the rule, as defined in the Connect app descriptor. */ - key: string; - configuration: RuleConfiguration; - transition?: WorkflowTransition; -} diff --git a/src/version3/models/containerForProjectFeatures.mts b/src/version3/models/containerForProjectFeatures.mts new file mode 100644 index 0000000000..f0fd1db6ac --- /dev/null +++ b/src/version3/models/containerForProjectFeatures.mts @@ -0,0 +1,7 @@ +import { ProjectFeature } from './projectFeature.mjs'; + +/** The list of features on a project. */ +export interface ContainerForProjectFeatures { + /** The project features. */ + features?: ProjectFeature[]; +} diff --git a/src/version3/models/containerForProjectFeatures.ts b/src/version3/models/containerForProjectFeatures.ts deleted file mode 100644 index ab3369de95..0000000000 --- a/src/version3/models/containerForProjectFeatures.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProjectFeature } from './projectFeature'; - -/** The list of features on a project. */ -export interface ContainerForProjectFeatures { - /** The project features. */ - features?: ProjectFeature[]; -} diff --git a/src/version3/models/containerForRegisteredWebhooks.mts b/src/version3/models/containerForRegisteredWebhooks.mts new file mode 100644 index 0000000000..ce2973c7c3 --- /dev/null +++ b/src/version3/models/containerForRegisteredWebhooks.mts @@ -0,0 +1,7 @@ +import { RegisteredWebhook } from './registeredWebhook.mjs'; + +/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ +export interface ContainerForRegisteredWebhooks { + /** A list of registered webhooks. */ + webhookRegistrationResult?: RegisteredWebhook[]; +} diff --git a/src/version3/models/containerForRegisteredWebhooks.ts b/src/version3/models/containerForRegisteredWebhooks.ts deleted file mode 100644 index aa13caf5ff..0000000000 --- a/src/version3/models/containerForRegisteredWebhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { RegisteredWebhook } from './registeredWebhook'; - -/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ -export interface ContainerForRegisteredWebhooks { - /** A list of registered webhooks. */ - webhookRegistrationResult?: RegisteredWebhook[]; -} diff --git a/src/version3/models/containerForWebhookIDs.ts b/src/version3/models/containerForWebhookIDs.mts similarity index 100% rename from src/version3/models/containerForWebhookIDs.ts rename to src/version3/models/containerForWebhookIDs.mts diff --git a/src/version3/models/containerOfWorkflowSchemeAssociations.mts b/src/version3/models/containerOfWorkflowSchemeAssociations.mts new file mode 100644 index 0000000000..2ecc5fc29a --- /dev/null +++ b/src/version3/models/containerOfWorkflowSchemeAssociations.mts @@ -0,0 +1,7 @@ +import { WorkflowSchemeAssociations } from './workflowSchemeAssociations.mjs'; + +/** A container for a list of workflow schemes together with the projects they are associated with. */ +export interface ContainerOfWorkflowSchemeAssociations { + /** A list of workflow schemes together with projects they are associated with. */ + values: WorkflowSchemeAssociations[]; +} diff --git a/src/version3/models/containerOfWorkflowSchemeAssociations.ts b/src/version3/models/containerOfWorkflowSchemeAssociations.ts deleted file mode 100644 index 5c053d4112..0000000000 --- a/src/version3/models/containerOfWorkflowSchemeAssociations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowSchemeAssociations } from './workflowSchemeAssociations'; - -/** A container for a list of workflow schemes together with the projects they are associated with. */ -export interface ContainerOfWorkflowSchemeAssociations { - /** A list of workflow schemes together with projects they are associated with. */ - values: WorkflowSchemeAssociations[]; -} diff --git a/src/version3/models/contextForProjectAndIssueType.ts b/src/version3/models/contextForProjectAndIssueType.mts similarity index 100% rename from src/version3/models/contextForProjectAndIssueType.ts rename to src/version3/models/contextForProjectAndIssueType.mts diff --git a/src/version3/models/contextualConfiguration.ts b/src/version3/models/contextualConfiguration.mts similarity index 100% rename from src/version3/models/contextualConfiguration.ts rename to src/version3/models/contextualConfiguration.mts diff --git a/src/version3/models/convertedJQLQueries.mts b/src/version3/models/convertedJQLQueries.mts new file mode 100644 index 0000000000..13da150c17 --- /dev/null +++ b/src/version3/models/convertedJQLQueries.mts @@ -0,0 +1,9 @@ +import { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers.mjs'; + +/** The converted Jql queries. */ +export interface ConvertedJQLQueries { + /** The list of converted query strings with account IDs in place of user identifiers. */ + queryStrings?: string[]; + /** List of queries containing user information that could not be mapped to an existing user */ + queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; +} diff --git a/src/version3/models/convertedJQLQueries.ts b/src/version3/models/convertedJQLQueries.ts deleted file mode 100644 index 4f73a5d45c..0000000000 --- a/src/version3/models/convertedJQLQueries.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { JQLQueryWithUnknownUsers } from './jQLQueryWithUnknownUsers'; - -/** The converted JQL queries. */ -export interface ConvertedJQLQueries { - /** The list of converted query strings with account IDs in place of user identifiers. */ - queryStrings?: string[]; - /** List of queries containing user information that could not be mapped to an existing user */ - queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; -} diff --git a/src/version3/models/createCustomFieldContext.ts b/src/version3/models/createCustomFieldContext.mts similarity index 100% rename from src/version3/models/createCustomFieldContext.ts rename to src/version3/models/createCustomFieldContext.mts diff --git a/src/version3/models/createIssueSecuritySchemeDetails.mts b/src/version3/models/createIssueSecuritySchemeDetails.mts new file mode 100644 index 0000000000..1a5a1f7114 --- /dev/null +++ b/src/version3/models/createIssueSecuritySchemeDetails.mts @@ -0,0 +1,11 @@ +import { SecuritySchemeLevel } from './securitySchemeLevel.mjs'; + +/** Issue security scheme and it's details */ +export interface CreateIssueSecuritySchemeDetails { + /** The description of the issue security scheme. */ + description?: string; + /** The list of scheme levels which should be added to the security scheme. */ + levels?: SecuritySchemeLevel[]; + /** The name of the issue security scheme. Must be unique (case-insensitive). */ + name: string; +} diff --git a/src/version3/models/createIssueSecuritySchemeDetails.ts b/src/version3/models/createIssueSecuritySchemeDetails.ts deleted file mode 100644 index d61b640ba1..0000000000 --- a/src/version3/models/createIssueSecuritySchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SecuritySchemeLevel } from './securitySchemeLevel'; - -/** Issue security scheme and it's details */ -export interface CreateIssueSecuritySchemeDetails { - /** The description of the issue security scheme. */ - description?: string; - /** The list of scheme levels which should be added to the security scheme. */ - levels?: SecuritySchemeLevel[]; - /** The name of the issue security scheme. Must be unique (case-insensitive). */ - name: string; -} diff --git a/src/version3/models/createNotificationSchemeDetails.mts b/src/version3/models/createNotificationSchemeDetails.mts new file mode 100644 index 0000000000..d76d5f6e57 --- /dev/null +++ b/src/version3/models/createNotificationSchemeDetails.mts @@ -0,0 +1,11 @@ +import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails.mjs'; + +/** Details of a notification scheme. */ +export interface CreateNotificationSchemeDetails { + /** The description of the notification scheme. */ + description?: string; + /** The name of the notification scheme. Must be unique (case-insensitive). */ + name: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents?: NotificationSchemeEventDetails[]; +} diff --git a/src/version3/models/createNotificationSchemeDetails.ts b/src/version3/models/createNotificationSchemeDetails.ts deleted file mode 100644 index bdabe0b9ff..0000000000 --- a/src/version3/models/createNotificationSchemeDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails'; - -/** Details of a notification scheme. */ -export interface CreateNotificationSchemeDetails { - /** The description of the notification scheme. */ - description?: string; - /** The name of the notification scheme. Must be unique (case-insensitive). */ - name: string; - /** The list of notifications which should be added to the notification scheme. */ - notificationSchemeEvents?: NotificationSchemeEventDetails[]; -} diff --git a/src/version3/models/createPriorityDetails.ts b/src/version3/models/createPriorityDetails.mts similarity index 100% rename from src/version3/models/createPriorityDetails.ts rename to src/version3/models/createPriorityDetails.mts diff --git a/src/version3/models/createProjectDetails.ts b/src/version3/models/createProjectDetails.mts similarity index 100% rename from src/version3/models/createProjectDetails.ts rename to src/version3/models/createProjectDetails.mts diff --git a/src/version3/models/createResolutionDetails.ts b/src/version3/models/createResolutionDetails.mts similarity index 100% rename from src/version3/models/createResolutionDetails.ts rename to src/version3/models/createResolutionDetails.mts diff --git a/src/version3/models/createUiModificationDetails.mts b/src/version3/models/createUiModificationDetails.mts new file mode 100644 index 0000000000..9a7d6dbc59 --- /dev/null +++ b/src/version3/models/createUiModificationDetails.mts @@ -0,0 +1,13 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface CreateUiModificationDetails { + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; +} diff --git a/src/version3/models/createUiModificationDetails.ts b/src/version3/models/createUiModificationDetails.ts deleted file mode 100644 index ed1005a7ad..0000000000 --- a/src/version3/models/createUiModificationDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface CreateUiModificationDetails { - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; -} diff --git a/src/version3/models/createUpdateRoleRequest.ts b/src/version3/models/createUpdateRoleRequest.mts similarity index 100% rename from src/version3/models/createUpdateRoleRequest.ts rename to src/version3/models/createUpdateRoleRequest.mts diff --git a/src/version3/models/createWorkflowCondition.ts b/src/version3/models/createWorkflowCondition.mts similarity index 100% rename from src/version3/models/createWorkflowCondition.ts rename to src/version3/models/createWorkflowCondition.mts diff --git a/src/version3/models/createWorkflowDetails.mts b/src/version3/models/createWorkflowDetails.mts new file mode 100644 index 0000000000..45197192a8 --- /dev/null +++ b/src/version3/models/createWorkflowDetails.mts @@ -0,0 +1,29 @@ +import { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails.mjs'; +import { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails.mjs'; + +/** The details of a workflow. */ +export interface CreateWorkflowDetails { + /** + * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be + * separated by a whitespace but the name cannot start or end with a whitespace. + */ + name: string; + /** The description of the workflow. The maximum length is 1000 characters. */ + description?: string; + /** + * The transitions of the workflow. For the request to be valid, these transitions must: + * + * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique + * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for + * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status + * on _directed_ transitions. + * + * All the transition statuses must be included in `statuses`. + */ + transitions: CreateWorkflowTransitionDetails[]; + /** + * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a + * transition. + */ + statuses: CreateWorkflowStatusDetails[]; +} diff --git a/src/version3/models/createWorkflowDetails.ts b/src/version3/models/createWorkflowDetails.ts deleted file mode 100644 index 057f9413f4..0000000000 --- a/src/version3/models/createWorkflowDetails.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { CreateWorkflowStatusDetails } from './createWorkflowStatusDetails'; -import { CreateWorkflowTransitionDetails } from './createWorkflowTransitionDetails'; - -/** The details of a workflow. */ -export interface CreateWorkflowDetails { - /** - * The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be - * separated by a whitespace but the name cannot start or end with a whitespace. - */ - name: string; - /** The description of the workflow. The maximum length is 1000 characters. */ - description?: string; - /** - * The transitions of the workflow. For the request to be valid, these transitions must: - * - * Include one _initial_ transition. not use the same name for a _global_ and _directed_ transition. have a unique - * name for each _global_ transition. have a unique 'to' status for each _global_ transition. have unique names for - * each transition from a status. not have a 'from' status on _initial_ and _global_ transitions. have a 'from' status - * on _directed_ transitions. - * - * All the transition statuses must be included in `statuses`. - */ - transitions: CreateWorkflowTransitionDetails[]; - /** - * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a - * transition. - */ - statuses: CreateWorkflowStatusDetails[]; -} diff --git a/src/version3/models/createWorkflowStatusDetails.ts b/src/version3/models/createWorkflowStatusDetails.mts similarity index 100% rename from src/version3/models/createWorkflowStatusDetails.ts rename to src/version3/models/createWorkflowStatusDetails.mts diff --git a/src/version3/models/createWorkflowTransitionDetails.mts b/src/version3/models/createWorkflowTransitionDetails.mts new file mode 100644 index 0000000000..e8e58b85d7 --- /dev/null +++ b/src/version3/models/createWorkflowTransitionDetails.mts @@ -0,0 +1,20 @@ +import { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails.mjs'; +import { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails.mjs'; + +/** The details of a workflow transition. */ +export interface CreateWorkflowTransitionDetails { + /** The name of the transition. The maximum length is 60 characters. */ + name: string; + /** The description of the transition. The maximum length is 1000 characters. */ + description?: string; + /** The statuses the transition can start from. */ + from?: string[]; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; + rules?: CreateWorkflowTransitionRulesDetails; + screen?: CreateWorkflowTransitionScreenDetails; + /** The properties of the transition. */ + properties?: {}; +} diff --git a/src/version3/models/createWorkflowTransitionDetails.ts b/src/version3/models/createWorkflowTransitionDetails.ts deleted file mode 100644 index 1f5a1e9c66..0000000000 --- a/src/version3/models/createWorkflowTransitionDetails.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { CreateWorkflowTransitionRulesDetails } from './createWorkflowTransitionRulesDetails'; -import { CreateWorkflowTransitionScreenDetails } from './createWorkflowTransitionScreenDetails'; - -/** The details of a workflow transition. */ -export interface CreateWorkflowTransitionDetails { - /** The name of the transition. The maximum length is 60 characters. */ - name: string; - /** The description of the transition. The maximum length is 1000 characters. */ - description?: string; - /** The statuses the transition can start from. */ - from?: string[]; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; - rules?: CreateWorkflowTransitionRulesDetails; - screen?: CreateWorkflowTransitionScreenDetails; - /** The properties of the transition. */ - properties?: {}; -} diff --git a/src/version3/models/createWorkflowTransitionRule.ts b/src/version3/models/createWorkflowTransitionRule.mts similarity index 100% rename from src/version3/models/createWorkflowTransitionRule.ts rename to src/version3/models/createWorkflowTransitionRule.mts diff --git a/src/version3/models/createWorkflowTransitionRulesDetails.mts b/src/version3/models/createWorkflowTransitionRulesDetails.mts new file mode 100644 index 0000000000..c965f0e7f2 --- /dev/null +++ b/src/version3/models/createWorkflowTransitionRulesDetails.mts @@ -0,0 +1,30 @@ +import { CreateWorkflowCondition } from './createWorkflowCondition.mjs'; +import { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule.mjs'; + +/** The details of a workflow transition rules. */ +export interface CreateWorkflowTransitionRulesDetails { + conditions?: CreateWorkflowCondition; + /** + * The workflow validators. + * + * _Note:_* The default permission validator is always added to the _initial_ transition, as in: + * + * "validators": [ { "type": "PermissionValidator", "configuration": { "permissionKey": "CREATE_ISSUES" } } ] + */ + validators?: CreateWorkflowTransitionRule[]; + /** + * The workflow post functions. + * + * _Note:_* The default post functions are always added to the _initial_ transition, as in: + * + * "postFunctions": [ { "type": "IssueCreateFunction" }, { "type": "IssueReindexFunction" }, { "type": + * "FireIssueEventFunction", "configuration": { "event": { "id": "1", "name": "issue_created" } } } ] + * + * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: + * + * "postFunctions": [ { "type": "UpdateIssueStatusFunction" }, { "type": "CreateCommentFunction" }, { "type": + * "GenerateChangeHistoryFunction" }, { "type": "IssueReindexFunction" }, { "type": "FireIssueEventFunction", + * "configuration": { "event": { "id": "13", "name": "issue_generic" } } } ] + */ + postFunctions?: CreateWorkflowTransitionRule[]; +} diff --git a/src/version3/models/createWorkflowTransitionRulesDetails.ts b/src/version3/models/createWorkflowTransitionRulesDetails.ts deleted file mode 100644 index d42a061e1b..0000000000 --- a/src/version3/models/createWorkflowTransitionRulesDetails.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { CreateWorkflowCondition } from './createWorkflowCondition'; -import { CreateWorkflowTransitionRule } from './createWorkflowTransitionRule'; - -/** The details of a workflow transition rules. */ -export interface CreateWorkflowTransitionRulesDetails { - conditions?: CreateWorkflowCondition; - /** - * The workflow validators. - * - * _Note:_* The default permission validator is always added to the _initial_ transition, as in: - * - * "validators": [ { "type": "PermissionValidator", "configuration": { "permissionKey": "CREATE_ISSUES" } } ] - */ - validators?: CreateWorkflowTransitionRule[]; - /** - * The workflow post functions. - * - * _Note:_* The default post functions are always added to the _initial_ transition, as in: - * - * "postFunctions": [ { "type": "IssueCreateFunction" }, { "type": "IssueReindexFunction" }, { "type": - * "FireIssueEventFunction", "configuration": { "event": { "id": "1", "name": "issue_created" } } } ] - * - * _Note:_* The default post functions are always added to the _global_ and _directed_ transitions, as in: - * - * "postFunctions": [ { "type": "UpdateIssueStatusFunction" }, { "type": "CreateCommentFunction" }, { "type": - * "GenerateChangeHistoryFunction" }, { "type": "IssueReindexFunction" }, { "type": "FireIssueEventFunction", - * "configuration": { "event": { "id": "13", "name": "issue_generic" } } } ] - */ - postFunctions?: CreateWorkflowTransitionRule[]; -} diff --git a/src/version3/models/createWorkflowTransitionScreenDetails.ts b/src/version3/models/createWorkflowTransitionScreenDetails.mts similarity index 100% rename from src/version3/models/createWorkflowTransitionScreenDetails.ts rename to src/version3/models/createWorkflowTransitionScreenDetails.mts diff --git a/src/version3/models/createdIssue.mts b/src/version3/models/createdIssue.mts new file mode 100644 index 0000000000..778f197bc1 --- /dev/null +++ b/src/version3/models/createdIssue.mts @@ -0,0 +1,12 @@ +import { NestedResponse } from './nestedResponse.mjs'; + +/** Details about a created issue or subtask. */ +export interface CreatedIssue { + /** The ID of the created issue or subtask. */ + id: string; + /** The key of the created issue or subtask. */ + key: string; + /** The URL of the created issue or subtask. */ + self: string; + transition?: NestedResponse; +} diff --git a/src/version3/models/createdIssue.ts b/src/version3/models/createdIssue.ts deleted file mode 100644 index 1eccacc89e..0000000000 --- a/src/version3/models/createdIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { NestedResponse } from './nestedResponse'; - -/** Details about a created issue or subtask. */ -export interface CreatedIssue { - /** The ID of the created issue or subtask. */ - id: string; - /** The key of the created issue or subtask. */ - key: string; - /** The URL of the created issue or subtask. */ - self: string; - transition?: NestedResponse; -} diff --git a/src/version3/models/createdIssues.mts b/src/version3/models/createdIssues.mts new file mode 100644 index 0000000000..90ca1b6e02 --- /dev/null +++ b/src/version3/models/createdIssues.mts @@ -0,0 +1,10 @@ +import { BulkOperationErrorResult } from './bulkOperationErrorResult.mjs'; +import { CreatedIssue } from './createdIssue.mjs'; + +/** Details about the issues created and the errors for requests that failed. */ +export interface CreatedIssues { + /** Details of the issues created. */ + issues?: CreatedIssue[]; + /** Error details for failed issue creation requests. */ + errors?: BulkOperationErrorResult[]; +} diff --git a/src/version3/models/createdIssues.ts b/src/version3/models/createdIssues.ts deleted file mode 100644 index f8b8a22d73..0000000000 --- a/src/version3/models/createdIssues.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BulkOperationErrorResult } from './bulkOperationErrorResult'; -import { CreatedIssue } from './createdIssue'; - -/** Details about the issues created and the errors for requests that failed. */ -export interface CreatedIssues { - /** Details of the issues created. */ - issues?: CreatedIssue[]; - /** Error details for failed issue creation requests. */ - errors?: BulkOperationErrorResult[]; -} diff --git a/src/version3/models/customContextVariable.ts b/src/version3/models/customContextVariable.mts similarity index 100% rename from src/version3/models/customContextVariable.ts rename to src/version3/models/customContextVariable.mts diff --git a/src/version3/models/customFieldConfigurations.mts b/src/version3/models/customFieldConfigurations.mts new file mode 100644 index 0000000000..40575ba1ed --- /dev/null +++ b/src/version3/models/customFieldConfigurations.mts @@ -0,0 +1,7 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** Details of configurations for a custom field. */ +export interface CustomFieldConfigurations { + /** The list of custom field configuration details. */ + configurations: ContextualConfiguration[]; +} diff --git a/src/version3/models/customFieldConfigurations.ts b/src/version3/models/customFieldConfigurations.ts deleted file mode 100644 index 40bc573c8d..0000000000 --- a/src/version3/models/customFieldConfigurations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ContextualConfiguration } from './contextualConfiguration'; - -/** Details of configurations for a custom field. */ -export interface CustomFieldConfigurations { - /** The list of custom field configuration details. */ - configurations: ContextualConfiguration[]; -} diff --git a/src/version3/models/customFieldContext.ts b/src/version3/models/customFieldContext.mts similarity index 100% rename from src/version3/models/customFieldContext.ts rename to src/version3/models/customFieldContext.mts diff --git a/src/version3/models/customFieldContextDefaultValue.ts b/src/version3/models/customFieldContextDefaultValue.mts similarity index 100% rename from src/version3/models/customFieldContextDefaultValue.ts rename to src/version3/models/customFieldContextDefaultValue.mts diff --git a/src/version3/models/customFieldContextDefaultValueUpdate.mts b/src/version3/models/customFieldContextDefaultValueUpdate.mts new file mode 100644 index 0000000000..4247319b72 --- /dev/null +++ b/src/version3/models/customFieldContextDefaultValueUpdate.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** Default values to update. */ +export interface CustomFieldContextDefaultValueUpdate { + defaultValues?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version3/models/customFieldContextDefaultValueUpdate.ts b/src/version3/models/customFieldContextDefaultValueUpdate.ts deleted file mode 100644 index c9bd5a4dc2..0000000000 --- a/src/version3/models/customFieldContextDefaultValueUpdate.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue'; - -/** Default values to update. */ -export interface CustomFieldContextDefaultValueUpdate { - defaultValues?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version3/models/customFieldContextOption.ts b/src/version3/models/customFieldContextOption.mts similarity index 100% rename from src/version3/models/customFieldContextOption.ts rename to src/version3/models/customFieldContextOption.mts diff --git a/src/version3/models/customFieldContextProjectMapping.ts b/src/version3/models/customFieldContextProjectMapping.mts similarity index 100% rename from src/version3/models/customFieldContextProjectMapping.ts rename to src/version3/models/customFieldContextProjectMapping.mts diff --git a/src/version3/models/customFieldContextUpdateDetails.ts b/src/version3/models/customFieldContextUpdateDetails.mts similarity index 100% rename from src/version3/models/customFieldContextUpdateDetails.ts rename to src/version3/models/customFieldContextUpdateDetails.mts diff --git a/src/version3/models/customFieldCreatedContextOptionsList.mts b/src/version3/models/customFieldCreatedContextOptionsList.mts new file mode 100644 index 0000000000..1ae6d0203c --- /dev/null +++ b/src/version3/models/customFieldCreatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldCreatedContextOptionsList { + /** The created custom field options. */ + options?: CustomFieldContextOption[]; +} diff --git a/src/version3/models/customFieldCreatedContextOptionsList.ts b/src/version3/models/customFieldCreatedContextOptionsList.ts deleted file mode 100644 index 9dac124a5d..0000000000 --- a/src/version3/models/customFieldCreatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldContextOption } from './customFieldContextOption'; - -/** A list of custom field options for a context. */ -export interface CustomFieldCreatedContextOptionsList { - /** The created custom field options. */ - options?: CustomFieldContextOption[]; -} diff --git a/src/version3/models/customFieldDefinitionJson.mts b/src/version3/models/customFieldDefinitionJson.mts new file mode 100644 index 0000000000..fdb6e97f05 --- /dev/null +++ b/src/version3/models/customFieldDefinitionJson.mts @@ -0,0 +1,61 @@ +export interface CustomFieldDefinitionJson { + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: string; + /** The description of the custom field, which is displayed in Jira. */ + description?: string; + /** + * The type of the custom field. These built-in custom field types are available: + * + * `cascadingselect`: Enables values to be selected from two levels of select lists (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a + * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates + * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: + * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using + * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) + * `multiselect`: Stores multiple values using a select list (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using + * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: + * Stores multiple versions from the versions available in a project using a picker control (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of + * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * `radiobuttons`: Stores a value using radio buttons (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, + * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * `select`: Stores a value from a configurable list of options (value: + * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline + * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string + * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a + * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker + * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a + * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field + * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), + * use the ID of the Forge custom field type as the value. For example, + * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: string; + /** + * The searcher defines the way the field is searched in Jira. For example, + * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and Jql + * search) will display different operations and values for the field, based on the field searcher. You must specify a + * searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: + * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` + * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` + * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` + * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: + * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` + * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) + * have a searcher set automatically, so are always searchable. + */ + searcherKey?: string; +} diff --git a/src/version3/models/customFieldDefinitionJson.ts b/src/version3/models/customFieldDefinitionJson.ts deleted file mode 100644 index b55d9a816e..0000000000 --- a/src/version3/models/customFieldDefinitionJson.ts +++ /dev/null @@ -1,61 +0,0 @@ -export interface CustomFieldDefinitionJson { - /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ - name: string; - /** The description of the custom field, which is displayed in Jira. */ - description?: string; - /** - * The type of the custom field. These built-in custom field types are available: - * - * `cascadingselect`: Enables values to be selected from two levels of select lists (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) `datepicker`: Stores a date using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) `datetime`: Stores a date with a - * time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) `float`: Stores and validates - * a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) `grouppicker`: - * Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) - * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:importid`) `labels`: Stores labels (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:labels`) `multicheckboxes`: Stores multiple values using - * checkboxes (value: `) `multigrouppicker`: Stores multiple user groups using a picker control (value: `) - * `multiselect`: Stores multiple values using a select list (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) `multiuserpicker`: Stores multiple users using - * a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) `multiversion`: - * Stores multiple versions from the versions available in a project using a picker control (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) `project`: Stores a project from a list of - * projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) - * `radiobuttons`: Stores a value using radio buttons (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) `readonlyfield`: Stores a read-only text value, - * which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) - * `select`: Stores a value from a configurable list of options (value: - * `com.atlassian.jira.plugin.system.customfieldtypes:select`) `textarea`: Stores a long text string using a multiline - * text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) `textfield`: Stores a text string - * using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) `url`: Stores a - * URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) `userpicker`: Stores a user using a picker - * control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) `version`: Stores a version using a - * picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) - * - * To create a field based on a [Forge custom field - * type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), - * use the ID of the Forge custom field type as the value. For example, - * `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. - */ - type: string; - /** - * The searcher defines the way the field is searched in Jira. For example, - * _com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher_. The search UI (basic search and JQL - * search) will display different operations and values for the field, based on the field searcher. You must specify a - * searcher that is valid for the field type, as listed below (abbreviated values shown): - * - * `cascadingselect`: `cascadingselectsearcher` `datepicker`: `daterange` `datetime`: `datetimerange` `float`: - * `exactnumber` or `numberrange` `grouppicker`: `grouppickersearcher` `importid`: `exactnumber` or `numberrange` - * `labels`: `labelsearcher` `multicheckboxes`: `multiselectsearcher` `multigrouppicker`: `multiselectsearcher` - * `multiselect`: `multiselectsearcher` `multiuserpicker`: `userpickergroupsearcher` `multiversion`: `versionsearcher` - * `project`: `projectsearcher` `radiobuttons`: `multiselectsearcher` `readonlyfield`: `textsearcher` `select`: - * `multiselectsearcher` `textarea`: `textsearcher` `textfield`: `textsearcher` `url`: `exacttextsearcher` - * `userpicker`: `userpickergroupsearcher` `version`: `versionsearcher` - * - * If no searcher is provided, the field isn't searchable. However, [Forge custom - * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) - * have a searcher set automatically, so are always searchable. - */ - searcherKey?: string; -} diff --git a/src/version3/models/customFieldOption.ts b/src/version3/models/customFieldOption.mts similarity index 100% rename from src/version3/models/customFieldOption.ts rename to src/version3/models/customFieldOption.mts diff --git a/src/version3/models/customFieldOptionCreate.ts b/src/version3/models/customFieldOptionCreate.mts similarity index 100% rename from src/version3/models/customFieldOptionCreate.ts rename to src/version3/models/customFieldOptionCreate.mts diff --git a/src/version3/models/customFieldOptionUpdate.ts b/src/version3/models/customFieldOptionUpdate.mts similarity index 100% rename from src/version3/models/customFieldOptionUpdate.ts rename to src/version3/models/customFieldOptionUpdate.mts diff --git a/src/version3/models/customFieldReplacement.ts b/src/version3/models/customFieldReplacement.mts similarity index 100% rename from src/version3/models/customFieldReplacement.ts rename to src/version3/models/customFieldReplacement.mts diff --git a/src/version3/models/customFieldUpdatedContextOptionsList.mts b/src/version3/models/customFieldUpdatedContextOptionsList.mts new file mode 100644 index 0000000000..e9d8f14784 --- /dev/null +++ b/src/version3/models/customFieldUpdatedContextOptionsList.mts @@ -0,0 +1,7 @@ +import { CustomFieldOptionUpdate } from './customFieldOptionUpdate.mjs'; + +/** A list of custom field options for a context. */ +export interface CustomFieldUpdatedContextOptionsList { + /** The updated custom field options. */ + options?: CustomFieldOptionUpdate[]; +} diff --git a/src/version3/models/customFieldUpdatedContextOptionsList.ts b/src/version3/models/customFieldUpdatedContextOptionsList.ts deleted file mode 100644 index 2f26a260f0..0000000000 --- a/src/version3/models/customFieldUpdatedContextOptionsList.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldOptionUpdate } from './customFieldOptionUpdate'; - -/** A list of custom field options for a context. */ -export interface CustomFieldUpdatedContextOptionsList { - /** The updated custom field options. */ - options?: CustomFieldOptionUpdate[]; -} diff --git a/src/version3/models/customFieldValueUpdate.ts b/src/version3/models/customFieldValueUpdate.mts similarity index 100% rename from src/version3/models/customFieldValueUpdate.ts rename to src/version3/models/customFieldValueUpdate.mts diff --git a/src/version3/models/customFieldValueUpdateRequest.mts b/src/version3/models/customFieldValueUpdateRequest.mts new file mode 100644 index 0000000000..c5040547c9 --- /dev/null +++ b/src/version3/models/customFieldValueUpdateRequest.mts @@ -0,0 +1,7 @@ +import { CustomFieldValueUpdate } from './customFieldValueUpdate.mjs'; + +/** Details of updates for a custom field. */ +export interface CustomFieldValueUpdateRequest { + /** The list of custom field update details. */ + updates?: CustomFieldValueUpdate[]; +} diff --git a/src/version3/models/customFieldValueUpdateRequest.ts b/src/version3/models/customFieldValueUpdateRequest.ts deleted file mode 100644 index 24a771360e..0000000000 --- a/src/version3/models/customFieldValueUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CustomFieldValueUpdate } from './customFieldValueUpdate'; - -/** Details of updates for a custom field. */ -export interface CustomFieldValueUpdateRequest { - /** The list of custom field update details. */ - updates?: CustomFieldValueUpdate[]; -} diff --git a/src/version3/models/dashboard.mts b/src/version3/models/dashboard.mts new file mode 100644 index 0000000000..dba892cacd --- /dev/null +++ b/src/version3/models/dashboard.mts @@ -0,0 +1,32 @@ +import type { DashboardUser } from './dashboardUser.mjs'; +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface Dashboard { + description?: string; + /** The ID of the dashboard. */ + id: string; + /** Whether the dashboard is selected as a favorite by the user. */ + isFavourite?: boolean; + /** The name of the dashboard. */ + name?: string; + owner?: DashboardUser; + /** The number of users who have this dashboard as a favorite. */ + popularity?: number; + /** The rank of this dashboard. */ + rank?: number; + /** The URL of these dashboard details. */ + self?: string; + /** The details of any view share permissions for the dashboard. */ + sharePermissions?: SharePermission[]; + /** The details of any edit share permissions for the dashboard. */ + editPermissions?: SharePermission[]; + /** The automatic refresh interval for the dashboard in milliseconds. */ + automaticRefreshMs?: number; + /** The URL of the dashboard. */ + view?: string; + /** Whether the current user has permission to edit the dashboard. */ + isWritable?: boolean; + /** Whether the current dashboard is system dashboard. */ + systemDashboard?: boolean; +} diff --git a/src/version3/models/dashboard.ts b/src/version3/models/dashboard.ts deleted file mode 100644 index e680128cc0..0000000000 --- a/src/version3/models/dashboard.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { DashboardUser } from './dashboardUser'; -import { SharePermission } from './sharePermission'; - -/** Details of a dashboard. */ -export interface Dashboard { - description?: string; - /** The ID of the dashboard. */ - id: string; - /** Whether the dashboard is selected as a favorite by the user. */ - isFavourite?: boolean; - /** The name of the dashboard. */ - name?: string; - owner?: DashboardUser; - /** The number of users who have this dashboard as a favorite. */ - popularity?: number; - /** The rank of this dashboard. */ - rank?: number; - /** The URL of these dashboard details. */ - self?: string; - /** The details of any view share permissions for the dashboard. */ - sharePermissions?: SharePermission[]; - /** The details of any edit share permissions for the dashboard. */ - editPermissions?: SharePermission[]; - /** The automatic refresh interval for the dashboard in milliseconds. */ - automaticRefreshMs?: number; - /** The URL of the dashboard. */ - view?: string; - /** Whether the current user has permission to edit the dashboard. */ - isWritable?: boolean; - /** Whether the current dashboard is system dashboard. */ - systemDashboard?: boolean; -} diff --git a/src/version3/models/dashboardDetails.mts b/src/version3/models/dashboardDetails.mts new file mode 100644 index 0000000000..30c35525ea --- /dev/null +++ b/src/version3/models/dashboardDetails.mts @@ -0,0 +1,13 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details of a dashboard. */ +export interface DashboardDetails { + /** The name of the dashboard. */ + name: string; + /** The description of the dashboard. */ + description?: string; + /** The share permissions for the dashboard. */ + sharePermissions: SharePermission[]; + /** The edit permissions for the dashboard. */ + editPermissions: SharePermission[]; +} diff --git a/src/version3/models/dashboardDetails.ts b/src/version3/models/dashboardDetails.ts deleted file mode 100644 index a3c0987838..0000000000 --- a/src/version3/models/dashboardDetails.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { SharePermission } from './sharePermission'; - -/** Details of a dashboard. */ -export interface DashboardDetails { - /** The name of the dashboard. */ - name: string; - /** The description of the dashboard. */ - description?: string; - /** The share permissions for the dashboard. */ - sharePermissions: SharePermission[]; - /** The edit permissions for the dashboard. */ - editPermissions: SharePermission[]; -} diff --git a/src/version3/models/dashboardGadget.mts b/src/version3/models/dashboardGadget.mts new file mode 100644 index 0000000000..b4cc36a039 --- /dev/null +++ b/src/version3/models/dashboardGadget.mts @@ -0,0 +1,16 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of a gadget. */ +export interface DashboardGadget { + /** The ID of the gadget instance. */ + id: number; + /** The module key of the gadget type. */ + moduleKey?: string; + /** The URI of the gadget type. */ + uri?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title: string; +} diff --git a/src/version3/models/dashboardGadget.ts b/src/version3/models/dashboardGadget.ts deleted file mode 100644 index b1762a4387..0000000000 --- a/src/version3/models/dashboardGadget.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** Details of a gadget. */ -export interface DashboardGadget { - /** The ID of the gadget instance. */ - id: number; - /** The module key of the gadget type. */ - moduleKey?: string; - /** The URI of the gadget type. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title: string; -} diff --git a/src/version3/models/dashboardGadgetPosition.ts b/src/version3/models/dashboardGadgetPosition.mts similarity index 100% rename from src/version3/models/dashboardGadgetPosition.ts rename to src/version3/models/dashboardGadgetPosition.mts diff --git a/src/version3/models/dashboardGadgetResponse.mts b/src/version3/models/dashboardGadgetResponse.mts new file mode 100644 index 0000000000..8d8d2c3bbf --- /dev/null +++ b/src/version3/models/dashboardGadgetResponse.mts @@ -0,0 +1,7 @@ +import { DashboardGadget } from './dashboardGadget.mjs'; + +/** The list of gadgets on the dashboard. */ +export interface DashboardGadgetResponse { + /** The list of gadgets. */ + gadgets: DashboardGadget[]; +} diff --git a/src/version3/models/dashboardGadgetResponse.ts b/src/version3/models/dashboardGadgetResponse.ts deleted file mode 100644 index 8b1d537985..0000000000 --- a/src/version3/models/dashboardGadgetResponse.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DashboardGadget } from './dashboardGadget'; - -/** The list of gadgets on the dashboard. */ -export interface DashboardGadgetResponse { - /** The list of gadgets. */ - gadgets: DashboardGadget[]; -} diff --git a/src/version3/models/dashboardGadgetSettings.mts b/src/version3/models/dashboardGadgetSettings.mts new file mode 100644 index 0000000000..22124a35e7 --- /dev/null +++ b/src/version3/models/dashboardGadgetSettings.mts @@ -0,0 +1,19 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** Details of the settings for a dashboard gadget. */ +export interface DashboardGadgetSettings { + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey?: string; + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: string; + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title?: string; + /** + * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an + * application that isn't installed. + */ + ignoreUriAndModuleKeyValidation?: boolean; +} diff --git a/src/version3/models/dashboardGadgetSettings.ts b/src/version3/models/dashboardGadgetSettings.ts deleted file mode 100644 index af9d3319fc..0000000000 --- a/src/version3/models/dashboardGadgetSettings.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** Details of the settings for a dashboard gadget. */ -export interface DashboardGadgetSettings { - /** The module key of the gadget type. Can't be provided with `uri`. */ - moduleKey?: string; - /** The URI of the gadget type. Can't be provided with `moduleKey`. */ - uri?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: string; - position?: DashboardGadgetPosition; - /** The title of the gadget. */ - title?: string; - /** - * Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an - * application that isn't installed. - */ - ignoreUriAndModuleKeyValidation?: boolean; -} diff --git a/src/version3/models/dashboardGadgetUpdateRequest.mts b/src/version3/models/dashboardGadgetUpdateRequest.mts new file mode 100644 index 0000000000..436e2c12ed --- /dev/null +++ b/src/version3/models/dashboardGadgetUpdateRequest.mts @@ -0,0 +1,10 @@ +import { DashboardGadgetPosition } from './dashboardGadgetPosition.mjs'; + +/** The details of the gadget to update. */ +export interface DashboardGadgetUpdateRequest { + /** The title of the gadget. */ + title?: string; + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: string; + position?: DashboardGadgetPosition; +} diff --git a/src/version3/models/dashboardGadgetUpdateRequest.ts b/src/version3/models/dashboardGadgetUpdateRequest.ts deleted file mode 100644 index 18e9c2834a..0000000000 --- a/src/version3/models/dashboardGadgetUpdateRequest.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { DashboardGadgetPosition } from './dashboardGadgetPosition'; - -/** The details of the gadget to update. */ -export interface DashboardGadgetUpdateRequest { - /** The title of the gadget. */ - title?: string; - /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ - color?: string; - position?: DashboardGadgetPosition; -} diff --git a/src/version3/models/dashboardUser.mts b/src/version3/models/dashboardUser.mts new file mode 100644 index 0000000000..723c864d5e --- /dev/null +++ b/src/version3/models/dashboardUser.mts @@ -0,0 +1,16 @@ +import { UserAvatarUrls } from './userAvatarUrls.mjs'; + +export interface DashboardUser { + /** The URL of the user. */ + self?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + avatarUrls?: UserAvatarUrls; +} diff --git a/src/version3/models/dashboardUser.ts b/src/version3/models/dashboardUser.ts deleted file mode 100644 index 8907f7d266..0000000000 --- a/src/version3/models/dashboardUser.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { UserAvatarUrls } from './userAvatarUrls'; - -export interface DashboardUser { - /** The URL of the user. */ - self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - avatarUrls?: UserAvatarUrls; -} diff --git a/src/version3/models/dateRangeFilter.ts b/src/version3/models/dateRangeFilter.mts similarity index 100% rename from src/version3/models/dateRangeFilter.ts rename to src/version3/models/dateRangeFilter.mts diff --git a/src/version3/models/defaultLevelValue.ts b/src/version3/models/defaultLevelValue.mts similarity index 100% rename from src/version3/models/defaultLevelValue.ts rename to src/version3/models/defaultLevelValue.mts diff --git a/src/version3/models/defaultShareScope.ts b/src/version3/models/defaultShareScope.mts similarity index 100% rename from src/version3/models/defaultShareScope.ts rename to src/version3/models/defaultShareScope.mts diff --git a/src/version3/models/defaultWorkflow.ts b/src/version3/models/defaultWorkflow.mts similarity index 100% rename from src/version3/models/defaultWorkflow.ts rename to src/version3/models/defaultWorkflow.mts diff --git a/src/version3/models/deleteAndReplaceVersion.mts b/src/version3/models/deleteAndReplaceVersion.mts new file mode 100644 index 0000000000..0c7b47a6d1 --- /dev/null +++ b/src/version3/models/deleteAndReplaceVersion.mts @@ -0,0 +1,13 @@ +import { CustomFieldReplacement } from './customFieldReplacement.mjs'; + +export interface DeleteAndReplaceVersion { + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ + moveFixIssuesTo?: number; + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ + moveAffectedIssuesTo?: number; + /** + * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the + * deleted version. + */ + customFieldReplacementList?: CustomFieldReplacement[]; +} diff --git a/src/version3/models/deleteAndReplaceVersion.ts b/src/version3/models/deleteAndReplaceVersion.ts deleted file mode 100644 index 53b597f3ce..0000000000 --- a/src/version3/models/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { CustomFieldReplacement } from './customFieldReplacement'; - -export interface DeleteAndReplaceVersion { - /** The ID of the version to update `fixVersion` to when the field contains the deleted version. */ - moveFixIssuesTo?: number; - /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. */ - moveAffectedIssuesTo?: number; - /** - * An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the - * deleted version. - */ - customFieldReplacementList?: CustomFieldReplacement[]; -} diff --git a/src/version3/models/document.mts b/src/version3/models/document.mts new file mode 100644 index 0000000000..0a06475deb --- /dev/null +++ b/src/version3/models/document.mts @@ -0,0 +1,33 @@ +import { Mark } from './mark.mjs'; + +export interface Document { + type: + | 'doc' + | 'paragraph' + | 'table' + | 'blockquote' + | 'bulletList' + | 'codeBlock' + | 'heading' + | 'mediaGroup' + | 'mediaSingle' + | 'orderedList' + | 'panel' + | 'rule' + | 'listItem' + | 'media' + | 'table_cell' + | 'table_header' + | 'table_row' + | 'emoji' + | 'hardBreak' + | 'inlineCard' + | 'mention' + | 'text' + | string; + content?: Omit[]; + version: number; + marks?: Mark[]; + attrs?: any; + text?: string; +} diff --git a/src/version3/models/document.ts b/src/version3/models/document.ts deleted file mode 100644 index 6797ef8e0e..0000000000 --- a/src/version3/models/document.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Mark } from './mark'; - -export interface Document { - type: - | 'doc' - | 'paragraph' - | 'table' - | 'blockquote' - | 'bulletList' - | 'codeBlock' - | 'heading' - | 'mediaGroup' - | 'mediaSingle' - | 'orderedList' - | 'panel' - | 'rule' - | 'listItem' - | 'media' - | 'table_cell' - | 'table_header' - | 'table_row' - | 'emoji' - | 'hardBreak' - | 'inlineCard' - | 'mention' - | 'text' - | string; - content?: Omit[]; - version: number; - marks?: Mark[]; - attrs?: any; - text?: string; -} diff --git a/src/version3/models/entityProperty.ts b/src/version3/models/entityProperty.mts similarity index 100% rename from src/version3/models/entityProperty.ts rename to src/version3/models/entityProperty.mts diff --git a/src/version3/models/entityPropertyDetails.ts b/src/version3/models/entityPropertyDetails.mts similarity index 100% rename from src/version3/models/entityPropertyDetails.ts rename to src/version3/models/entityPropertyDetails.mts diff --git a/src/version3/models/error.ts b/src/version3/models/error.mts similarity index 100% rename from src/version3/models/error.ts rename to src/version3/models/error.mts diff --git a/src/version3/models/errorCollection.ts b/src/version3/models/errorCollection.mts similarity index 100% rename from src/version3/models/errorCollection.ts rename to src/version3/models/errorCollection.mts diff --git a/src/version3/models/errors.mts b/src/version3/models/errors.mts new file mode 100644 index 0000000000..f185578248 --- /dev/null +++ b/src/version3/models/errors.mts @@ -0,0 +1,8 @@ +import { Error } from './error.mjs'; + +export interface Errors { + issueIsSubtask?: Error; + issuesInArchivedProjects?: Error; + issuesInUnlicensedProjects?: Error; + issuesNotFound?: Error; +} diff --git a/src/version3/models/errors.ts b/src/version3/models/errors.ts deleted file mode 100644 index bc20bd9dd8..0000000000 --- a/src/version3/models/errors.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Error } from './error'; - -export interface Errors { - issueIsSubtask?: Error; - issuesInArchivedProjects?: Error; - issuesInUnlicensedProjects?: Error; - issuesNotFound?: Error; -} diff --git a/src/version3/models/eventNotification.mts b/src/version3/models/eventNotification.mts new file mode 100644 index 0000000000..d8519589cb --- /dev/null +++ b/src/version3/models/eventNotification.mts @@ -0,0 +1,39 @@ +import { FieldDetails } from './fieldDetails.mjs'; +import type { GroupName } from './groupName.mjs'; +import type { ProjectRole } from './projectRole.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details about a notification associated with an event. */ +export interface EventNotification { + /** Expand options that include additional event notification details in the response. */ + expand?: string; + /** The ID of the notification. */ + id?: number; + /** Identifies the recipients of the notification. */ + notificationType?: string; + /** + * As a group's name can change, use of `recipient` is recommended. The identifier associated with the + * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by + * `notificationType` value. So, when `notificationType` is: + * + * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The + * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. + * `GroupCustomField` The `parameter` is the ID of the custom field. + */ + parameter?: string; + /** + * The identifier associated with the `notificationType` value that defines the receiver of the notification, where + * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: + * + * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the + * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is + * the ID of the custom field. + */ + recipient?: string; + group?: GroupName; + field?: FieldDetails; + /** The email address. */ + emailAddress?: string; + projectRole?: ProjectRole; + user?: UserDetails; +} diff --git a/src/version3/models/eventNotification.ts b/src/version3/models/eventNotification.ts deleted file mode 100644 index 81b51a1551..0000000000 --- a/src/version3/models/eventNotification.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { FieldDetails } from './fieldDetails'; -import { GroupName } from './groupName'; -import { ProjectRole } from './projectRole'; -import { UserDetails } from './userDetails'; - -/** Details about a notification associated with an event. */ -export interface EventNotification { - /** Expand options that include additional event notification details in the response. */ - expand?: string; - /** The ID of the notification. */ - id?: number; - /** Identifies the recipients of the notification. */ - notificationType?: string; - /** - * As a group's name can change, use of `recipient` is recommended. The identifier associated with the - * `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by - * `notificationType` value. So, when `notificationType` is: - * - * `User` The `parameter` is the user account ID. `Group` The `parameter` is the group name. `ProjectRole` The - * `parameter` is the project role ID. `UserCustomField` The `parameter` is the ID of the custom field. - * `GroupCustomField` The `parameter` is the ID of the custom field. - */ - parameter?: string; - /** - * The identifier associated with the `notificationType` value that defines the receiver of the notification, where - * the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: - * - * `User`, `recipient` is the user account ID. `Group`, `recipient` is the group ID. `ProjectRole`, `recipient` is the - * project role ID. `UserCustomField`, `recipient` is the ID of the custom field. `GroupCustomField`, `recipient` is - * the ID of the custom field. - */ - recipient?: string; - group?: GroupName; - field?: FieldDetails; - /** The email address. */ - emailAddress?: string; - projectRole?: ProjectRole; - user?: UserDetails; -} diff --git a/src/version3/models/exportArchivedIssuesTaskProgress.ts b/src/version3/models/exportArchivedIssuesTaskProgress.mts similarity index 100% rename from src/version3/models/exportArchivedIssuesTaskProgress.ts rename to src/version3/models/exportArchivedIssuesTaskProgress.mts diff --git a/src/version3/models/failedWebhook.ts b/src/version3/models/failedWebhook.mts similarity index 100% rename from src/version3/models/failedWebhook.ts rename to src/version3/models/failedWebhook.mts diff --git a/src/version3/models/failedWebhooks.mts b/src/version3/models/failedWebhooks.mts new file mode 100644 index 0000000000..d22ea57693 --- /dev/null +++ b/src/version3/models/failedWebhooks.mts @@ -0,0 +1,18 @@ +import { FailedWebhook } from './failedWebhook.mjs'; + +/** A page of failed webhooks. */ +export interface FailedWebhooks { + /** The list of webhooks. */ + values: FailedWebhook[]; + /** + * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more + * pages. + */ + maxResults: number; + /** + * The URL to the next page of results. Present only if the request returned at least one result.The next page may be + * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to + * the next page and query for new results periodically (for example, every hour). + */ + next?: string; +} diff --git a/src/version3/models/failedWebhooks.ts b/src/version3/models/failedWebhooks.ts deleted file mode 100644 index a3f2da5e0d..0000000000 --- a/src/version3/models/failedWebhooks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { FailedWebhook } from './failedWebhook'; - -/** A page of failed webhooks. */ -export interface FailedWebhooks { - /** The list of webhooks. */ - values: FailedWebhook[]; - /** - * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more - * pages. - */ - maxResults: number; - /** - * The URL to the next page of results. Present only if the request returned at least one result.The next page may be - * empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to - * the next page and query for new results periodically (for example, every hour). - */ - next?: string; -} diff --git a/src/version3/models/field.mts b/src/version3/models/field.mts new file mode 100644 index 0000000000..4d3c7d50cd --- /dev/null +++ b/src/version3/models/field.mts @@ -0,0 +1,26 @@ +import { FieldLastUsed } from './fieldLastUsed.mjs'; +import { JsonType } from './jsonType.mjs'; + +/** Details of a field. */ +export interface Field { + /** The ID of the field. */ + id: string; + /** The name of the field. */ + name: string; + schema: JsonType; + /** The description of the field. */ + description?: string; + /** The key of the field. */ + key?: string; + /** Whether the field is locked. */ + isLocked?: boolean; + /** Whether the field is shown on screen or not. */ + isUnscreenable?: boolean; + /** The searcher key of the field. Returned for custom fields. */ + searcherKey?: string; + /** Number of screens where the field is used. */ + screensCount?: number; + /** Number of contexts where the field is used. */ + contextsCount?: number; + lastUsed?: FieldLastUsed; +} diff --git a/src/version3/models/field.ts b/src/version3/models/field.ts deleted file mode 100644 index 1b4651fcba..0000000000 --- a/src/version3/models/field.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { FieldLastUsed } from './fieldLastUsed'; -import { JsonType } from './jsonType'; - -/** Details of a field. */ -export interface Field { - /** The ID of the field. */ - id: string; - /** The name of the field. */ - name: string; - schema: JsonType; - /** The description of the field. */ - description?: string; - /** The key of the field. */ - key?: string; - /** Whether the field is locked. */ - isLocked?: boolean; - /** Whether the field is shown on screen or not. */ - isUnscreenable?: boolean; - /** The searcher key of the field. Returned for custom fields. */ - searcherKey?: string; - /** Number of screens where the field is used. */ - screensCount?: number; - /** Number of contexts where the field is used. */ - contextsCount?: number; - lastUsed?: FieldLastUsed; -} diff --git a/src/version3/models/fieldConfiguration.ts b/src/version3/models/fieldConfiguration.mts similarity index 100% rename from src/version3/models/fieldConfiguration.ts rename to src/version3/models/fieldConfiguration.mts diff --git a/src/version3/models/fieldConfigurationDetails.ts b/src/version3/models/fieldConfigurationDetails.mts similarity index 100% rename from src/version3/models/fieldConfigurationDetails.ts rename to src/version3/models/fieldConfigurationDetails.mts diff --git a/src/version3/models/fieldConfigurationIssueTypeItem.ts b/src/version3/models/fieldConfigurationIssueTypeItem.mts similarity index 100% rename from src/version3/models/fieldConfigurationIssueTypeItem.ts rename to src/version3/models/fieldConfigurationIssueTypeItem.mts diff --git a/src/version3/models/fieldConfigurationItem.ts b/src/version3/models/fieldConfigurationItem.mts similarity index 100% rename from src/version3/models/fieldConfigurationItem.ts rename to src/version3/models/fieldConfigurationItem.mts diff --git a/src/version3/models/fieldConfigurationItemsDetails.mts b/src/version3/models/fieldConfigurationItemsDetails.mts new file mode 100644 index 0000000000..05d214a2ce --- /dev/null +++ b/src/version3/models/fieldConfigurationItemsDetails.mts @@ -0,0 +1,7 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** Details of field configuration items. */ +export interface FieldConfigurationItemsDetails { + /** Details of fields in a field configuration. */ + fieldConfigurationItems: FieldConfigurationItem[]; +} diff --git a/src/version3/models/fieldConfigurationItemsDetails.ts b/src/version3/models/fieldConfigurationItemsDetails.ts deleted file mode 100644 index 47685e551b..0000000000 --- a/src/version3/models/fieldConfigurationItemsDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { FieldConfigurationItem } from './fieldConfigurationItem'; - -/** Details of field configuration items. */ -export interface FieldConfigurationItemsDetails { - /** Details of fields in a field configuration. */ - fieldConfigurationItems: FieldConfigurationItem[]; -} diff --git a/src/version3/models/fieldConfigurationScheme.ts b/src/version3/models/fieldConfigurationScheme.mts similarity index 100% rename from src/version3/models/fieldConfigurationScheme.ts rename to src/version3/models/fieldConfigurationScheme.mts diff --git a/src/version3/models/fieldConfigurationSchemeProjectAssociation.ts b/src/version3/models/fieldConfigurationSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/fieldConfigurationSchemeProjectAssociation.ts rename to src/version3/models/fieldConfigurationSchemeProjectAssociation.mts diff --git a/src/version3/models/fieldConfigurationSchemeProjects.mts b/src/version3/models/fieldConfigurationSchemeProjects.mts new file mode 100644 index 0000000000..18d456c99f --- /dev/null +++ b/src/version3/models/fieldConfigurationSchemeProjects.mts @@ -0,0 +1,8 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** Project list with assigned field configuration schema. */ +export interface FieldConfigurationSchemeProjects { + fieldConfigurationScheme?: FieldConfigurationScheme; + /** The IDs of projects using the field configuration scheme. */ + projectIds: string[]; +} diff --git a/src/version3/models/fieldConfigurationSchemeProjects.ts b/src/version3/models/fieldConfigurationSchemeProjects.ts deleted file mode 100644 index cb59fdaf8d..0000000000 --- a/src/version3/models/fieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FieldConfigurationScheme } from './fieldConfigurationScheme'; - -/** Project list with assigned field configuration schema. */ -export interface FieldConfigurationSchemeProjects { - fieldConfigurationScheme?: FieldConfigurationScheme; - /** The IDs of projects using the field configuration scheme. */ - projectIds: string[]; -} diff --git a/src/version3/models/fieldConfigurationToIssueTypeMapping.ts b/src/version3/models/fieldConfigurationToIssueTypeMapping.mts similarity index 100% rename from src/version3/models/fieldConfigurationToIssueTypeMapping.ts rename to src/version3/models/fieldConfigurationToIssueTypeMapping.mts diff --git a/src/version3/models/fieldDetails.mts b/src/version3/models/fieldDetails.mts new file mode 100644 index 0000000000..28074d3c12 --- /dev/null +++ b/src/version3/models/fieldDetails.mts @@ -0,0 +1,27 @@ +import { JsonType } from './jsonType.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a field. */ +export interface FieldDetails { + /** The ID of the field. */ + id?: string; + /** The key of the field. */ + key?: string; + /** The name of the field. */ + name?: string; + /** Whether the field is a custom field. */ + custom?: boolean; + /** Whether the content of the field can be used to order lists. */ + orderable?: boolean; + /** Whether the field can be used as a column on the issue navigator. */ + navigable?: boolean; + /** Whether the content of the field can be searched. */ + searchable?: boolean; + /** + * The names that can be used to reference the field in an advanced search. For more information, see [Advanced + * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). + */ + clauseNames?: string[]; + scope?: Scope; + schema?: JsonType; +} diff --git a/src/version3/models/fieldDetails.ts b/src/version3/models/fieldDetails.ts deleted file mode 100644 index b785053166..0000000000 --- a/src/version3/models/fieldDetails.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { JsonType } from './jsonType'; -import { Scope } from './scope'; - -/** Details about a field. */ -export interface FieldDetails { - /** The ID of the field. */ - id?: string; - /** The key of the field. */ - key?: string; - /** The name of the field. */ - name?: string; - /** Whether the field is a custom field. */ - custom?: boolean; - /** Whether the content of the field can be used to order lists. */ - orderable?: boolean; - /** Whether the field can be used as a column on the issue navigator. */ - navigable?: boolean; - /** Whether the content of the field can be searched. */ - searchable?: boolean; - /** - * The names that can be used to reference the field in an advanced search. For more information, see [Advanced - * searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). - */ - clauseNames?: string[]; - scope?: Scope; - schema?: JsonType; -} diff --git a/src/version3/models/fieldLastUsed.ts b/src/version3/models/fieldLastUsed.mts similarity index 100% rename from src/version3/models/fieldLastUsed.ts rename to src/version3/models/fieldLastUsed.mts diff --git a/src/version3/models/fieldReferenceData.ts b/src/version3/models/fieldReferenceData.mts similarity index 100% rename from src/version3/models/fieldReferenceData.ts rename to src/version3/models/fieldReferenceData.mts diff --git a/src/version3/models/fields.mts b/src/version3/models/fields.mts new file mode 100644 index 0000000000..3bd9a0715b --- /dev/null +++ b/src/version3/models/fields.mts @@ -0,0 +1,85 @@ +import type { Attachment } from './attachment.mjs'; +import type { Comment } from './comment.mjs'; +import type { Document } from './document.mjs'; +import type { FixVersion } from './fixVersion.mjs'; +import type { Issue } from './issue.mjs'; +import type { IssueLink } from './issueLink.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { Priority } from './priority.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { Resolution } from './resolution.mjs'; +import type { RichText } from './richText.mjs'; +import type { StatusDetails } from './statusDetails.mjs'; +import type { TimeTrackingDetails } from './timeTrackingDetails.mjs'; +import type { User } from './user.mjs'; +import type { UserDetails } from './userDetails.mjs'; +import type { Votes } from './votes.mjs'; +import type { Watchers } from './watchers.mjs'; +import type { Worklog } from './worklog.mjs'; + +/** Key fields from the linked issue. */ +export interface Fields { + /** The estimate of how much longer working on the issue will take, in seconds. */ + aggregatetimespent: number | null; + /** The assignee of the linked issue. */ + assignee: UserDetails; + /** The time the issue is due. */ + duedate: string | null; + /** The list of versions where the issue was fixed. */ + fixVersions: FixVersion[]; + lastViewed: string | null; + /** The issue parent. */ + parent?: Issue; + /** The priority of the linked issue. */ + priority: Priority; + /** The resolution of the issue. */ + resolution: Resolution | null; + /** The time the issue was resolved at. */ + resolutiondate: string | null; + /** The status of the linked issue. */ + status: StatusDetails; + /** The summary description of the linked issue. */ + summary: string; + /** The time that was spent working on the issue, in seconds. */ + timespent: number | null; + /** The time tracking of the linked issue. */ + timetracking: TimeTrackingDetails; + /** The type of the linked issue. */ + issuetype?: IssueTypeDetails; + /** The type of the linked issue. */ + issueType?: IssueTypeDetails; + environment: RichText | null; + issuelinks: IssueLink[]; + workratio: number; + issuerestriction?: { + issuerestrictions: any; + shouldDisplay: boolean; + }; + watches: Watchers; + created: string; + labels: string[]; + updated: string; + components: ProjectComponent[]; + timeoriginalestimate?: any; + description?: Document; + attachment: Attachment[]; + creator: User; + subtasks: Issue[]; + reporter: User; + comment: { + comments: Comment[]; + self: string; + maxResults: number; + total: number; + startAt: number; + }; + votes: Votes & { voters: never }; + worklog: { + startAt: number; + maxResults: number; + total: number; + worklogs: Worklog[]; + }; + + [key: string]: any; +} diff --git a/src/version3/models/fields.ts b/src/version3/models/fields.ts deleted file mode 100644 index 8ae63d5a0e..0000000000 --- a/src/version3/models/fields.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { Attachment } from './attachment'; -import { Comment } from './comment'; -import { Document } from './document'; -import { FixVersion } from './fixVersion'; -import { Issue } from './issue'; -import { IssueLink } from './issueLink'; -import { IssueTypeDetails } from './issueTypeDetails'; -import { Priority } from './priority'; -import { ProjectComponent } from './projectComponent'; -import { Resolution } from './resolution'; -import { RichText } from './richText'; -import { StatusDetails } from './statusDetails'; -import { TimeTrackingDetails } from './timeTrackingDetails'; -import { User } from './user'; -import { UserDetails } from './userDetails'; -import { Votes } from './votes'; -import { Watchers } from './watchers'; -import { Worklog } from './worklog'; - -/** Key fields from the linked issue. */ -export interface Fields { - /** The estimate of how much longer working on the issue will take, in seconds. */ - aggregatetimespent: number | null; - /** The assignee of the linked issue. */ - assignee: UserDetails; - /** The time the issue is due. */ - duedate: string | null; - /** The list of versions where the issue was fixed. */ - fixVersions: FixVersion[]; - lastViewed: string | null; - /** The issue parent. */ - parent?: Issue; - /** The priority of the linked issue. */ - priority: Priority; - /** The resolution of the issue. */ - resolution: Resolution | null; - /** The time the issue was resolved at. */ - resolutiondate: string | null; - /** The status of the linked issue. */ - status: StatusDetails; - /** The summary description of the linked issue. */ - summary: string; - /** The time that was spent working on the issue, in seconds. */ - timespent: number | null; - /** The time tracking of the linked issue. */ - timetracking: TimeTrackingDetails; - /** The type of the linked issue. */ - issuetype?: IssueTypeDetails; - /** The type of the linked issue. */ - issueType?: IssueTypeDetails; - environment: RichText | null; - issuelinks: IssueLink[]; - workratio: number; - issuerestriction?: { - issuerestrictions: any; - shouldDisplay: boolean; - }; - watches: Watchers; - created: string; - labels: string[]; - updated: string; - components: ProjectComponent[]; - timeoriginalestimate?: any; - description?: Document; - attachment: Attachment[]; - creator: User; - subtasks: Issue[]; - reporter: User; - comment: { - comments: Comment[]; - self: string; - maxResults: number; - total: number; - startAt: number; - }; - votes: Votes & { voters: never }; - worklog: { - startAt: number; - maxResults: number; - total: number; - worklogs: Worklog[]; - }; - - [key: string]: any; -} diff --git a/src/version3/models/filter.mts b/src/version3/models/filter.mts new file mode 100644 index 0000000000..2fac694edf --- /dev/null +++ b/src/version3/models/filter.mts @@ -0,0 +1,40 @@ +import { FilterSubscriptionsList } from './filterSubscriptionsList.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; +import { UserList } from './userList.mjs'; + +/** Details about a filter. */ +export interface Filter { + /** The URL of the filter. */ + self?: string; + /** The unique identifier for the filter. */ + id?: 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 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; +} diff --git a/src/version3/models/filter.ts b/src/version3/models/filter.ts deleted file mode 100644 index 11b5afeac0..0000000000 --- a/src/version3/models/filter.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { FilterSubscriptionsList } from './filterSubscriptionsList'; -import { SharePermission } from './sharePermission'; -import { User } from './user'; -import { UserList } from './userList'; - -/** Details about a filter. */ -export interface Filter { - /** The URL of the filter. */ - self?: string; - /** The unique identifier for the filter. */ - id?: 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 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; -} diff --git a/src/version3/models/filterDetails.mts b/src/version3/models/filterDetails.mts new file mode 100644 index 0000000000..c440b6df5d --- /dev/null +++ b/src/version3/models/filterDetails.mts @@ -0,0 +1,47 @@ +import { FilterSubscription } from './filterSubscription.mjs'; +import type { SharePermission } from './sharePermission.mjs'; +import { User } from './user.mjs'; + +/** Details of a filter. */ +export interface FilterDetails { + /** Expand options that include additional filter details in the response. */ + expand?: string; + /** The URL of the filter. */ + self?: string; + /** The unique identifier for the filter. */ + id?: string; + /** The name of the filter. */ + name: string; + /** The 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 by any users, not including the filter owner. */ + favourite?: boolean; + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount?: number; + /** + * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when + * creating a filter. + */ + sharePermissions?: SharePermission[]; + /** + * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when + * creating a filter. + */ + editPermissions?: SharePermission[]; + /** The users that are subscribed to the filter. */ + subscriptions?: FilterSubscription[]; +} diff --git a/src/version3/models/filterDetails.ts b/src/version3/models/filterDetails.ts deleted file mode 100644 index 3d133f3f3b..0000000000 --- a/src/version3/models/filterDetails.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { FilterSubscription } from './filterSubscription'; -import { SharePermission } from './sharePermission'; -import { User } from './user'; - -/** Details of a filter. */ -export interface FilterDetails { - /** Expand options that include additional filter details in the response. */ - expand?: string; - /** The URL of the filter. */ - self?: string; - /** The unique identifier for the filter. */ - id?: string; - /** The name of the filter. */ - name: string; - /** The 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 by any users, not including the filter owner. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; - /** - * The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when - * creating a filter. - */ - sharePermissions?: SharePermission[]; - /** - * The groups and projects that can edit the filter. This can be specified when updating a filter, but not when - * creating a filter. - */ - editPermissions?: SharePermission[]; - /** The users that are subscribed to the filter. */ - subscriptions?: FilterSubscription[]; -} diff --git a/src/version3/models/filterSubscription.mts b/src/version3/models/filterSubscription.mts new file mode 100644 index 0000000000..edfbee7a4e --- /dev/null +++ b/src/version3/models/filterSubscription.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import { User } from './user.mjs'; + +/** Details of a user or group subscribing to a filter. */ +export interface FilterSubscription { + /** The ID of the filter subscription. */ + id?: number; + user?: User; + group?: GroupName; +} diff --git a/src/version3/models/filterSubscription.ts b/src/version3/models/filterSubscription.ts deleted file mode 100644 index 8eb67d5a15..0000000000 --- a/src/version3/models/filterSubscription.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GroupName } from './groupName'; -import { User } from './user'; - -/** Details of a user or group subscribing to a filter. */ -export interface FilterSubscription { - /** The ID of the filter subscription. */ - id?: number; - user?: User; - group?: GroupName; -} diff --git a/src/version3/models/filterSubscriptionsList.mts b/src/version3/models/filterSubscriptionsList.mts new file mode 100644 index 0000000000..cad7f466c5 --- /dev/null +++ b/src/version3/models/filterSubscriptionsList.mts @@ -0,0 +1,15 @@ +import { FilterSubscription } from './filterSubscription.mjs'; + +/** A paginated list of subscriptions to a filter. */ +export interface FilterSubscriptionsList { + /** The number of items on the page. */ + size?: number; + /** The list of items. */ + items?: FilterSubscription[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; + /** The index of the last item returned on the page. */ + 'end-index'?: number; +} diff --git a/src/version3/models/filterSubscriptionsList.ts b/src/version3/models/filterSubscriptionsList.ts deleted file mode 100644 index cf5d350a05..0000000000 --- a/src/version3/models/filterSubscriptionsList.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { FilterSubscription } from './filterSubscription'; - -/** A paginated list of subscriptions to a filter. */ -export interface FilterSubscriptionsList { - /** The number of items on the page. */ - size?: number; - /** The list of items. */ - items?: FilterSubscription[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; - /** The index of the last item returned on the page. */ - 'end-index'?: number; -} diff --git a/src/version3/models/fixVersion.ts b/src/version3/models/fixVersion.mts similarity index 100% rename from src/version3/models/fixVersion.ts rename to src/version3/models/fixVersion.mts diff --git a/src/version3/models/foundGroup.mts b/src/version3/models/foundGroup.mts new file mode 100644 index 0000000000..adb3b30d49 --- /dev/null +++ b/src/version3/models/foundGroup.mts @@ -0,0 +1,15 @@ +import { GroupLabel } from './groupLabel.mjs'; + +/** A group found in a search. */ +export interface FoundGroup { + /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ + name?: string; + /** The group name with the matched query string highlighted with the HTML bold tag. */ + html?: string; + labels?: GroupLabel[]; + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; +} diff --git a/src/version3/models/foundGroup.ts b/src/version3/models/foundGroup.ts deleted file mode 100644 index cda5992826..0000000000 --- a/src/version3/models/foundGroup.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { GroupLabel } from './groupLabel'; - -/** A group found in a search. */ -export interface FoundGroup { - /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ - name?: string; - /** The group name with the matched query string highlighted with the HTML bold tag. */ - html?: string; - labels?: GroupLabel[]; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; -} diff --git a/src/version3/models/foundGroups.mts b/src/version3/models/foundGroups.mts new file mode 100644 index 0000000000..0b579f839a --- /dev/null +++ b/src/version3/models/foundGroups.mts @@ -0,0 +1,13 @@ +import { FoundGroup } from './foundGroup.mjs'; + +/** + * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched + * groups. + */ +export interface FoundGroups { + /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ + header?: string; + /** The total number of groups found in the search. */ + total?: number; + groups?: FoundGroup[]; +} diff --git a/src/version3/models/foundGroups.ts b/src/version3/models/foundGroups.ts deleted file mode 100644 index 1b6c4a8317..0000000000 --- a/src/version3/models/foundGroups.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { FoundGroup } from './foundGroup'; - -/** - * The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched - * groups. - */ -export interface FoundGroups { - /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ - header?: string; - /** The total number of groups found in the search. */ - total?: number; - groups?: FoundGroup[]; -} diff --git a/src/version3/models/foundUsers.mts b/src/version3/models/foundUsers.mts new file mode 100644 index 0000000000..7bd91da2ba --- /dev/null +++ b/src/version3/models/foundUsers.mts @@ -0,0 +1,13 @@ +import { UserPickerUser } from './userPickerUser.mjs'; + +/** + * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched + * users. + */ +export interface FoundUsers { + users?: UserPickerUser[]; + /** The total number of users found in the search. */ + total?: number; + /** Header text indicating the number of users in the response and the total number of users found in the search. */ + header?: string; +} diff --git a/src/version3/models/foundUsers.ts b/src/version3/models/foundUsers.ts deleted file mode 100644 index 357b8df537..0000000000 --- a/src/version3/models/foundUsers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UserPickerUser } from './userPickerUser'; - -/** - * The list of users found in a search, including header text (Showing X of Y matching users) and total of matched - * users. - */ -export interface FoundUsers { - users?: UserPickerUser[]; - /** The total number of users found in the search. */ - total?: number; - /** Header text indicating the number of users in the response and the total number of users found in the search. */ - header?: string; -} diff --git a/src/version3/models/foundUsersAndGroups.mts b/src/version3/models/foundUsersAndGroups.mts new file mode 100644 index 0000000000..ff7cc45e4b --- /dev/null +++ b/src/version3/models/foundUsersAndGroups.mts @@ -0,0 +1,8 @@ +import { FoundGroups } from './foundGroups.mjs'; +import { FoundUsers } from './foundUsers.mjs'; + +/** List of users and groups found in a search. */ +export interface FoundUsersAndGroups { + users?: FoundUsers; + groups?: FoundGroups; +} diff --git a/src/version3/models/foundUsersAndGroups.ts b/src/version3/models/foundUsersAndGroups.ts deleted file mode 100644 index db6d1d4cdc..0000000000 --- a/src/version3/models/foundUsersAndGroups.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FoundGroups } from './foundGroups'; -import { FoundUsers } from './foundUsers'; - -/** List of users and groups found in a search. */ -export interface FoundUsersAndGroups { - users?: FoundUsers; - groups?: FoundGroups; -} diff --git a/src/version3/models/functionReferenceData.ts b/src/version3/models/functionReferenceData.mts similarity index 100% rename from src/version3/models/functionReferenceData.ts rename to src/version3/models/functionReferenceData.mts diff --git a/src/version3/models/globalScope.ts b/src/version3/models/globalScope.mts similarity index 100% rename from src/version3/models/globalScope.ts rename to src/version3/models/globalScope.mts diff --git a/src/version3/models/group.mts b/src/version3/models/group.mts new file mode 100644 index 0000000000..e81e0757ad --- /dev/null +++ b/src/version3/models/group.mts @@ -0,0 +1,16 @@ +import { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser.mjs'; + +export interface Group { + /** The name of group. */ + name?: string; + /** + * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, + * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. + */ + groupId?: string; + /** The URL for these group details. */ + self?: string; + users?: PagedListUserDetailsApplicationUser; + /** Expand options that include additional group details in the response. */ + expand?: string; +} diff --git a/src/version3/models/group.ts b/src/version3/models/group.ts deleted file mode 100644 index 1730ce2008..0000000000 --- a/src/version3/models/group.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PagedListUserDetailsApplicationUser } from './pagedListUserDetailsApplicationUser'; - -export interface Group { - /** The name of group. */ - name?: string; - /** - * The ID of the group, which uniquely identifies the group across all Atlassian products. For example, - * _952d12c3-5b5b-4d04-bb32-44d383afc4b2_. - */ - groupId?: string; - /** The URL for these group details. */ - self?: string; - users?: PagedListUserDetailsApplicationUser; - /** Expand options that include additional group details in the response. */ - expand?: string; -} diff --git a/src/version3/models/groupDetails.ts b/src/version3/models/groupDetails.mts similarity index 100% rename from src/version3/models/groupDetails.ts rename to src/version3/models/groupDetails.mts diff --git a/src/version3/models/groupLabel.ts b/src/version3/models/groupLabel.mts similarity index 100% rename from src/version3/models/groupLabel.ts rename to src/version3/models/groupLabel.mts diff --git a/src/version3/models/groupName.ts b/src/version3/models/groupName.mts similarity index 100% rename from src/version3/models/groupName.ts rename to src/version3/models/groupName.mts diff --git a/src/version3/models/hierarchy.mts b/src/version3/models/hierarchy.mts new file mode 100644 index 0000000000..e118049eb9 --- /dev/null +++ b/src/version3/models/hierarchy.mts @@ -0,0 +1,7 @@ +import { HierarchyLevel } from './hierarchyLevel.mjs'; + +/** The project issue type hierarchy. */ +export interface Hierarchy { + /** Details about the hierarchy level. */ + levels?: HierarchyLevel[]; +} diff --git a/src/version3/models/hierarchy.ts b/src/version3/models/hierarchy.ts deleted file mode 100644 index 96fa6cdd4f..0000000000 --- a/src/version3/models/hierarchy.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { HierarchyLevel } from './hierarchyLevel'; - -/** The project issue type hierarchy. */ -export interface Hierarchy { - /** Details about the hierarchy level. */ - levels?: HierarchyLevel[]; -} diff --git a/src/version3/models/hierarchyLevel.ts b/src/version3/models/hierarchyLevel.mts similarity index 100% rename from src/version3/models/hierarchyLevel.ts rename to src/version3/models/hierarchyLevel.mts diff --git a/src/version3/models/historyMetadata.mts b/src/version3/models/historyMetadata.mts new file mode 100644 index 0000000000..e8c0396b03 --- /dev/null +++ b/src/version3/models/historyMetadata.mts @@ -0,0 +1,24 @@ +import { HistoryMetadataParticipant } from './historyMetadataParticipant.mjs'; + +/** Details of issue history metadata. */ +export interface HistoryMetadata { + /** The type of the history record. */ + type?: string; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + actor?: HistoryMetadataParticipant; + generator?: HistoryMetadataParticipant; + cause?: HistoryMetadataParticipant; + /** Additional arbitrary information about the history record. */ + extraData?: {}; +} diff --git a/src/version3/models/historyMetadata.ts b/src/version3/models/historyMetadata.ts deleted file mode 100644 index ff27d2ce33..0000000000 --- a/src/version3/models/historyMetadata.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { HistoryMetadataParticipant } from './historyMetadataParticipant'; - -/** Details of issue history metadata. */ -export interface HistoryMetadata { - /** The type of the history record. */ - type?: string; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; - /** The activity described in the history record. */ - activityDescription?: string; - /** The key of the activity described in the history record. */ - activityDescriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; - actor?: HistoryMetadataParticipant; - generator?: HistoryMetadataParticipant; - cause?: HistoryMetadataParticipant; - /** Additional arbitrary information about the history record. */ - extraData?: {}; -} diff --git a/src/version3/models/historyMetadataParticipant.ts b/src/version3/models/historyMetadataParticipant.mts similarity index 100% rename from src/version3/models/historyMetadataParticipant.ts rename to src/version3/models/historyMetadataParticipant.mts diff --git a/src/version3/models/icon.ts b/src/version3/models/icon.mts similarity index 100% rename from src/version3/models/icon.ts rename to src/version3/models/icon.mts diff --git a/src/version3/models/id.ts b/src/version3/models/id.mts similarity index 100% rename from src/version3/models/id.ts rename to src/version3/models/id.mts diff --git a/src/version3/models/idOrKey.ts b/src/version3/models/idOrKey.mts similarity index 100% rename from src/version3/models/idOrKey.ts rename to src/version3/models/idOrKey.mts diff --git a/src/version3/models/includedFields.ts b/src/version3/models/includedFields.mts similarity index 100% rename from src/version3/models/includedFields.ts rename to src/version3/models/includedFields.mts diff --git a/src/version3/models/index.mts b/src/version3/models/index.mts new file mode 100644 index 0000000000..1e5e385ebf --- /dev/null +++ b/src/version3/models/index.mts @@ -0,0 +1,510 @@ +export * from './actorInput.mjs'; +export * from './actorsMap.mjs'; +export * from './addField.mjs'; +export * from './addGroup.mjs'; +export * from './addSecuritySchemeLevelsRequest.mjs'; +export * from './announcementBannerConfiguration.mjs'; +export * from './announcementBannerConfigurationUpdate.mjs'; +export * from './application.mjs'; +export * from './applicationProperty.mjs'; +export * from './applicationRole.mjs'; +export * from './archiveIssueAsyncRequest.mjs'; +export * from './associatedItem.mjs'; +export * from './associateFieldConfigurationsWithIssueTypesRequest.mjs'; +export * from './attachment.mjs'; +export * from './attachmentArchiveEntry.mjs'; +export * from './attachmentArchiveImpl.mjs'; +export * from './attachmentArchiveItemReadable.mjs'; +export * from './attachmentArchiveMetadataReadable.mjs'; +export * from './attachmentMetadata.mjs'; +export * from './attachmentSettings.mjs'; +export * from './auditRecord.mjs'; +export * from './auditRecords.mjs'; +export * from './autoCompleteSuggestion.mjs'; +export * from './autoCompleteSuggestions.mjs'; +export * from './availableDashboardGadget.mjs'; +export * from './availableDashboardGadgetsResponse.mjs'; +export * from './avatar.mjs'; +export * from './avatars.mjs'; +export * from './avatarUrls.mjs'; +export * from './avatarWithDetails.mjs'; +export * from './bulkChangeOwnerDetails.mjs'; +export * from './bulkCustomFieldOptionCreateRequest.mjs'; +export * from './bulkCustomFieldOptionUpdateRequest.mjs'; +export * from './bulkEditShareableEntity.mjs'; +export * from './bulkIssueIsWatching.mjs'; +export * from './bulkIssuePropertyUpdateRequest.mjs'; +export * from './bulkOperationErrorResult.mjs'; +export * from './bulkPermissionGrants.mjs'; +export * from './bulkPermissionsRequest.mjs'; +export * from './bulkProjectPermissionGrants.mjs'; +export * from './bulkProjectPermissions.mjs'; +export * from './changeDetails.mjs'; +export * from './changedValue.mjs'; +export * from './changedWorklog.mjs'; +export * from './changedWorklogs.mjs'; +export * from './changelog.mjs'; +export * from './columnItem.mjs'; +export * from './comment.mjs'; +export * from './componentIssuesCount.mjs'; +export * from './componentWithIssueCount.mjs'; +export * from './configuration.mjs'; +export * from './connectCustomFieldValue.mjs'; +export * from './connectCustomFieldValues.mjs'; +export * from './connectModule.mjs'; +export * from './connectModules.mjs'; +export * from './connectWorkflowTransitionRule.mjs'; +export * from './containerForProjectFeatures.mjs'; +export * from './containerForRegisteredWebhooks.mjs'; +export * from './containerForWebhookIDs.mjs'; +export * from './containerOfWorkflowSchemeAssociations.mjs'; +export * from './contextForProjectAndIssueType.mjs'; +export * from './contextualConfiguration.mjs'; +export * from './convertedJQLQueries.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createdIssue.mjs'; +export * from './createdIssues.mjs'; +export * from './createIssueSecuritySchemeDetails.mjs'; +export * from './createNotificationSchemeDetails.mjs'; +export * from './createPriorityDetails.mjs'; +export * from './createProjectDetails.mjs'; +export * from './createResolutionDetails.mjs'; +export * from './createUiModificationDetails.mjs'; +export * from './createUpdateRoleRequest.mjs'; +export * from './createWorkflowCondition.mjs'; +export * from './createWorkflowDetails.mjs'; +export * from './createWorkflowStatusDetails.mjs'; +export * from './createWorkflowTransitionDetails.mjs'; +export * from './createWorkflowTransitionRule.mjs'; +export * from './createWorkflowTransitionRulesDetails.mjs'; +export * from './createWorkflowTransitionScreenDetails.mjs'; +export * from './customContextVariable.mjs'; +export * from './customFieldConfigurations.mjs'; +export * from './customFieldContext.mjs'; +export * from './customFieldContextDefaultValue.mjs'; +export * from './customFieldContextDefaultValueUpdate.mjs'; +export * from './customFieldContextOption.mjs'; +export * from './customFieldContextProjectMapping.mjs'; +export * from './customFieldContextUpdateDetails.mjs'; +export * from './customFieldCreatedContextOptionsList.mjs'; +export * from './customFieldDefinitionJson.mjs'; +export * from './customFieldOption.mjs'; +export * from './customFieldOptionCreate.mjs'; +export * from './customFieldOptionUpdate.mjs'; +export * from './customFieldReplacement.mjs'; +export * from './customFieldUpdatedContextOptionsList.mjs'; +export * from './customFieldValueUpdate.mjs'; +export * from './customFieldValueUpdateRequest.mjs'; +export * from './dashboard.mjs'; +export * from './dashboardDetails.mjs'; +export * from './dashboardGadget.mjs'; +export * from './dashboardGadgetPosition.mjs'; +export * from './dashboardGadgetResponse.mjs'; +export * from './dashboardGadgetSettings.mjs'; +export * from './dashboardGadgetUpdateRequest.mjs'; +export * from './dashboardUser.mjs'; +export * from './dateRangeFilter.mjs'; +export * from './defaultLevelValue.mjs'; +export * from './defaultShareScope.mjs'; +export * from './defaultWorkflow.mjs'; +export * from './deleteAndReplaceVersion.mjs'; +export * from './document.mjs'; +export * from './entityProperty.mjs'; +export * from './entityPropertyDetails.mjs'; +export * from './error.mjs'; +export * from './errorCollection.mjs'; +export * from './errors.mjs'; +export * from './eventNotification.mjs'; +export * from './exportArchivedIssuesTaskProgress.mjs'; +export * from './failedWebhook.mjs'; +export * from './failedWebhooks.mjs'; +export * from './field.mjs'; +export * from './fieldConfiguration.mjs'; +export * from './fieldConfigurationDetails.mjs'; +export * from './fieldConfigurationIssueTypeItem.mjs'; +export * from './fieldConfigurationItem.mjs'; +export * from './fieldConfigurationItemsDetails.mjs'; +export * from './fieldConfigurationScheme.mjs'; +export * from './fieldConfigurationSchemeProjectAssociation.mjs'; +export * from './fieldConfigurationSchemeProjects.mjs'; +export * from './fieldConfigurationToIssueTypeMapping.mjs'; +export * from './fieldDetails.mjs'; +export * from './fieldLastUsed.mjs'; +export * from './fieldReferenceData.mjs'; +export * from './fields.mjs'; +export * from './filter.mjs'; +export * from './filterDetails.mjs'; +export * from './filterSubscription.mjs'; +export * from './filterSubscriptionsList.mjs'; +export * from './fixVersion.mjs'; +export * from './foundGroup.mjs'; +export * from './foundGroups.mjs'; +export * from './foundUsers.mjs'; +export * from './foundUsersAndGroups.mjs'; +export * from './functionReferenceData.mjs'; +export * from './globalScope.mjs'; +export * from './group.mjs'; +export * from './groupDetails.mjs'; +export * from './groupLabel.mjs'; +export * from './groupName.mjs'; +export * from './hierarchy.mjs'; +export * from './hierarchyLevel.mjs'; +export * from './historyMetadata.mjs'; +export * from './historyMetadataParticipant.mjs'; +export * from './icon.mjs'; +export * from './id.mjs'; +export * from './idOrKey.mjs'; +export * from './includedFields.mjs'; +export * from './issue.mjs'; +export * from './issueArchivalSync.mjs'; +export * from './issueArchivalSyncRequest.mjs'; +export * from './issueChangelogIds.mjs'; +export * from './issueCommentListRequest.mjs'; +export * from './issueCreateMetadata.mjs'; +export * from './issueEntityProperties.mjs'; +export * from './issueEntityPropertiesForMultiUpdate.mjs'; +export * from './issueEvent.mjs'; +export * from './issueFieldOption.mjs'; +export * from './issueFieldOptionConfiguration.mjs'; +export * from './issueFieldOptionCreate.mjs'; +export * from './issueFieldOptionScope.mjs'; +export * from './issueFilterForBulkPropertyDelete.mjs'; +export * from './issueFilterForBulkPropertySet.mjs'; +export * from './issueLink.mjs'; +export * from './issueLinkType.mjs'; +export * from './issueLinkTypes.mjs'; +export * from './issueList.mjs'; +export * from './issueMatches.mjs'; +export * from './issueMatchesForJQL.mjs'; +export * from './issuePickerSuggestions.mjs'; +export * from './issuePickerSuggestionsIssueType.mjs'; +export * from './issuesAndJQLQueries.mjs'; +export * from './issueSecurityLevelMember.mjs'; +export * from './issueSecuritySchemeToProjectMapping.mjs'; +export * from './issuesJqlMetaData.mjs'; +export * from './issuesMeta.mjs'; +export * from './issuesUpdate.mjs'; +export * from './issueTransition.mjs'; +export * from './issueTypeCreate.mjs'; +export * from './issueTypeDetails.mjs'; +export * from './issueTypeIds.mjs'; +export * from './issueTypeIdsToRemove.mjs'; +export * from './issueTypeInfo.mjs'; +export * from './issueTypeIssueCreateMetadata.mjs'; +export * from './issueTypeScheme.mjs'; +export * from './issueTypeSchemeDetails.mjs'; +export * from './issueTypeSchemeID.mjs'; +export * from './issueTypeSchemeMapping.mjs'; +export * from './issueTypeSchemeProjectAssociation.mjs'; +export * from './issueTypeSchemeProjects.mjs'; +export * from './issueTypeSchemeUpdateDetails.mjs'; +export * from './issueTypeScreenScheme.mjs'; +export * from './issueTypeScreenSchemeDetails.mjs'; +export * from './issueTypeScreenSchemeId.mjs'; +export * from './issueTypeScreenSchemeItem.mjs'; +export * from './issueTypeScreenSchemeMapping.mjs'; +export * from './issueTypeScreenSchemeMappingDetails.mjs'; +export * from './issueTypeScreenSchemeProjectAssociation.mjs'; +export * from './issueTypeScreenSchemesProjects.mjs'; +export * from './issueTypeScreenSchemeUpdateDetails.mjs'; +export * from './issueTypesWorkflowMapping.mjs'; +export * from './issueTypeToContextMapping.mjs'; +export * from './issueTypeUpdate.mjs'; +export * from './issueTypeWithStatus.mjs'; +export * from './issueTypeWorkflowMapping.mjs'; +export * from './issueUpdateDetails.mjs'; +export * from './issueUpdateMetadata.mjs'; +export * from './jexpIssues.mjs'; +export * from './jexpJqlIssues.mjs'; +export * from './jiraExpressionAnalysis.mjs'; +export * from './jiraExpressionComplexity.mjs'; +export * from './jiraExpressionEvalContext.mjs'; +export * from './jiraExpressionEvalRequest.mjs'; +export * from './jiraExpressionEvaluationMetaData.mjs'; +export * from './jiraExpressionForAnalysis.mjs'; +export * from './jiraExpressionResult.mjs'; +export * from './jiraExpressionsAnalysis.mjs'; +export * from './jiraExpressionsComplexity.mjs'; +export * from './jiraExpressionsComplexityValue.mjs'; +export * from './jiraExpressionValidationError.mjs'; +export * from './jiraStatus.mjs'; +export * from './jqlFunctionPrecomputation.mjs'; +export * from './jqlFunctionPrecomputationUpdate.mjs'; +export * from './jqlFunctionPrecomputationUpdateRequest.mjs'; +export * from './jQLPersonalDataMigrationRequest.mjs'; +export * from './jqlQueriesToParse.mjs'; +export * from './jqlQueriesToSanitize.mjs'; +export * from './jqlQuery.mjs'; +export * from './jqlQueryClause.mjs'; +export * from './jqlQueryField.mjs'; +export * from './jqlQueryFieldEntityProperty.mjs'; +export * from './jqlQueryOrderByClause.mjs'; +export * from './jqlQueryOrderByClauseElement.mjs'; +export * from './jqlQueryToSanitize.mjs'; +export * from './jQLQueryWithUnknownUsers.mjs'; +export * from './jQLReferenceData.mjs'; +export * from './jsonType.mjs'; +export * from './license.mjs'; +export * from './licensedApplication.mjs'; +export * from './licenseMetric.mjs'; +export * from './linkedIssue.mjs'; +export * from './linkGroup.mjs'; +export * from './linkIssueRequestJson.mjs'; +export * from './listWrapperCallbackApplicationRole.mjs'; +export * from './listWrapperCallbackGroupName.mjs'; +export * from './locale.mjs'; +export * from './mark.mjs'; +export * from './moveField.mjs'; +export * from './multiIssueEntityProperties.mjs'; +export * from './multipleCustomFieldValuesUpdate.mjs'; +export * from './multipleCustomFieldValuesUpdateDetails.mjs'; +export * from './nestedResponse.mjs'; +export * from './newUserDetails.mjs'; +export * from './notification.mjs'; +export * from './notificationEvent.mjs'; +export * from './notificationRecipients.mjs'; +export * from './notificationRecipientsRestrictions.mjs'; +export * from './notificationScheme.mjs'; +export * from './notificationSchemeAndProjectMapping.mjs'; +export * from './notificationSchemeAndProjectMappingPage.mjs'; +export * from './notificationSchemeEvent.mjs'; +export * from './notificationSchemeEventDetails.mjs'; +export * from './notificationSchemeEventTypeId.mjs'; +export * from './notificationSchemeId.mjs'; +export * from './notificationSchemeNotificationDetails.mjs'; +export * from './oldToNewSecurityLevelMappings.mjs'; +export * from './operationMessage.mjs'; +export * from './operations.mjs'; +export * from './orderOfCustomFieldOptions.mjs'; +export * from './orderOfIssueTypes.mjs'; +export * from './pageBeanFieldConfigurationDetails.mjs'; +export * from './pageChangelog.mjs'; +export * from './pageComment.mjs'; +export * from './pageComponentWithIssueCount.mjs'; +export * from './pageContextForProjectAndIssueType.mjs'; +export * from './pageContextualConfiguration.mjs'; +export * from './pageCustomFieldContext.mjs'; +export * from './pageCustomFieldContextDefaultValue.mjs'; +export * from './pageCustomFieldContextOption.mjs'; +export * from './pageCustomFieldContextProjectMapping.mjs'; +export * from './pageDashboard.mjs'; +export * from './pagedListUserDetailsApplicationUser.mjs'; +export * from './pageField.mjs'; +export * from './pageFieldConfigurationIssueTypeItem.mjs'; +export * from './pageFieldConfigurationItem.mjs'; +export * from './pageFieldConfigurationScheme.mjs'; +export * from './pageFieldConfigurationSchemeProjects.mjs'; +export * from './pageFilterDetails.mjs'; +export * from './pageGroupDetails.mjs'; +export * from './pageIssueFieldOption.mjs'; +export * from './pageIssueSecurityLevelMember.mjs'; +export * from './pageIssueSecuritySchemeToProjectMapping.mjs'; +export * from './pageIssueTypeScheme.mjs'; +export * from './pageIssueTypeSchemeMapping.mjs'; +export * from './pageIssueTypeSchemeProjects.mjs'; +export * from './pageIssueTypeScreenScheme.mjs'; +export * from './pageIssueTypeScreenSchemeItem.mjs'; +export * from './pageIssueTypeScreenSchemesProjects.mjs'; +export * from './pageIssueTypeToContextMapping.mjs'; +export * from './pageJqlFunctionPrecomputation.mjs'; +export * from './pageNotificationScheme.mjs'; +export * from './pageOfChangelogs.mjs'; +export * from './pageOfComments.mjs'; +export * from './pageOfDashboards.mjs'; +export * from './pageOfStatuses.mjs'; +export * from './pageOfWorklogs.mjs'; +export * from './pagePriority.mjs'; +export * from './pageProject.mjs'; +export * from './pageProjectDetails.mjs'; +export * from './pageResolution.mjs'; +export * from './pageScreen.mjs'; +export * from './pageScreenScheme.mjs'; +export * from './pageScreenWithTab.mjs'; +export * from './pageSecurityLevel.mjs'; +export * from './pageSecurityLevelMember.mjs'; +export * from './pageSecuritySchemeWithProjects.mjs'; +export * from './pageString.mjs'; +export * from './pageUiModificationDetails.mjs'; +export * from './pageUser.mjs'; +export * from './pageUserDetails.mjs'; +export * from './pageUserKey.mjs'; +export * from './pageVersion.mjs'; +export * from './pageWebhook.mjs'; +export * from './pageWorkflow.mjs'; +export * from './pageWorkflowScheme.mjs'; +export * from './pageWorkflowTransitionRules.mjs'; +export * from './parsedJqlQueries.mjs'; +export * from './parsedJqlQuery.mjs'; +export * from './permissionDetails.mjs'; +export * from './permissionGrant.mjs'; +export * from './permissionGrants.mjs'; +export * from './permissionHolder.mjs'; +export * from './permissions.mjs'; +export * from './permissionScheme.mjs'; +export * from './permissionSchemes.mjs'; +export * from './permissionsKeys.mjs'; +export * from './permittedProjects.mjs'; +export * from './priority.mjs'; +export * from './priorityId.mjs'; +export * from './project.mjs'; +export * from './projectAvatars.mjs'; +export * from './projectCategory.mjs'; +export * from './projectComponent.mjs'; +export * from './projectDetails.mjs'; +export * from './projectEmailAddress.mjs'; +export * from './projectFeature.mjs'; +export * from './projectFeatureToggleRequest.mjs'; +export * from './projectId.mjs'; +export * from './projectIdentifier.mjs'; +export * from './projectIdentifiers.mjs'; +export * from './projectIds.mjs'; +export * from './projectInsight.mjs'; +export * from './projectIssueCreateMetadata.mjs'; +export * from './projectIssueSecurityLevels.mjs'; +export * from './projectIssueTypeHierarchy.mjs'; +export * from './projectIssueTypeMapping.mjs'; +export * from './projectIssueTypeMappings.mjs'; +export * from './projectIssueTypes.mjs'; +export * from './projectIssueTypesHierarchyLevel.mjs'; +export * from './projectLandingPageInfo.mjs'; +export * from './projectPermissions.mjs'; +export * from './projectRole.mjs'; +export * from './projectRoleActorsUpdate.mjs'; +export * from './projectRoleDetails.mjs'; +export * from './projectRoleGroup.mjs'; +export * from './projectRoleUser.mjs'; +export * from './projectScope.mjs'; +export * from './projectType.mjs'; +export * from './propertyKey.mjs'; +export * from './propertyKeys.mjs'; +export * from './publishedWorkflowId.mjs'; +export * from './registeredWebhook.mjs'; +export * from './remoteIssueLink.mjs'; +export * from './remoteIssueLinkIdentifies.mjs'; +export * from './remoteIssueLinkRequest.mjs'; +export * from './remoteObject.mjs'; +export * from './removeOptionFromIssuesResult.mjs'; +export * from './reorderIssuePriorities.mjs'; +export * from './reorderIssueResolutionsRequest.mjs'; +export * from './resolution.mjs'; +export * from './resolutionId.mjs'; +export * from './restrictedPermission.mjs'; +export * from './richText.mjs'; +export * from './roleActor.mjs'; +export * from './ruleConfiguration.mjs'; +export * from './sanitizedJqlQueries.mjs'; +export * from './sanitizedJqlQuery.mjs'; +export * from './scope.mjs'; +export * from './screen.mjs'; +export * from './screenableField.mjs'; +export * from './screenableTab.mjs'; +export * from './screenDetails.mjs'; +export * from './screenID.mjs'; +export * from './screenScheme.mjs'; +export * from './screenSchemeDetails.mjs'; +export * from './screenSchemeId.mjs'; +export * from './screenTypes.mjs'; +export * from './screenWithTab.mjs'; +export * from './searchAutoCompleteFilter.mjs'; +export * from './searchRequest.mjs'; +export * from './searchResults.mjs'; +export * from './securityLevel.mjs'; +export * from './securityLevelMember.mjs'; +export * from './securityScheme.mjs'; +export * from './securitySchemeId.mjs'; +export * from './securitySchemeLevel.mjs'; +export * from './securitySchemeLevelMember.mjs'; +export * from './securitySchemeMembersRequest.mjs'; +export * from './securitySchemes.mjs'; +export * from './securitySchemeWithProjects.mjs'; +export * from './serverInformation.mjs'; +export * from './setDefaultLevelsRequest.mjs'; +export * from './setDefaultPriorityRequest.mjs'; +export * from './setDefaultResolutionRequest.mjs'; +export * from './sharePermission.mjs'; +export * from './sharePermissionInput.mjs'; +export * from './simpleApplicationProperty.mjs'; +export * from './simpleErrorCollection.mjs'; +export * from './simpleLink.mjs'; +export * from './simpleListWrapperApplicationRole.mjs'; +export * from './simpleListWrapperGroupName.mjs'; +export * from './status.mjs'; +export * from './statusCategory.mjs'; +export * from './statusCreate.mjs'; +export * from './statusCreateRequest.mjs'; +export * from './statusDetails.mjs'; +export * from './statusMapping.mjs'; +export * from './statusScope.mjs'; +export * from './statusUpdate.mjs'; +export * from './statusUpdateRequest.mjs'; +export * from './suggestedIssue.mjs'; +export * from './systemAvatars.mjs'; +export * from './taskProgressObject.mjs'; +export * from './taskProgressRemoveOptionFromIssuesResult.mjs'; +export * from './timeTrackingConfiguration.mjs'; +export * from './timeTrackingDetails.mjs'; +export * from './timeTrackingProvider.mjs'; +export * from './transition.mjs'; +export * from './transitions.mjs'; +export * from './uiModificationContextDetails.mjs'; +export * from './uiModificationDetails.mjs'; +export * from './uiModificationIdentifiers.mjs'; +export * from './unrestrictedUserEmail.mjs'; +export * from './updateCustomFieldDetails.mjs'; +export * from './updatedProjectCategory.mjs'; +export * from './updateFieldConfigurationSchemeDetails.mjs'; +export * from './updateIssueSecurityLevelDetails.mjs'; +export * from './updateIssueSecuritySchemeRequest.mjs'; +export * from './updateNotificationSchemeDetails.mjs'; +export * from './updatePriorityDetails.mjs'; +export * from './updateProjectDetails.mjs'; +export * from './updateResolutionDetails.mjs'; +export * from './updateScreenDetails.mjs'; +export * from './updateScreenSchemeDetails.mjs'; +export * from './updateScreenTypes.mjs'; +export * from './updateUiModificationDetails.mjs'; +export * from './updateUserToGroup.mjs'; +export * from './user.mjs'; +export * from './userAvatarUrls.mjs'; +export * from './userDetails.mjs'; +export * from './userKey.mjs'; +export * from './userList.mjs'; +export * from './userMigration.mjs'; +export * from './userPickerUser.mjs'; +export * from './version.mjs'; +export * from './versionIssueCounts.mjs'; +export * from './versionIssuesStatus.mjs'; +export * from './versionMove.mjs'; +export * from './versionUnresolvedIssuesCount.mjs'; +export * from './versionUsageInCustomField.mjs'; +export * from './visibility.mjs'; +export * from './votes.mjs'; +export * from './watchers.mjs'; +export * from './webhook.mjs'; +export * from './webhookDetails.mjs'; +export * from './webhookRegistrationDetails.mjs'; +export * from './webhooksExpirationDate.mjs'; +export * from './workflow.mjs'; +export * from './workflowCondition.mjs'; +export * from './workflowId.mjs'; +export * from './workflowOperations.mjs'; +export * from './workflowRules.mjs'; +export * from './workflowRulesSearch.mjs'; +export * from './workflowRulesSearchDetails.mjs'; +export * from './workflowScheme.mjs'; +export * from './workflowSchemeAssociations.mjs'; +export * from './workflowSchemeIdName.mjs'; +export * from './workflowSchemeProjectAssociation.mjs'; +export * from './workflowStatus.mjs'; +export * from './workflowStatusProperties.mjs'; +export * from './workflowsWithTransitionRulesDetails.mjs'; +export * from './workflowTransition.mjs'; +export * from './workflowTransitionProperty.mjs'; +export * from './workflowTransitionRule.mjs'; +export * from './workflowTransitionRules.mjs'; +export * from './workflowTransitionRulesDetails.mjs'; +export * from './workflowTransitionRulesUpdate.mjs'; +export * from './workflowTransitionRulesUpdateErrorDetails.mjs'; +export * from './workflowTransitionRulesUpdateErrors.mjs'; +export * from './worklog.mjs'; +export * from './worklogIdsRequest.mjs'; diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts deleted file mode 100644 index 45c21ade21..0000000000 --- a/src/version3/models/index.ts +++ /dev/null @@ -1,511 +0,0 @@ -export * from './actorInput'; -export * from './actorsMap'; -export * from './addField'; -export * from './addGroup'; -export * from './addSecuritySchemeLevelsRequest'; -export * from './announcementBannerConfiguration'; -export * from './announcementBannerConfigurationUpdate'; -export * from './application'; -export * from './applicationProperty'; -export * from './applicationRole'; -export * from './archiveIssueAsyncRequest'; -export * from './associatedItem'; -export * from './associateFieldConfigurationsWithIssueTypesRequest'; -export * from './attachment'; -export * from './attachmentArchiveEntry'; -export * from './attachmentArchiveImpl'; -export * from './attachmentArchiveItemReadable'; -export * from './attachmentArchiveMetadataReadable'; -export * from './attachmentMetadata'; -export * from './attachmentSettings'; -export * from './auditRecord'; -export * from './auditRecords'; -export * from './autoCompleteSuggestion'; -export * from './autoCompleteSuggestions'; -export * from './availableDashboardGadget'; -export * from './availableDashboardGadgetsResponse'; -export * from './avatar'; -export * from './avatars'; -export * from './avatarUrls'; -export * from './avatarWithDetails'; -export * from './bulkChangeOwnerDetails'; -export * from './bulkCustomFieldOptionCreateRequest'; -export * from './bulkCustomFieldOptionUpdateRequest'; -export * from './bulkEditShareableEntity'; -export * from './bulkIssueIsWatching'; -export * from './bulkIssuePropertyUpdateRequest'; -export * from './bulkOperationErrorResult'; -export * from './bulkPermissionGrants'; -export * from './bulkPermissionsRequest'; -export * from './bulkProjectPermissionGrants'; -export * from './bulkProjectPermissions'; -export * from './changeDetails'; -export * from './changedValue'; -export * from './changedWorklog'; -export * from './changedWorklogs'; -export * from './changelog'; -export * from './columnItem'; -export * from './comment'; -export * from './componentIssuesCount'; -export * from './componentWithIssueCount'; -export * from './configuration'; -export * from './connectCustomFieldValue'; -export * from './connectCustomFieldValues'; -export * from './connectModule'; -export * from './connectModules'; -export * from './connectWorkflowTransitionRule'; -export * from './containerForProjectFeatures'; -export * from './containerForRegisteredWebhooks'; -export * from './containerForWebhookIDs'; -export * from './containerOfWorkflowSchemeAssociations'; -export * from './contextForProjectAndIssueType'; -export * from './contextualConfiguration'; -export * from './convertedJQLQueries'; -export * from './createCustomFieldContext'; -export * from './createdIssue'; -export * from './createdIssues'; -export * from './createIssueSecuritySchemeDetails'; -export * from './createNotificationSchemeDetails'; -export * from './createPriorityDetails'; -export * from './createProjectDetails'; -export * from './createResolutionDetails'; -export * from './createUiModificationDetails'; -export * from './createUpdateRoleRequest'; -export * from './createWorkflowCondition'; -export * from './createWorkflowDetails'; -export * from './createWorkflowStatusDetails'; -export * from './createWorkflowTransitionDetails'; -export * from './createWorkflowTransitionRule'; -export * from './createWorkflowTransitionRulesDetails'; -export * from './createWorkflowTransitionScreenDetails'; -export * from './customContextVariable'; -export * from './customFieldConfigurations'; -export * from './customFieldContext'; -export * from './customFieldContextDefaultValue'; -export * from './customFieldContextDefaultValueUpdate'; -export * from './customFieldContextOption'; -export * from './customFieldContextProjectMapping'; -export * from './customFieldContextUpdateDetails'; -export * from './customFieldCreatedContextOptionsList'; -export * from './customFieldDefinitionJson'; -export * from './customFieldOption'; -export * from './customFieldOptionCreate'; -export * from './customFieldOptionUpdate'; -export * from './customFieldReplacement'; -export * from './customFieldUpdatedContextOptionsList'; -export * from './customFieldValueUpdate'; -export * from './customFieldValueUpdateRequest'; -export * from './dashboard'; -export * from './dashboardDetails'; -export * from './dashboardGadget'; -export * from './dashboardGadgetPosition'; -export * from './dashboardGadgetResponse'; -export * from './dashboardGadgetSettings'; -export * from './dashboardGadgetUpdateRequest'; -export * from './dashboardUser'; -export * from './dateRangeFilter'; -export * from './defaultLevelValue'; -export * from './defaultShareScope'; -export * from './defaultWorkflow'; -export * from './deleteAndReplaceVersion'; -export * from './document'; -export * from './entityProperty'; -export * from './entityPropertyDetails'; -export * from './error'; -export * from './errorCollection'; -export * from './errors'; -export * from './eventNotification'; -export * from './exportArchivedIssuesTaskProgress'; -export * from './failedWebhook'; -export * from './failedWebhooks'; -export * from './field'; -export * from './fieldConfiguration'; -export * from './fieldConfigurationDetails'; -export * from './fieldConfigurationIssueTypeItem'; -export * from './fieldConfigurationItem'; -export * from './fieldConfigurationItemsDetails'; -export * from './fieldConfigurationScheme'; -export * from './fieldConfigurationSchemeProjectAssociation'; -export * from './fieldConfigurationSchemeProjects'; -export * from './fieldConfigurationToIssueTypeMapping'; -export * from './fieldDetails'; -export * from './fieldLastUsed'; -export * from './fieldReferenceData'; -export * from './fields'; -export * from './filter'; -export * from './filterDetails'; -export * from './filterSubscription'; -export * from './filterSubscriptionsList'; -export * from './fixVersion'; -export * from './foundGroup'; -export * from './foundGroups'; -export * from './foundUsers'; -export * from './foundUsersAndGroups'; -export * from './functionReferenceData'; -export * from './globalScope'; -export * from './group'; -export * from './groupDetails'; -export * from './groupLabel'; -export * from './groupName'; -export * from './hierarchy'; -export * from './hierarchyLevel'; -export * from './historyMetadata'; -export * from './historyMetadataParticipant'; -export * from './icon'; -export * from './id'; -export * from './idOrKey'; -export * from './includedFields'; -export * from './index'; -export * from './issue'; -export * from './issueArchivalSync'; -export * from './issueArchivalSyncRequest'; -export * from './issueChangelogIds'; -export * from './issueCommentListRequest'; -export * from './issueCreateMetadata'; -export * from './issueEntityProperties'; -export * from './issueEntityPropertiesForMultiUpdate'; -export * from './issueEvent'; -export * from './issueFieldOption'; -export * from './issueFieldOptionConfiguration'; -export * from './issueFieldOptionCreate'; -export * from './issueFieldOptionScope'; -export * from './issueFilterForBulkPropertyDelete'; -export * from './issueFilterForBulkPropertySet'; -export * from './issueLink'; -export * from './issueLinkType'; -export * from './issueLinkTypes'; -export * from './issueList'; -export * from './issueMatches'; -export * from './issueMatchesForJQL'; -export * from './issuePickerSuggestions'; -export * from './issuePickerSuggestionsIssueType'; -export * from './issuesAndJQLQueries'; -export * from './issueSecurityLevelMember'; -export * from './issueSecuritySchemeToProjectMapping'; -export * from './issuesJqlMetaData'; -export * from './issuesMeta'; -export * from './issuesUpdate'; -export * from './issueTransition'; -export * from './issueTypeCreate'; -export * from './issueTypeDetails'; -export * from './issueTypeIds'; -export * from './issueTypeIdsToRemove'; -export * from './issueTypeInfo'; -export * from './issueTypeIssueCreateMetadata'; -export * from './issueTypeScheme'; -export * from './issueTypeSchemeDetails'; -export * from './issueTypeSchemeID'; -export * from './issueTypeSchemeMapping'; -export * from './issueTypeSchemeProjectAssociation'; -export * from './issueTypeSchemeProjects'; -export * from './issueTypeSchemeUpdateDetails'; -export * from './issueTypeScreenScheme'; -export * from './issueTypeScreenSchemeDetails'; -export * from './issueTypeScreenSchemeId'; -export * from './issueTypeScreenSchemeItem'; -export * from './issueTypeScreenSchemeMapping'; -export * from './issueTypeScreenSchemeMappingDetails'; -export * from './issueTypeScreenSchemeProjectAssociation'; -export * from './issueTypeScreenSchemesProjects'; -export * from './issueTypeScreenSchemeUpdateDetails'; -export * from './issueTypesWorkflowMapping'; -export * from './issueTypeToContextMapping'; -export * from './issueTypeUpdate'; -export * from './issueTypeWithStatus'; -export * from './issueTypeWorkflowMapping'; -export * from './issueUpdateDetails'; -export * from './issueUpdateMetadata'; -export * from './jexpIssues'; -export * from './jexpJqlIssues'; -export * from './jiraExpressionAnalysis'; -export * from './jiraExpressionComplexity'; -export * from './jiraExpressionEvalContext'; -export * from './jiraExpressionEvalRequest'; -export * from './jiraExpressionEvaluationMetaData'; -export * from './jiraExpressionForAnalysis'; -export * from './jiraExpressionResult'; -export * from './jiraExpressionsAnalysis'; -export * from './jiraExpressionsComplexity'; -export * from './jiraExpressionsComplexityValue'; -export * from './jiraExpressionValidationError'; -export * from './jiraStatus'; -export * from './jqlFunctionPrecomputation'; -export * from './jqlFunctionPrecomputationUpdate'; -export * from './jqlFunctionPrecomputationUpdateRequest'; -export * from './jQLPersonalDataMigrationRequest'; -export * from './jqlQueriesToParse'; -export * from './jqlQueriesToSanitize'; -export * from './jqlQuery'; -export * from './jqlQueryClause'; -export * from './jqlQueryField'; -export * from './jqlQueryFieldEntityProperty'; -export * from './jqlQueryOrderByClause'; -export * from './jqlQueryOrderByClauseElement'; -export * from './jqlQueryToSanitize'; -export * from './jQLQueryWithUnknownUsers'; -export * from './jQLReferenceData'; -export * from './jsonType'; -export * from './license'; -export * from './licensedApplication'; -export * from './licenseMetric'; -export * from './linkedIssue'; -export * from './linkGroup'; -export * from './linkIssueRequestJson'; -export * from './listWrapperCallbackApplicationRole'; -export * from './listWrapperCallbackGroupName'; -export * from './locale'; -export * from './mark'; -export * from './moveField'; -export * from './multiIssueEntityProperties'; -export * from './multipleCustomFieldValuesUpdate'; -export * from './multipleCustomFieldValuesUpdateDetails'; -export * from './nestedResponse'; -export * from './newUserDetails'; -export * from './notification'; -export * from './notificationEvent'; -export * from './notificationRecipients'; -export * from './notificationRecipientsRestrictions'; -export * from './notificationScheme'; -export * from './notificationSchemeAndProjectMapping'; -export * from './notificationSchemeAndProjectMappingPage'; -export * from './notificationSchemeEvent'; -export * from './notificationSchemeEventDetails'; -export * from './notificationSchemeEventTypeId'; -export * from './notificationSchemeId'; -export * from './notificationSchemeNotificationDetails'; -export * from './oldToNewSecurityLevelMappings'; -export * from './operationMessage'; -export * from './operations'; -export * from './orderOfCustomFieldOptions'; -export * from './orderOfIssueTypes'; -export * from './pageBeanFieldConfigurationDetails'; -export * from './pageChangelog'; -export * from './pageComment'; -export * from './pageComponentWithIssueCount'; -export * from './pageContextForProjectAndIssueType'; -export * from './pageContextualConfiguration'; -export * from './pageCustomFieldContext'; -export * from './pageCustomFieldContextDefaultValue'; -export * from './pageCustomFieldContextOption'; -export * from './pageCustomFieldContextProjectMapping'; -export * from './pageDashboard'; -export * from './pagedListUserDetailsApplicationUser'; -export * from './pageField'; -export * from './pageFieldConfigurationIssueTypeItem'; -export * from './pageFieldConfigurationItem'; -export * from './pageFieldConfigurationScheme'; -export * from './pageFieldConfigurationSchemeProjects'; -export * from './pageFilterDetails'; -export * from './pageGroupDetails'; -export * from './pageIssueFieldOption'; -export * from './pageIssueSecurityLevelMember'; -export * from './pageIssueSecuritySchemeToProjectMapping'; -export * from './pageIssueTypeScheme'; -export * from './pageIssueTypeSchemeMapping'; -export * from './pageIssueTypeSchemeProjects'; -export * from './pageIssueTypeScreenScheme'; -export * from './pageIssueTypeScreenSchemeItem'; -export * from './pageIssueTypeScreenSchemesProjects'; -export * from './pageIssueTypeToContextMapping'; -export * from './pageJqlFunctionPrecomputation'; -export * from './pageNotificationScheme'; -export * from './pageOfChangelogs'; -export * from './pageOfComments'; -export * from './pageOfDashboards'; -export * from './pageOfStatuses'; -export * from './pageOfWorklogs'; -export * from './pagePriority'; -export * from './pageProject'; -export * from './pageProjectDetails'; -export * from './pageResolution'; -export * from './pageScreen'; -export * from './pageScreenScheme'; -export * from './pageScreenWithTab'; -export * from './pageSecurityLevel'; -export * from './pageSecurityLevelMember'; -export * from './pageSecuritySchemeWithProjects'; -export * from './pageString'; -export * from './pageUiModificationDetails'; -export * from './pageUser'; -export * from './pageUserDetails'; -export * from './pageUserKey'; -export * from './pageVersion'; -export * from './pageWebhook'; -export * from './pageWorkflow'; -export * from './pageWorkflowScheme'; -export * from './pageWorkflowTransitionRules'; -export * from './parsedJqlQueries'; -export * from './parsedJqlQuery'; -export * from './permissionDetails'; -export * from './permissionGrant'; -export * from './permissionGrants'; -export * from './permissionHolder'; -export * from './permissions'; -export * from './permissionScheme'; -export * from './permissionSchemes'; -export * from './permissionsKeys'; -export * from './permittedProjects'; -export * from './priority'; -export * from './priorityId'; -export * from './project'; -export * from './projectAvatars'; -export * from './projectCategory'; -export * from './projectComponent'; -export * from './projectDetails'; -export * from './projectEmailAddress'; -export * from './projectFeature'; -export * from './projectFeatureToggleRequest'; -export * from './projectId'; -export * from './projectIdentifier'; -export * from './projectIdentifiers'; -export * from './projectIds'; -export * from './projectInsight'; -export * from './projectIssueCreateMetadata'; -export * from './projectIssueSecurityLevels'; -export * from './projectIssueTypeHierarchy'; -export * from './projectIssueTypeMapping'; -export * from './projectIssueTypeMappings'; -export * from './projectIssueTypes'; -export * from './projectIssueTypesHierarchyLevel'; -export * from './projectLandingPageInfo'; -export * from './projectPermissions'; -export * from './projectRole'; -export * from './projectRoleActorsUpdate'; -export * from './projectRoleDetails'; -export * from './projectRoleGroup'; -export * from './projectRoleUser'; -export * from './projectScope'; -export * from './projectType'; -export * from './propertyKey'; -export * from './propertyKeys'; -export * from './publishedWorkflowId'; -export * from './registeredWebhook'; -export * from './remoteIssueLink'; -export * from './remoteIssueLinkIdentifies'; -export * from './remoteIssueLinkRequest'; -export * from './remoteObject'; -export * from './removeOptionFromIssuesResult'; -export * from './reorderIssuePriorities'; -export * from './reorderIssueResolutionsRequest'; -export * from './resolution'; -export * from './resolutionId'; -export * from './restrictedPermission'; -export * from './richText'; -export * from './roleActor'; -export * from './ruleConfiguration'; -export * from './sanitizedJqlQueries'; -export * from './sanitizedJqlQuery'; -export * from './scope'; -export * from './screen'; -export * from './screenableField'; -export * from './screenableTab'; -export * from './screenDetails'; -export * from './screenID'; -export * from './screenScheme'; -export * from './screenSchemeDetails'; -export * from './screenSchemeId'; -export * from './screenTypes'; -export * from './screenWithTab'; -export * from './searchAutoCompleteFilter'; -export * from './searchRequest'; -export * from './searchResults'; -export * from './securityLevel'; -export * from './securityLevelMember'; -export * from './securityScheme'; -export * from './securitySchemeId'; -export * from './securitySchemeLevel'; -export * from './securitySchemeLevelMember'; -export * from './securitySchemeMembersRequest'; -export * from './securitySchemes'; -export * from './securitySchemeWithProjects'; -export * from './serverInformation'; -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'; -export * from './status'; -export * from './statusCategory'; -export * from './statusCreate'; -export * from './statusCreateRequest'; -export * from './statusDetails'; -export * from './statusMapping'; -export * from './statusScope'; -export * from './statusUpdate'; -export * from './statusUpdateRequest'; -export * from './suggestedIssue'; -export * from './systemAvatars'; -export * from './taskProgressObject'; -export * from './taskProgressRemoveOptionFromIssuesResult'; -export * from './timeTrackingConfiguration'; -export * from './timeTrackingDetails'; -export * from './timeTrackingProvider'; -export * from './transition'; -export * from './transitions'; -export * from './uiModificationContextDetails'; -export * from './uiModificationDetails'; -export * from './uiModificationIdentifiers'; -export * from './unrestrictedUserEmail'; -export * from './updateCustomFieldDetails'; -export * from './updatedProjectCategory'; -export * from './updateFieldConfigurationSchemeDetails'; -export * from './updateIssueSecurityLevelDetails'; -export * from './updateIssueSecuritySchemeRequest'; -export * from './updateNotificationSchemeDetails'; -export * from './updatePriorityDetails'; -export * from './updateProjectDetails'; -export * from './updateResolutionDetails'; -export * from './updateScreenDetails'; -export * from './updateScreenSchemeDetails'; -export * from './updateScreenTypes'; -export * from './updateUiModificationDetails'; -export * from './updateUserToGroup'; -export * from './user'; -export * from './userAvatarUrls'; -export * from './userDetails'; -export * from './userKey'; -export * from './userList'; -export * from './userMigration'; -export * from './userPickerUser'; -export * from './version'; -export * from './versionIssueCounts'; -export * from './versionIssuesStatus'; -export * from './versionMove'; -export * from './versionUnresolvedIssuesCount'; -export * from './versionUsageInCustomField'; -export * from './visibility'; -export * from './votes'; -export * from './watchers'; -export * from './webhook'; -export * from './webhookDetails'; -export * from './webhookRegistrationDetails'; -export * from './webhooksExpirationDate'; -export * from './workflow'; -export * from './workflowCondition'; -export * from './workflowId'; -export * from './workflowOperations'; -export * from './workflowRules'; -export * from './workflowRulesSearch'; -export * from './workflowRulesSearchDetails'; -export * from './workflowScheme'; -export * from './workflowSchemeAssociations'; -export * from './workflowSchemeIdName'; -export * from './workflowSchemeProjectAssociation'; -export * from './workflowStatus'; -export * from './workflowStatusProperties'; -export * from './workflowsWithTransitionRulesDetails'; -export * from './workflowTransition'; -export * from './workflowTransitionProperty'; -export * from './workflowTransitionRule'; -export * from './workflowTransitionRules'; -export * from './workflowTransitionRulesDetails'; -export * from './workflowTransitionRulesUpdate'; -export * from './workflowTransitionRulesUpdateErrorDetails'; -export * from './workflowTransitionRulesUpdateErrors'; -export * from './worklog'; -export * from './worklogIdsRequest'; diff --git a/src/version3/models/issue.mts b/src/version3/models/issue.mts new file mode 100644 index 0000000000..7cb3183a5e --- /dev/null +++ b/src/version3/models/issue.mts @@ -0,0 +1,35 @@ +import { Fields } from './fields.mjs'; +import { IncludedFields } from './includedFields.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; +import { IssueUpdateMetadata } from './issueUpdateMetadata.mjs'; +import { Operations } from './operations.mjs'; +import { PageOfChangelogs } from './pageOfChangelogs.mjs'; + +/** Details about an issue. */ +export interface Issue { + /** Expand options that include additional issue details in the response. */ + expand?: string; + /** The ID of the issue. */ + id: string; + /** The URL of the issue details. */ + self?: string; + /** The key of the issue. */ + key: string; + /** The rendered value of each field present on the issue. */ + renderedFields?: {}; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The ID and name of each field present on the issue. */ + names?: {}; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The transitions that can be performed on the issue. */ + transitions?: IssueTransition[]; + operations?: Operations; + editmeta?: IssueUpdateMetadata; + changelog?: PageOfChangelogs; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; + fieldsToInclude?: IncludedFields; + fields: Fields; +} diff --git a/src/version3/models/issue.ts b/src/version3/models/issue.ts deleted file mode 100644 index 16051659c7..0000000000 --- a/src/version3/models/issue.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Fields } from './fields'; -import { IncludedFields } from './includedFields'; -import { IssueTransition } from './issueTransition'; -import { IssueUpdateMetadata } from './issueUpdateMetadata'; -import { Operations } from './operations'; -import { PageOfChangelogs } from './pageOfChangelogs'; - -/** Details about an issue. */ -export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: {}; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The ID and name of each field present on the issue. */ - names?: {}; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The transitions that can be performed on the issue. */ - transitions?: IssueTransition[]; - operations?: Operations; - editmeta?: IssueUpdateMetadata; - changelog?: PageOfChangelogs; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; - fieldsToInclude?: IncludedFields; - fields: Fields; -} diff --git a/src/version3/models/issueArchivalSync.mts b/src/version3/models/issueArchivalSync.mts new file mode 100644 index 0000000000..f9277fa1ff --- /dev/null +++ b/src/version3/models/issueArchivalSync.mts @@ -0,0 +1,7 @@ +import { Errors } from './errors.mjs'; + +/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ +export interface IssueArchivalSync { + errors?: Errors; + numberOfIssuesUpdated?: number; +} diff --git a/src/version3/models/issueArchivalSync.ts b/src/version3/models/issueArchivalSync.ts deleted file mode 100644 index 8145c2a246..0000000000 --- a/src/version3/models/issueArchivalSync.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Errors } from './errors'; - -/** Number of archived/unarchived issues and list of errors that occurred during the action, if any. */ -export interface IssueArchivalSync { - errors?: Errors; - numberOfIssuesUpdated?: number; -} diff --git a/src/version3/models/issueArchivalSyncRequest.ts b/src/version3/models/issueArchivalSyncRequest.mts similarity index 100% rename from src/version3/models/issueArchivalSyncRequest.ts rename to src/version3/models/issueArchivalSyncRequest.mts diff --git a/src/version3/models/issueChangelogIds.ts b/src/version3/models/issueChangelogIds.mts similarity index 100% rename from src/version3/models/issueChangelogIds.ts rename to src/version3/models/issueChangelogIds.mts diff --git a/src/version3/models/issueCommentListRequest.ts b/src/version3/models/issueCommentListRequest.mts similarity index 100% rename from src/version3/models/issueCommentListRequest.ts rename to src/version3/models/issueCommentListRequest.mts diff --git a/src/version3/models/issueCreateMetadata.mts b/src/version3/models/issueCreateMetadata.mts new file mode 100644 index 0000000000..38cebd5da8 --- /dev/null +++ b/src/version3/models/issueCreateMetadata.mts @@ -0,0 +1,9 @@ +import { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata.mjs'; + +/** The wrapper for the issue creation metadata for a list of projects. */ +export interface IssueCreateMetadata { + /** Expand options that include additional project details in the response. */ + expand?: string; + /** List of projects and their issue creation metadata. */ + projects?: ProjectIssueCreateMetadata[]; +} diff --git a/src/version3/models/issueCreateMetadata.ts b/src/version3/models/issueCreateMetadata.ts deleted file mode 100644 index 79f5ea1286..0000000000 --- a/src/version3/models/issueCreateMetadata.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ProjectIssueCreateMetadata } from './projectIssueCreateMetadata'; - -/** The wrapper for the issue creation metadata for a list of projects. */ -export interface IssueCreateMetadata { - /** Expand options that include additional project details in the response. */ - expand?: string; - /** List of projects and their issue creation metadata. */ - projects?: ProjectIssueCreateMetadata[]; -} diff --git a/src/version3/models/issueEntityProperties.ts b/src/version3/models/issueEntityProperties.mts similarity index 100% rename from src/version3/models/issueEntityProperties.ts rename to src/version3/models/issueEntityProperties.mts diff --git a/src/version3/models/issueEntityPropertiesForMultiUpdate.ts b/src/version3/models/issueEntityPropertiesForMultiUpdate.mts similarity index 100% rename from src/version3/models/issueEntityPropertiesForMultiUpdate.ts rename to src/version3/models/issueEntityPropertiesForMultiUpdate.mts diff --git a/src/version3/models/issueEvent.ts b/src/version3/models/issueEvent.mts similarity index 100% rename from src/version3/models/issueEvent.ts rename to src/version3/models/issueEvent.mts diff --git a/src/version3/models/issueFieldOption.mts b/src/version3/models/issueFieldOption.mts new file mode 100644 index 0000000000..f75dd6f62f --- /dev/null +++ b/src/version3/models/issueFieldOption.mts @@ -0,0 +1,17 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +/** Details of the options for a select list issue field. */ +export interface IssueFieldOption { + /** The unique identifier for the option. This is only unique within the select field's set of options. */ + id: number; + /** The option's name, which is displayed in Jira. */ + value: string; + /** + * The properties of the object, as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see [Issue Field Option Property + * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined + * in the descriptor for the issue field module. + */ + properties?: {}; + config?: IssueFieldOptionConfiguration; +} diff --git a/src/version3/models/issueFieldOption.ts b/src/version3/models/issueFieldOption.ts deleted file mode 100644 index 9c7f203657..0000000000 --- a/src/version3/models/issueFieldOption.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration'; - -/** Details of the options for a select list issue field. */ -export interface IssueFieldOption { - /** The unique identifier for the option. This is only unique within the select field's set of options. */ - id: number; - /** The option's name, which is displayed in Jira. */ - value: string; - /** - * The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see [Issue Field Option Property - * Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined - * in the descriptor for the issue field module. - */ - properties?: {}; - config?: IssueFieldOptionConfiguration; -} diff --git a/src/version3/models/issueFieldOptionConfiguration.mts b/src/version3/models/issueFieldOptionConfiguration.mts new file mode 100644 index 0000000000..0b49ac3e4d --- /dev/null +++ b/src/version3/models/issueFieldOptionConfiguration.mts @@ -0,0 +1,6 @@ +import { IssueFieldOptionScope } from './issueFieldOptionScope.mjs'; + +/** Details of the projects the option is available in. */ +export interface IssueFieldOptionConfiguration { + scope?: IssueFieldOptionScope; +} diff --git a/src/version3/models/issueFieldOptionConfiguration.ts b/src/version3/models/issueFieldOptionConfiguration.ts deleted file mode 100644 index c1c8dfbbb6..0000000000 --- a/src/version3/models/issueFieldOptionConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueFieldOptionScope } from './issueFieldOptionScope'; - -/** Details of the projects the option is available in. */ -export interface IssueFieldOptionConfiguration { - scope?: IssueFieldOptionScope; -} diff --git a/src/version3/models/issueFieldOptionCreate.mts b/src/version3/models/issueFieldOptionCreate.mts new file mode 100644 index 0000000000..8c41d0f451 --- /dev/null +++ b/src/version3/models/issueFieldOptionCreate.mts @@ -0,0 +1,13 @@ +import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration.mjs'; + +export interface IssueFieldOptionCreate { + /** The option's name, which is displayed in Jira. */ + value: string; + /** + * The properties of the option as arbitrary key-value pairs. These properties can be searched using Jql, if the + * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) + * are defined in the descriptor for the issue field module. + */ + properties?: {}; + config?: IssueFieldOptionConfiguration; +} diff --git a/src/version3/models/issueFieldOptionCreate.ts b/src/version3/models/issueFieldOptionCreate.ts deleted file mode 100644 index 7a095d6826..0000000000 --- a/src/version3/models/issueFieldOptionCreate.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IssueFieldOptionConfiguration } from './issueFieldOptionConfiguration'; - -export interface IssueFieldOptionCreate { - /** The option's name, which is displayed in Jira. */ - value: string; - /** - * The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the - * extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) - * are defined in the descriptor for the issue field module. - */ - properties?: {}; - config?: IssueFieldOptionConfiguration; -} diff --git a/src/version3/models/issueFieldOptionScope.mts b/src/version3/models/issueFieldOptionScope.mts new file mode 100644 index 0000000000..c2b39e8a7b --- /dev/null +++ b/src/version3/models/issueFieldOptionScope.mts @@ -0,0 +1,12 @@ +import { GlobalScope } from './globalScope.mjs'; +import { ProjectScope } from './projectScope.mjs'; + +export interface IssueFieldOptionScope { + /** + * Defines the projects in which the option is available and the behavior of the option within each project. Specify + * one object per project. The behavior of the option in a project context overrides the behavior in the global + * context. + */ + projects2?: ProjectScope[]; + global?: GlobalScope; +} diff --git a/src/version3/models/issueFieldOptionScope.ts b/src/version3/models/issueFieldOptionScope.ts deleted file mode 100644 index 1d2018c87f..0000000000 --- a/src/version3/models/issueFieldOptionScope.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { GlobalScope } from './globalScope'; -import { ProjectScope } from './projectScope'; - -export interface IssueFieldOptionScope { - /** - * Defines the projects in which the option is available and the behavior of the option within each project. Specify - * one object per project. The behavior of the option in a project context overrides the behavior in the global - * context. - */ - projects2?: ProjectScope[]; - global?: GlobalScope; -} diff --git a/src/version3/models/issueFilterForBulkPropertyDelete.ts b/src/version3/models/issueFilterForBulkPropertyDelete.mts similarity index 100% rename from src/version3/models/issueFilterForBulkPropertyDelete.ts rename to src/version3/models/issueFilterForBulkPropertyDelete.mts diff --git a/src/version3/models/issueFilterForBulkPropertySet.ts b/src/version3/models/issueFilterForBulkPropertySet.mts similarity index 100% rename from src/version3/models/issueFilterForBulkPropertySet.ts rename to src/version3/models/issueFilterForBulkPropertySet.mts diff --git a/src/version3/models/issueLink.mts b/src/version3/models/issueLink.mts new file mode 100644 index 0000000000..7c7a0e8bcb --- /dev/null +++ b/src/version3/models/issueLink.mts @@ -0,0 +1,13 @@ +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +/** Details of a link between issues. */ +export interface IssueLink { + /** The ID of the issue link. */ + id?: string; + /** The URL of the issue link. */ + self?: string; + type?: IssueLinkType; + inwardIssue?: LinkedIssue; + outwardIssue?: LinkedIssue; +} diff --git a/src/version3/models/issueLink.ts b/src/version3/models/issueLink.ts deleted file mode 100644 index 795b976e00..0000000000 --- a/src/version3/models/issueLink.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IssueLinkType } from './issueLinkType'; -import { LinkedIssue } from './linkedIssue'; - -/** Details of a link between issues. */ -export interface IssueLink { - /** The ID of the issue link. */ - id?: string; - /** The URL of the issue link. */ - self?: string; - type?: IssueLinkType; - inwardIssue?: LinkedIssue; - outwardIssue?: LinkedIssue; -} diff --git a/src/version3/models/issueLinkType.ts b/src/version3/models/issueLinkType.mts similarity index 100% rename from src/version3/models/issueLinkType.ts rename to src/version3/models/issueLinkType.mts diff --git a/src/version3/models/issueLinkTypes.mts b/src/version3/models/issueLinkTypes.mts new file mode 100644 index 0000000000..696252c572 --- /dev/null +++ b/src/version3/models/issueLinkTypes.mts @@ -0,0 +1,7 @@ +import { IssueLinkType } from './issueLinkType.mjs'; + +/** A list of issue link type beans. */ +export interface IssueLinkTypes { + /** The issue link type bean. */ + issueLinkTypes?: IssueLinkType[]; +} diff --git a/src/version3/models/issueLinkTypes.ts b/src/version3/models/issueLinkTypes.ts deleted file mode 100644 index f630dc11a8..0000000000 --- a/src/version3/models/issueLinkTypes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IssueLinkType } from './issueLinkType'; - -/** A list of issue link type beans. */ -export interface IssueLinkTypes { - /** The issue link type bean. */ - issueLinkTypes?: IssueLinkType[]; -} diff --git a/src/version3/models/issueList.ts b/src/version3/models/issueList.mts similarity index 100% rename from src/version3/models/issueList.ts rename to src/version3/models/issueList.mts diff --git a/src/version3/models/issueMatches.mts b/src/version3/models/issueMatches.mts new file mode 100644 index 0000000000..2dea52f985 --- /dev/null +++ b/src/version3/models/issueMatches.mts @@ -0,0 +1,6 @@ +import { IssueMatchesForJQL } from './issueMatchesForJQL.mjs'; + +/** A list of matched issues or errors for each Jql query, in the order the Jql queries were passed. */ +export interface IssueMatches { + matches: IssueMatchesForJQL[]; +} diff --git a/src/version3/models/issueMatches.ts b/src/version3/models/issueMatches.ts deleted file mode 100644 index 63c11b61ce..0000000000 --- a/src/version3/models/issueMatches.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueMatchesForJQL } from './issueMatchesForJQL'; - -/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ -export interface IssueMatches { - matches: IssueMatchesForJQL[]; -} diff --git a/src/version3/models/issueMatchesForJQL.mts b/src/version3/models/issueMatchesForJQL.mts new file mode 100644 index 0000000000..574a4e4cee --- /dev/null +++ b/src/version3/models/issueMatchesForJQL.mts @@ -0,0 +1,7 @@ +/** A list of the issues matched to a Jql query or details of errors encountered during matching. */ +export interface IssueMatchesForJQL { + /** A list of issue IDs. */ + matchedIssues: number[]; + /** A list of errors. */ + errors: string[]; +} diff --git a/src/version3/models/issueMatchesForJQL.ts b/src/version3/models/issueMatchesForJQL.ts deleted file mode 100644 index a50a51b134..0000000000 --- a/src/version3/models/issueMatchesForJQL.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ -export interface IssueMatchesForJQL { - /** A list of issue IDs. */ - matchedIssues: number[]; - /** A list of errors. */ - errors: string[]; -} diff --git a/src/version3/models/issuePickerSuggestions.mts b/src/version3/models/issuePickerSuggestions.mts new file mode 100644 index 0000000000..3c49bbd5f9 --- /dev/null +++ b/src/version3/models/issuePickerSuggestions.mts @@ -0,0 +1,7 @@ +import { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType.mjs'; + +/** A list of issues suggested for use in auto-completion. */ +export interface IssuePickerSuggestions { + /** A list of issues for an issue type suggested for use in auto-completion. */ + sections?: IssuePickerSuggestionsIssueType[]; +} diff --git a/src/version3/models/issuePickerSuggestions.ts b/src/version3/models/issuePickerSuggestions.ts deleted file mode 100644 index 5f9628f291..0000000000 --- a/src/version3/models/issuePickerSuggestions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IssuePickerSuggestionsIssueType } from './issuePickerSuggestionsIssueType'; - -/** A list of issues suggested for use in auto-completion. */ -export interface IssuePickerSuggestions { - /** A list of issues for an issue type suggested for use in auto-completion. */ - sections?: IssuePickerSuggestionsIssueType[]; -} diff --git a/src/version3/models/issuePickerSuggestionsIssueType.mts b/src/version3/models/issuePickerSuggestionsIssueType.mts new file mode 100644 index 0000000000..8fa3047c7f --- /dev/null +++ b/src/version3/models/issuePickerSuggestionsIssueType.mts @@ -0,0 +1,15 @@ +import { SuggestedIssue } from './suggestedIssue.mjs'; + +/** A type of issue suggested for use in auto-completion. */ +export interface IssuePickerSuggestionsIssueType { + /** The label of the type of issues suggested for use in auto-completion. */ + label?: string; + /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ + sub?: string; + /** The ID of the type of issues suggested for use in auto-completion. */ + id?: string; + /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ + msg?: string; + /** A list of issues suggested for use in auto-completion. */ + issues?: SuggestedIssue[]; +} diff --git a/src/version3/models/issuePickerSuggestionsIssueType.ts b/src/version3/models/issuePickerSuggestionsIssueType.ts deleted file mode 100644 index 5016f3b9f4..0000000000 --- a/src/version3/models/issuePickerSuggestionsIssueType.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { SuggestedIssue } from './suggestedIssue'; - -/** A type of issue suggested for use in auto-completion. */ -export interface IssuePickerSuggestionsIssueType { - /** The label of the type of issues suggested for use in auto-completion. */ - label?: string; - /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ - sub?: string; - /** The ID of the type of issues suggested for use in auto-completion. */ - id?: string; - /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ - msg?: string; - /** A list of issues suggested for use in auto-completion. */ - issues?: SuggestedIssue[]; -} diff --git a/src/version3/models/issueSecurityLevelMember.mts b/src/version3/models/issueSecurityLevelMember.mts new file mode 100644 index 0000000000..50f0f88648 --- /dev/null +++ b/src/version3/models/issueSecurityLevelMember.mts @@ -0,0 +1,10 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface IssueSecurityLevelMember { + /** The ID of the issue security level member. */ + id: number; + /** The ID of the issue security level. */ + issueSecurityLevelId: number; + holder?: PermissionHolder; +} diff --git a/src/version3/models/issueSecurityLevelMember.ts b/src/version3/models/issueSecurityLevelMember.ts deleted file mode 100644 index c235a601eb..0000000000 --- a/src/version3/models/issueSecurityLevelMember.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { PermissionHolder } from './permissionHolder'; - -/** Issue security level member. */ -export interface IssueSecurityLevelMember { - /** The ID of the issue security level member. */ - id: number; - /** The ID of the issue security level. */ - issueSecurityLevelId: number; - holder?: PermissionHolder; -} diff --git a/src/version3/models/issueSecuritySchemeToProjectMapping.ts b/src/version3/models/issueSecuritySchemeToProjectMapping.mts similarity index 100% rename from src/version3/models/issueSecuritySchemeToProjectMapping.ts rename to src/version3/models/issueSecuritySchemeToProjectMapping.mts diff --git a/src/version3/models/issueTransition.mts b/src/version3/models/issueTransition.mts new file mode 100644 index 0000000000..c9b9cf107b --- /dev/null +++ b/src/version3/models/issueTransition.mts @@ -0,0 +1,28 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Details of an issue transition. */ +export interface IssueTransition { + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** The name of the issue transition. */ + name?: string; + to?: StatusDetails; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Expand options that include additional transition details in the response. */ + expand?: string; + looped?: boolean; +} diff --git a/src/version3/models/issueTransition.ts b/src/version3/models/issueTransition.ts deleted file mode 100644 index dc7f8afd37..0000000000 --- a/src/version3/models/issueTransition.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { StatusDetails } from './statusDetails'; - -/** Details of an issue transition. */ -export interface IssueTransition { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - to?: StatusDetails; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; -} diff --git a/src/version3/models/issueTypeCreate.ts b/src/version3/models/issueTypeCreate.mts similarity index 100% rename from src/version3/models/issueTypeCreate.ts rename to src/version3/models/issueTypeCreate.mts diff --git a/src/version3/models/issueTypeDetails.mts b/src/version3/models/issueTypeDetails.mts new file mode 100644 index 0000000000..be08ff2ba2 --- /dev/null +++ b/src/version3/models/issueTypeDetails.mts @@ -0,0 +1,24 @@ +import type { Scope } from './scope.mjs'; + +/** Details about an issue type. */ +export interface IssueTypeDetails { + /** The URL of these issue type details. */ + self?: string; + /** The ID of the issue type. */ + id?: string; + /** The description of the issue type. */ + description?: string; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The name of the issue type. */ + name?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + scope?: Scope; +} diff --git a/src/version3/models/issueTypeDetails.ts b/src/version3/models/issueTypeDetails.ts deleted file mode 100644 index 635fffa87a..0000000000 --- a/src/version3/models/issueTypeDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Scope } from './scope'; - -/** Details about an issue type. */ -export interface IssueTypeDetails { - /** The URL of these issue type details. */ - self?: string; - /** The ID of the issue type. */ - id?: string; - /** The description of the issue type. */ - description?: string; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The name of the issue type. */ - name?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - scope?: Scope; -} diff --git a/src/version3/models/issueTypeIds.ts b/src/version3/models/issueTypeIds.mts similarity index 100% rename from src/version3/models/issueTypeIds.ts rename to src/version3/models/issueTypeIds.mts diff --git a/src/version3/models/issueTypeIdsToRemove.ts b/src/version3/models/issueTypeIdsToRemove.mts similarity index 100% rename from src/version3/models/issueTypeIdsToRemove.ts rename to src/version3/models/issueTypeIdsToRemove.mts diff --git a/src/version3/models/issueTypeInfo.ts b/src/version3/models/issueTypeInfo.mts similarity index 100% rename from src/version3/models/issueTypeInfo.ts rename to src/version3/models/issueTypeInfo.mts diff --git a/src/version3/models/issueTypeIssueCreateMetadata.mts b/src/version3/models/issueTypeIssueCreateMetadata.mts new file mode 100644 index 0000000000..7e44ca18a9 --- /dev/null +++ b/src/version3/models/issueTypeIssueCreateMetadata.mts @@ -0,0 +1,28 @@ +import type { Scope } from './scope.mjs'; + +/** Details of the issue creation metadata for an issue type. */ +export interface IssueTypeIssueCreateMetadata { + /** The URL of these issue type details. */ + self?: string; + /** The ID of the issue type. */ + id?: string; + /** The description of the issue type. */ + description?: string; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The name of the issue type. */ + name?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; + /** The ID of the issue type's avatar. */ + avatarId?: number; + /** Unique ID for next-gen projects. */ + entityId?: string; + /** Hierarchy level of the issue type. */ + hierarchyLevel?: number; + scope?: Scope; + /** Expand options that include additional issue type metadata details in the response. */ + expand?: string; + /** List of the fields available when creating an issue for the issue type. */ + fields?: {}; +} diff --git a/src/version3/models/issueTypeIssueCreateMetadata.ts b/src/version3/models/issueTypeIssueCreateMetadata.ts deleted file mode 100644 index ded2c866d2..0000000000 --- a/src/version3/models/issueTypeIssueCreateMetadata.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Scope } from './scope'; - -/** Details of the issue creation metadata for an issue type. */ -export interface IssueTypeIssueCreateMetadata { - /** The URL of these issue type details. */ - self?: string; - /** The ID of the issue type. */ - id?: string; - /** The description of the issue type. */ - description?: string; - /** The URL of the issue type's avatar. */ - iconUrl?: string; - /** The name of the issue type. */ - name?: string; - /** Whether this issue type is used to create subtasks. */ - subtask?: boolean; - /** The ID of the issue type's avatar. */ - avatarId?: number; - /** Unique ID for next-gen projects. */ - entityId?: string; - /** Hierarchy level of the issue type. */ - hierarchyLevel?: number; - scope?: Scope; - /** Expand options that include additional issue type metadata details in the response. */ - expand?: string; - /** List of the fields available when creating an issue for the issue type. */ - fields?: {}; -} diff --git a/src/version3/models/issueTypeScheme.ts b/src/version3/models/issueTypeScheme.mts similarity index 100% rename from src/version3/models/issueTypeScheme.ts rename to src/version3/models/issueTypeScheme.mts diff --git a/src/version3/models/issueTypeSchemeDetails.ts b/src/version3/models/issueTypeSchemeDetails.mts similarity index 100% rename from src/version3/models/issueTypeSchemeDetails.ts rename to src/version3/models/issueTypeSchemeDetails.mts diff --git a/src/version3/models/issueTypeSchemeID.ts b/src/version3/models/issueTypeSchemeID.mts similarity index 100% rename from src/version3/models/issueTypeSchemeID.ts rename to src/version3/models/issueTypeSchemeID.mts diff --git a/src/version3/models/issueTypeSchemeMapping.ts b/src/version3/models/issueTypeSchemeMapping.mts similarity index 100% rename from src/version3/models/issueTypeSchemeMapping.ts rename to src/version3/models/issueTypeSchemeMapping.mts diff --git a/src/version3/models/issueTypeSchemeProjectAssociation.ts b/src/version3/models/issueTypeSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/issueTypeSchemeProjectAssociation.ts rename to src/version3/models/issueTypeSchemeProjectAssociation.mts diff --git a/src/version3/models/issueTypeSchemeProjects.mts b/src/version3/models/issueTypeSchemeProjects.mts new file mode 100644 index 0000000000..b975f1026d --- /dev/null +++ b/src/version3/models/issueTypeSchemeProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** Issue type scheme with a list of the projects that use it. */ +export interface IssueTypeSchemeProjects { + issueTypeScheme?: IssueTypeScheme; + /** The IDs of the projects using the issue type scheme. */ + projectIds: string[]; +} diff --git a/src/version3/models/issueTypeSchemeProjects.ts b/src/version3/models/issueTypeSchemeProjects.ts deleted file mode 100644 index 0efc988728..0000000000 --- a/src/version3/models/issueTypeSchemeProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeScheme } from './issueTypeScheme'; - -/** Issue type scheme with a list of the projects that use it. */ -export interface IssueTypeSchemeProjects { - issueTypeScheme?: IssueTypeScheme; - /** The IDs of the projects using the issue type scheme. */ - projectIds: string[]; -} diff --git a/src/version3/models/issueTypeSchemeUpdateDetails.ts b/src/version3/models/issueTypeSchemeUpdateDetails.mts similarity index 100% rename from src/version3/models/issueTypeSchemeUpdateDetails.ts rename to src/version3/models/issueTypeSchemeUpdateDetails.mts diff --git a/src/version3/models/issueTypeScreenScheme.ts b/src/version3/models/issueTypeScreenScheme.mts similarity index 100% rename from src/version3/models/issueTypeScreenScheme.ts rename to src/version3/models/issueTypeScreenScheme.mts diff --git a/src/version3/models/issueTypeScreenSchemeDetails.mts b/src/version3/models/issueTypeScreenSchemeDetails.mts new file mode 100644 index 0000000000..8c997c0c17 --- /dev/null +++ b/src/version3/models/issueTypeScreenSchemeDetails.mts @@ -0,0 +1,14 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** The details of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeDetails { + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description?: string; + /** + * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an + * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} diff --git a/src/version3/models/issueTypeScreenSchemeDetails.ts b/src/version3/models/issueTypeScreenSchemeDetails.ts deleted file mode 100644 index 40180c1f20..0000000000 --- a/src/version3/models/issueTypeScreenSchemeDetails.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping'; - -/** The details of an issue type screen scheme. */ -export interface IssueTypeScreenSchemeDetails { - /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - /** The description of the issue type screen scheme. The maximum length is 255 characters. */ - description?: string; - /** - * The IDs of the screen schemes for the issue type IDs and _default_. A _default_ entry is required to create an - * issue type screen scheme, it defines the mapping for all issue types without a screen scheme. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version3/models/issueTypeScreenSchemeId.ts b/src/version3/models/issueTypeScreenSchemeId.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeId.ts rename to src/version3/models/issueTypeScreenSchemeId.mts diff --git a/src/version3/models/issueTypeScreenSchemeItem.ts b/src/version3/models/issueTypeScreenSchemeItem.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeItem.ts rename to src/version3/models/issueTypeScreenSchemeItem.mts diff --git a/src/version3/models/issueTypeScreenSchemeMapping.ts b/src/version3/models/issueTypeScreenSchemeMapping.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeMapping.ts rename to src/version3/models/issueTypeScreenSchemeMapping.mts diff --git a/src/version3/models/issueTypeScreenSchemeMappingDetails.mts b/src/version3/models/issueTypeScreenSchemeMappingDetails.mts new file mode 100644 index 0000000000..b8d7f4d5fa --- /dev/null +++ b/src/version3/models/issueTypeScreenSchemeMappingDetails.mts @@ -0,0 +1,10 @@ +import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping.mjs'; + +/** A list of issue type screen scheme mappings. */ +export interface IssueTypeScreenSchemeMappingDetails { + /** + * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is + * added when an issue type screen scheme is created. + */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} diff --git a/src/version3/models/issueTypeScreenSchemeMappingDetails.ts b/src/version3/models/issueTypeScreenSchemeMappingDetails.ts deleted file mode 100644 index 6fce54e81a..0000000000 --- a/src/version3/models/issueTypeScreenSchemeMappingDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IssueTypeScreenSchemeMapping } from './issueTypeScreenSchemeMapping'; - -/** A list of issue type screen scheme mappings. */ -export interface IssueTypeScreenSchemeMappingDetails { - /** - * The list of issue type to screen scheme mappings. A _default_ entry cannot be specified because a default entry is - * added when an issue type screen scheme is created. - */ - issueTypeMappings: IssueTypeScreenSchemeMapping[]; -} diff --git a/src/version3/models/issueTypeScreenSchemeProjectAssociation.ts b/src/version3/models/issueTypeScreenSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeProjectAssociation.ts rename to src/version3/models/issueTypeScreenSchemeProjectAssociation.mts diff --git a/src/version3/models/issueTypeScreenSchemeUpdateDetails.ts b/src/version3/models/issueTypeScreenSchemeUpdateDetails.mts similarity index 100% rename from src/version3/models/issueTypeScreenSchemeUpdateDetails.ts rename to src/version3/models/issueTypeScreenSchemeUpdateDetails.mts diff --git a/src/version3/models/issueTypeScreenSchemesProjects.mts b/src/version3/models/issueTypeScreenSchemesProjects.mts new file mode 100644 index 0000000000..896e054ad3 --- /dev/null +++ b/src/version3/models/issueTypeScreenSchemesProjects.mts @@ -0,0 +1,8 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** Issue type screen scheme with a list of the projects that use it. */ +export interface IssueTypeScreenSchemesProjects { + issueTypeScreenScheme?: IssueTypeScreenScheme; + /** The IDs of the projects using the issue type screen scheme. */ + projectIds: string[]; +} diff --git a/src/version3/models/issueTypeScreenSchemesProjects.ts b/src/version3/models/issueTypeScreenSchemesProjects.ts deleted file mode 100644 index 56a4c64482..0000000000 --- a/src/version3/models/issueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeScreenScheme } from './issueTypeScreenScheme'; - -/** Issue type screen scheme with a list of the projects that use it. */ -export interface IssueTypeScreenSchemesProjects { - issueTypeScreenScheme?: IssueTypeScreenScheme; - /** The IDs of the projects using the issue type screen scheme. */ - projectIds: string[]; -} diff --git a/src/version3/models/issueTypeToContextMapping.ts b/src/version3/models/issueTypeToContextMapping.mts similarity index 100% rename from src/version3/models/issueTypeToContextMapping.ts rename to src/version3/models/issueTypeToContextMapping.mts diff --git a/src/version3/models/issueTypeUpdate.ts b/src/version3/models/issueTypeUpdate.mts similarity index 100% rename from src/version3/models/issueTypeUpdate.ts rename to src/version3/models/issueTypeUpdate.mts diff --git a/src/version3/models/issueTypeWithStatus.mts b/src/version3/models/issueTypeWithStatus.mts new file mode 100644 index 0000000000..1fb3c216c9 --- /dev/null +++ b/src/version3/models/issueTypeWithStatus.mts @@ -0,0 +1,15 @@ +import type { StatusDetails } from './statusDetails.mjs'; + +/** Status details for an issue type. */ +export interface IssueTypeWithStatus { + /** The URL of the issue type's status details. */ + self: string; + /** The ID of the issue type. */ + id: string; + /** The name of the issue type. */ + name: string; + /** Whether this issue type represents subtasks. */ + subtask: boolean; + /** List of status details for the issue type. */ + statuses: StatusDetails[]; +} diff --git a/src/version3/models/issueTypeWithStatus.ts b/src/version3/models/issueTypeWithStatus.ts deleted file mode 100644 index a3f5428260..0000000000 --- a/src/version3/models/issueTypeWithStatus.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { StatusDetails } from './statusDetails'; - -/** Status details for an issue type. */ -export interface IssueTypeWithStatus { - /** The URL of the issue type's status details. */ - self: string; - /** The ID of the issue type. */ - id: string; - /** The name of the issue type. */ - name: string; - /** Whether this issue type represents subtasks. */ - subtask: boolean; - /** List of status details for the issue type. */ - statuses: StatusDetails[]; -} diff --git a/src/version3/models/issueTypeWorkflowMapping.ts b/src/version3/models/issueTypeWorkflowMapping.mts similarity index 100% rename from src/version3/models/issueTypeWorkflowMapping.ts rename to src/version3/models/issueTypeWorkflowMapping.mts diff --git a/src/version3/models/issueTypesWorkflowMapping.ts b/src/version3/models/issueTypesWorkflowMapping.mts similarity index 100% rename from src/version3/models/issueTypesWorkflowMapping.ts rename to src/version3/models/issueTypesWorkflowMapping.mts diff --git a/src/version3/models/issueUpdateDetails.mts b/src/version3/models/issueUpdateDetails.mts new file mode 100644 index 0000000000..b6bca7e8c6 --- /dev/null +++ b/src/version3/models/issueUpdateDetails.mts @@ -0,0 +1,24 @@ +import type { Document } from './document.mjs'; +import { EntityProperty } from './entityProperty.mjs'; +import { Fields } from './fields.mjs'; +import { HistoryMetadata } from './historyMetadata.mjs'; +import type { IssueTransition } from './issueTransition.mjs'; + +/** Details of an issue update request. */ +export interface IssueUpdateDetails { + transition?: IssueTransition; + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields?: Partial & { description: string | Document }> | any; + /** + * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that + * fields included in here cannot be included in `fields`. + */ + update?: {}; + historyMetadata?: HistoryMetadata; + /** Details of issue properties to be add or update. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/issueUpdateDetails.ts b/src/version3/models/issueUpdateDetails.ts deleted file mode 100644 index 220ca703e6..0000000000 --- a/src/version3/models/issueUpdateDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Document } from './document'; -import { EntityProperty } from './entityProperty'; -import { Fields } from './fields'; -import { HistoryMetadata } from './historyMetadata'; -import { IssueTransition } from './issueTransition'; - -/** Details of an issue update request. */ -export interface IssueUpdateDetails { - transition?: IssueTransition; - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields?: Partial & { description: string | Document }> | any; - /** - * A Map containing the field field name and a list of operations to perform on the issue screen field. Note that - * fields included in here cannot be included in `fields`. - */ - update?: {}; - historyMetadata?: HistoryMetadata; - /** Details of issue properties to be add or update. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/issueUpdateMetadata.ts b/src/version3/models/issueUpdateMetadata.mts similarity index 100% rename from src/version3/models/issueUpdateMetadata.ts rename to src/version3/models/issueUpdateMetadata.mts diff --git a/src/version3/models/issuesAndJQLQueries.mts b/src/version3/models/issuesAndJQLQueries.mts new file mode 100644 index 0000000000..b1992168b3 --- /dev/null +++ b/src/version3/models/issuesAndJQLQueries.mts @@ -0,0 +1,7 @@ +/** List of issues and Jql queries. */ +export interface IssuesAndJQLQueries { + /** A list of Jql queries. */ + jqls: string[]; + /** A list of issue IDs. */ + issueIds: number[]; +} diff --git a/src/version3/models/issuesAndJQLQueries.ts b/src/version3/models/issuesAndJQLQueries.ts deleted file mode 100644 index 9137c4b2bb..0000000000 --- a/src/version3/models/issuesAndJQLQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** List of issues and JQL queries. */ -export interface IssuesAndJQLQueries { - /** A list of JQL queries. */ - jqls: string[]; - /** A list of issue IDs. */ - issueIds: number[]; -} diff --git a/src/version3/models/issuesJqlMetaData.mts b/src/version3/models/issuesJqlMetaData.mts new file mode 100644 index 0000000000..9ecbd61883 --- /dev/null +++ b/src/version3/models/issuesJqlMetaData.mts @@ -0,0 +1,13 @@ +/** The description of the page of issues loaded by the provided Jql query. */ +export interface IssuesJqlMetaData { + /** The index of the first issue. */ + startAt: number; + /** The maximum number of issues that could be loaded in this evaluation. */ + maxResults: number; + /** The number of issues that were loaded in this evaluation. */ + count: number; + /** The total number of issues the Jql returned. */ + totalCount: number; + /** Any warnings related to the Jql query. Present only if the validation mode was set to `warn`. */ + validationWarnings?: string[]; +} diff --git a/src/version3/models/issuesJqlMetaData.ts b/src/version3/models/issuesJqlMetaData.ts deleted file mode 100644 index ee3e5827e2..0000000000 --- a/src/version3/models/issuesJqlMetaData.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** The description of the page of issues loaded by the provided JQL query. */ -export interface IssuesJqlMetaData { - /** The index of the first issue. */ - startAt: number; - /** The maximum number of issues that could be loaded in this evaluation. */ - maxResults: number; - /** The number of issues that were loaded in this evaluation. */ - count: number; - /** The total number of issues the JQL returned. */ - totalCount: number; - /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ - validationWarnings?: string[]; -} diff --git a/src/version3/models/issuesMeta.mts b/src/version3/models/issuesMeta.mts new file mode 100644 index 0000000000..569f4bf2a8 --- /dev/null +++ b/src/version3/models/issuesMeta.mts @@ -0,0 +1,6 @@ +import { IssuesJqlMetaData } from './issuesJqlMetaData.mjs'; + +/** Meta data describing the `issues` context variable. */ +export interface IssuesMeta { + jql?: IssuesJqlMetaData; +} diff --git a/src/version3/models/issuesMeta.ts b/src/version3/models/issuesMeta.ts deleted file mode 100644 index 6158728196..0000000000 --- a/src/version3/models/issuesMeta.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssuesJqlMetaData } from './issuesJqlMetaData'; - -/** Meta data describing the `issues` context variable. */ -export interface IssuesMeta { - jql?: IssuesJqlMetaData; -} diff --git a/src/version3/models/issuesUpdate.mts b/src/version3/models/issuesUpdate.mts new file mode 100644 index 0000000000..3c850d1da5 --- /dev/null +++ b/src/version3/models/issuesUpdate.mts @@ -0,0 +1,5 @@ +import { IssueUpdateDetails } from './issueUpdateDetails.mjs'; + +export interface IssuesUpdate { + issueUpdates?: IssueUpdateDetails[]; +} diff --git a/src/version3/models/issuesUpdate.ts b/src/version3/models/issuesUpdate.ts deleted file mode 100644 index 57cb9b2bf8..0000000000 --- a/src/version3/models/issuesUpdate.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IssueUpdateDetails } from './issueUpdateDetails'; - -export interface IssuesUpdate { - issueUpdates?: IssueUpdateDetails[]; -} diff --git a/src/version3/models/jQLPersonalDataMigrationRequest.mts b/src/version3/models/jQLPersonalDataMigrationRequest.mts new file mode 100644 index 0000000000..793136c7cd --- /dev/null +++ b/src/version3/models/jQLPersonalDataMigrationRequest.mts @@ -0,0 +1,5 @@ +/** The Jql queries to be converted. */ +export interface JQLPersonalDataMigrationRequest { + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings?: string[]; +} diff --git a/src/version3/models/jQLPersonalDataMigrationRequest.ts b/src/version3/models/jQLPersonalDataMigrationRequest.ts deleted file mode 100644 index 0a07308173..0000000000 --- a/src/version3/models/jQLPersonalDataMigrationRequest.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The JQL queries to be converted. */ -export interface JQLPersonalDataMigrationRequest { - /** A list of queries with user identifiers. Maximum of 100 queries. */ - queryStrings?: string[]; -} diff --git a/src/version3/models/jQLQueryWithUnknownUsers.mts b/src/version3/models/jQLQueryWithUnknownUsers.mts new file mode 100644 index 0000000000..cfdda79f69 --- /dev/null +++ b/src/version3/models/jQLQueryWithUnknownUsers.mts @@ -0,0 +1,7 @@ +/** Jql queries that contained users that could not be found */ +export interface JQLQueryWithUnknownUsers { + /** The original query, for reference */ + originalQuery?: string; + /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ + convertedQuery?: string; +} diff --git a/src/version3/models/jQLQueryWithUnknownUsers.ts b/src/version3/models/jQLQueryWithUnknownUsers.ts deleted file mode 100644 index fc6005951f..0000000000 --- a/src/version3/models/jQLQueryWithUnknownUsers.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** JQL queries that contained users that could not be found */ -export interface JQLQueryWithUnknownUsers { - /** The original query, for reference */ - originalQuery?: string; - /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ - convertedQuery?: string; -} diff --git a/src/version3/models/jQLReferenceData.mts b/src/version3/models/jQLReferenceData.mts new file mode 100644 index 0000000000..a76b47e97d --- /dev/null +++ b/src/version3/models/jQLReferenceData.mts @@ -0,0 +1,12 @@ +import { FieldReferenceData } from './fieldReferenceData.mjs'; +import { FunctionReferenceData } from './functionReferenceData.mjs'; + +/** Lists of Jql reference data. */ +export interface JQLReferenceData { + /** List of fields usable in Jql queries. */ + visibleFieldNames?: FieldReferenceData[]; + /** List of functions usable in Jql queries. */ + visibleFunctionNames?: FunctionReferenceData[]; + /** List of Jql query reserved words. */ + jqlReservedWords?: string[]; +} diff --git a/src/version3/models/jQLReferenceData.ts b/src/version3/models/jQLReferenceData.ts deleted file mode 100644 index af9cb82c4b..0000000000 --- a/src/version3/models/jQLReferenceData.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { FieldReferenceData } from './fieldReferenceData'; -import { FunctionReferenceData } from './functionReferenceData'; - -/** Lists of JQL reference data. */ -export interface JQLReferenceData { - /** List of fields usable in JQL queries. */ - visibleFieldNames?: FieldReferenceData[]; - /** List of functions usable in JQL queries. */ - visibleFunctionNames?: FunctionReferenceData[]; - /** List of JQL query reserved words. */ - jqlReservedWords?: string[]; -} diff --git a/src/version3/models/jexpIssues.mts b/src/version3/models/jexpIssues.mts new file mode 100644 index 0000000000..1b6e22b862 --- /dev/null +++ b/src/version3/models/jexpIssues.mts @@ -0,0 +1,6 @@ +import { JexpJqlIssues } from './jexpJqlIssues.mjs'; + +/** The Jql specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export interface JexpIssues { + jql?: JexpJqlIssues; +} diff --git a/src/version3/models/jexpIssues.ts b/src/version3/models/jexpIssues.ts deleted file mode 100644 index d2ece42457..0000000000 --- a/src/version3/models/jexpIssues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { JexpJqlIssues } from './jexpJqlIssues'; - -/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ -export interface JexpIssues { - jql?: JexpJqlIssues; -} diff --git a/src/version3/models/jexpJqlIssues.mts b/src/version3/models/jexpJqlIssues.mts new file mode 100644 index 0000000000..9de6c6aa08 --- /dev/null +++ b/src/version3/models/jexpJqlIssues.mts @@ -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 `startAt` and `maxResults` properties. To + * determine whether it is necessary to iterate to ensure all the issues returned by the Jql query are evaluated, + * inspect `meta.issues.jql.count` in the response. + */ +export interface JexpJqlIssues { + /** The Jql query. */ + query?: string; + /** The index of the first issue to return from the Jql query. */ + startAt?: number; + /** + * 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; + /** Determines how to validate the Jql query and treat the validation results. */ + validation?: string; +} diff --git a/src/version3/models/jexpJqlIssues.ts b/src/version3/models/jexpJqlIssues.ts deleted file mode 100644 index 3ed84d5edf..0000000000 --- a/src/version3/models/jexpJqlIssues.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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 `startAt` and `maxResults` properties. To - * determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, - * inspect `meta.issues.jql.count` in the response. - */ -export interface JexpJqlIssues { - /** The JQL query. */ - query?: string; - /** The index of the first issue to return from the JQL query. */ - startAt?: number; - /** - * 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; - /** Determines how to validate the JQL query and treat the validation results. */ - validation?: string; -} diff --git a/src/version3/models/jiraExpressionAnalysis.mts b/src/version3/models/jiraExpressionAnalysis.mts new file mode 100644 index 0000000000..8b301a37c5 --- /dev/null +++ b/src/version3/models/jiraExpressionAnalysis.mts @@ -0,0 +1,18 @@ +import { JiraExpressionComplexity } from './jiraExpressionComplexity.mjs'; +import { JiraExpressionValidationError } from './jiraExpressionValidationError.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionAnalysis { + /** The analysed expression. */ + expression: string; + /** A list of validation errors. Not included if the expression is valid. */ + errors?: JiraExpressionValidationError[]; + /** + * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime + * (for example, if it executes too many expensive operations). + */ + valid: boolean; + /** EXPERIMENTAL. The inferred type of the expression. */ + type?: string; + complexity?: JiraExpressionComplexity; +} diff --git a/src/version3/models/jiraExpressionAnalysis.ts b/src/version3/models/jiraExpressionAnalysis.ts deleted file mode 100644 index 93c69308c4..0000000000 --- a/src/version3/models/jiraExpressionAnalysis.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { JiraExpressionComplexity } from './jiraExpressionComplexity'; -import { JiraExpressionValidationError } from './jiraExpressionValidationError'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionAnalysis { - /** The analysed expression. */ - expression: string; - /** A list of validation errors. Not included if the expression is valid. */ - errors?: JiraExpressionValidationError[]; - /** - * Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime - * (for example, if it executes too many expensive operations). - */ - valid: boolean; - /** EXPERIMENTAL. The inferred type of the expression. */ - type?: string; - complexity?: JiraExpressionComplexity; -} diff --git a/src/version3/models/jiraExpressionComplexity.ts b/src/version3/models/jiraExpressionComplexity.mts similarity index 100% rename from src/version3/models/jiraExpressionComplexity.ts rename to src/version3/models/jiraExpressionComplexity.mts diff --git a/src/version3/models/jiraExpressionEvalContext.mts b/src/version3/models/jiraExpressionEvalContext.mts new file mode 100644 index 0000000000..67cc03213c --- /dev/null +++ b/src/version3/models/jiraExpressionEvalContext.mts @@ -0,0 +1,31 @@ +import { CustomContextVariable } from './customContextVariable.mjs'; +import { IdOrKey } from './idOrKey.mjs'; +import { JexpIssues } from './jexpIssues.mjs'; + +export interface JiraExpressionEvalContext { + issue?: IdOrKey; + issues?: JexpIssues; + 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?: CustomContextVariable[]; +} diff --git a/src/version3/models/jiraExpressionEvalContext.ts b/src/version3/models/jiraExpressionEvalContext.ts deleted file mode 100644 index 83ea9fffb3..0000000000 --- a/src/version3/models/jiraExpressionEvalContext.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { CustomContextVariable } from './customContextVariable'; -import { IdOrKey } from './idOrKey'; -import { JexpIssues } from './jexpIssues'; - -export interface JiraExpressionEvalContext { - issue?: IdOrKey; - issues?: JexpIssues; - 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?: CustomContextVariable[]; -} diff --git a/src/version3/models/jiraExpressionEvalRequest.mts b/src/version3/models/jiraExpressionEvalRequest.mts new file mode 100644 index 0000000000..79a015476d --- /dev/null +++ b/src/version3/models/jiraExpressionEvalRequest.mts @@ -0,0 +1,7 @@ +import { JiraExpressionEvalContext } from './jiraExpressionEvalContext.mjs'; + +export interface JiraExpressionEvalRequest { + /** The Jira expression to evaluate. */ + expression: string; + context?: JiraExpressionEvalContext; +} diff --git a/src/version3/models/jiraExpressionEvalRequest.ts b/src/version3/models/jiraExpressionEvalRequest.ts deleted file mode 100644 index cc768d239b..0000000000 --- a/src/version3/models/jiraExpressionEvalRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JiraExpressionEvalContext } from './jiraExpressionEvalContext'; - -export interface JiraExpressionEvalRequest { - /** The Jira expression to evaluate. */ - expression: string; - context?: JiraExpressionEvalContext; -} diff --git a/src/version3/models/jiraExpressionEvaluationMetaData.mts b/src/version3/models/jiraExpressionEvaluationMetaData.mts new file mode 100644 index 0000000000..4cb3c424d4 --- /dev/null +++ b/src/version3/models/jiraExpressionEvaluationMetaData.mts @@ -0,0 +1,7 @@ +import { IssuesMeta } from './issuesMeta.mjs'; +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity.mjs'; + +export interface JiraExpressionEvaluationMetaData { + complexity?: JiraExpressionsComplexity; + issues?: IssuesMeta; +} diff --git a/src/version3/models/jiraExpressionEvaluationMetaData.ts b/src/version3/models/jiraExpressionEvaluationMetaData.ts deleted file mode 100644 index aba849f5d7..0000000000 --- a/src/version3/models/jiraExpressionEvaluationMetaData.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { IssuesMeta } from './issuesMeta'; -import { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; - -export interface JiraExpressionEvaluationMetaData { - complexity?: JiraExpressionsComplexity; - issues?: IssuesMeta; -} diff --git a/src/version3/models/jiraExpressionForAnalysis.ts b/src/version3/models/jiraExpressionForAnalysis.mts similarity index 100% rename from src/version3/models/jiraExpressionForAnalysis.ts rename to src/version3/models/jiraExpressionForAnalysis.mts diff --git a/src/version3/models/jiraExpressionResult.mts b/src/version3/models/jiraExpressionResult.mts new file mode 100644 index 0000000000..4b5806a0af --- /dev/null +++ b/src/version3/models/jiraExpressionResult.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData.mjs'; + +/** The result of evaluating a Jira expression. */ +export interface JiraExpressionResult { + /** + * 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: any; + meta?: JiraExpressionEvaluationMetaData; +} diff --git a/src/version3/models/jiraExpressionResult.ts b/src/version3/models/jiraExpressionResult.ts deleted file mode 100644 index 3fd9e8a227..0000000000 --- a/src/version3/models/jiraExpressionResult.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JiraExpressionEvaluationMetaData } from './jiraExpressionEvaluationMetaData'; - -/** The result of evaluating a Jira expression. */ -export interface JiraExpressionResult { - /** - * 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: any; - meta?: JiraExpressionEvaluationMetaData; -} diff --git a/src/version3/models/jiraExpressionValidationError.ts b/src/version3/models/jiraExpressionValidationError.mts similarity index 100% rename from src/version3/models/jiraExpressionValidationError.ts rename to src/version3/models/jiraExpressionValidationError.mts diff --git a/src/version3/models/jiraExpressionsAnalysis.mts b/src/version3/models/jiraExpressionsAnalysis.mts new file mode 100644 index 0000000000..2cd80ae444 --- /dev/null +++ b/src/version3/models/jiraExpressionsAnalysis.mts @@ -0,0 +1,7 @@ +import { JiraExpressionAnalysis } from './jiraExpressionAnalysis.mjs'; + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionsAnalysis { + /** The results of Jira expressions analysis. */ + results: JiraExpressionAnalysis[]; +} diff --git a/src/version3/models/jiraExpressionsAnalysis.ts b/src/version3/models/jiraExpressionsAnalysis.ts deleted file mode 100644 index 36e3231b87..0000000000 --- a/src/version3/models/jiraExpressionsAnalysis.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JiraExpressionAnalysis } from './jiraExpressionAnalysis'; - -/** Details about the analysed Jira expression. */ -export interface JiraExpressionsAnalysis { - /** The results of Jira expressions analysis. */ - results: JiraExpressionAnalysis[]; -} diff --git a/src/version3/models/jiraExpressionsComplexity.mts b/src/version3/models/jiraExpressionsComplexity.mts new file mode 100644 index 0000000000..cf53e8b697 --- /dev/null +++ b/src/version3/models/jiraExpressionsComplexity.mts @@ -0,0 +1,8 @@ +import { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue.mjs'; + +export interface JiraExpressionsComplexity { + steps?: JiraExpressionsComplexityValue; + expensiveOperations?: JiraExpressionsComplexityValue; + beans?: JiraExpressionsComplexityValue; + primitiveValues?: JiraExpressionsComplexityValue; +} diff --git a/src/version3/models/jiraExpressionsComplexity.ts b/src/version3/models/jiraExpressionsComplexity.ts deleted file mode 100644 index 3dfc524719..0000000000 --- a/src/version3/models/jiraExpressionsComplexity.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JiraExpressionsComplexityValue } from './jiraExpressionsComplexityValue'; - -export interface JiraExpressionsComplexity { - steps?: JiraExpressionsComplexityValue; - expensiveOperations?: JiraExpressionsComplexityValue; - beans?: JiraExpressionsComplexityValue; - primitiveValues?: JiraExpressionsComplexityValue; -} diff --git a/src/version3/models/jiraExpressionsComplexityValue.ts b/src/version3/models/jiraExpressionsComplexityValue.mts similarity index 100% rename from src/version3/models/jiraExpressionsComplexityValue.ts rename to src/version3/models/jiraExpressionsComplexityValue.mts diff --git a/src/version3/models/jiraStatus.mts b/src/version3/models/jiraStatus.mts new file mode 100644 index 0000000000..73715e1b5a --- /dev/null +++ b/src/version3/models/jiraStatus.mts @@ -0,0 +1,17 @@ +import { ProjectIssueTypes } from './projectIssueTypes.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of a status. */ +export interface JiraStatus { + /** 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. */ + usages?: ProjectIssueTypes[]; +} diff --git a/src/version3/models/jiraStatus.ts b/src/version3/models/jiraStatus.ts deleted file mode 100644 index 2780805b6d..0000000000 --- a/src/version3/models/jiraStatus.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ProjectIssueTypes } from './projectIssueTypes'; -import { StatusScope } from './statusScope'; - -/** Details of a status. */ -export interface JiraStatus { - /** 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. */ - usages?: ProjectIssueTypes[]; -} diff --git a/src/version3/models/jqlFunctionPrecomputation.ts b/src/version3/models/jqlFunctionPrecomputation.mts similarity index 100% rename from src/version3/models/jqlFunctionPrecomputation.ts rename to src/version3/models/jqlFunctionPrecomputation.mts diff --git a/src/version3/models/jqlFunctionPrecomputationUpdate.ts b/src/version3/models/jqlFunctionPrecomputationUpdate.mts similarity index 100% rename from src/version3/models/jqlFunctionPrecomputationUpdate.ts rename to src/version3/models/jqlFunctionPrecomputationUpdate.mts diff --git a/src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts b/src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts new file mode 100644 index 0000000000..1661fb3202 --- /dev/null +++ b/src/version3/models/jqlFunctionPrecomputationUpdateRequest.mts @@ -0,0 +1,6 @@ +import { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate.mjs'; + +/** List of pairs (id and value) for precomputation updates. */ +export interface JqlFunctionPrecomputationUpdateRequest { + values?: JqlFunctionPrecomputationUpdate[]; +} diff --git a/src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts b/src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts deleted file mode 100644 index f40bc93095..0000000000 --- a/src/version3/models/jqlFunctionPrecomputationUpdateRequest.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { JqlFunctionPrecomputationUpdate } from './jqlFunctionPrecomputationUpdate'; - -/** List of pairs (id and value) for precomputation updates. */ -export interface JqlFunctionPrecomputationUpdateRequest { - values?: JqlFunctionPrecomputationUpdate[]; -} diff --git a/src/version3/models/jqlQueriesToParse.mts b/src/version3/models/jqlQueriesToParse.mts new file mode 100644 index 0000000000..9bb4f6ad1a --- /dev/null +++ b/src/version3/models/jqlQueriesToParse.mts @@ -0,0 +1,5 @@ +/** A list of Jql queries to parse. */ +export interface JqlQueriesToParse { + /** A list of queries to parse. */ + queries: string[]; +} diff --git a/src/version3/models/jqlQueriesToParse.ts b/src/version3/models/jqlQueriesToParse.ts deleted file mode 100644 index 69990243f3..0000000000 --- a/src/version3/models/jqlQueriesToParse.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** A list of JQL queries to parse. */ -export interface JqlQueriesToParse { - /** A list of queries to parse. */ - queries: string[]; -} diff --git a/src/version3/models/jqlQueriesToSanitize.mts b/src/version3/models/jqlQueriesToSanitize.mts new file mode 100644 index 0000000000..9200763ff7 --- /dev/null +++ b/src/version3/models/jqlQueriesToSanitize.mts @@ -0,0 +1,7 @@ +import { JqlQueryToSanitize } from './jqlQueryToSanitize.mjs'; + +/** The list of Jql queries to sanitize for the given account IDs. */ +export interface JqlQueriesToSanitize { + /** The list of Jql queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: JqlQueryToSanitize[]; +} diff --git a/src/version3/models/jqlQueriesToSanitize.ts b/src/version3/models/jqlQueriesToSanitize.ts deleted file mode 100644 index 01cc5f923a..0000000000 --- a/src/version3/models/jqlQueriesToSanitize.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JqlQueryToSanitize } from './jqlQueryToSanitize'; - -/** The list of JQL queries to sanitize for the given account IDs. */ -export interface JqlQueriesToSanitize { - /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ - queries: JqlQueryToSanitize[]; -} diff --git a/src/version3/models/jqlQuery.mts b/src/version3/models/jqlQuery.mts new file mode 100644 index 0000000000..f325fe5b5c --- /dev/null +++ b/src/version3/models/jqlQuery.mts @@ -0,0 +1,8 @@ +import { JqlQueryClause } from './jqlQueryClause.mjs'; +import { JqlQueryOrderByClause } from './jqlQueryOrderByClause.mjs'; + +/** A parsed Jql query. */ +export interface JqlQuery { + where?: JqlQueryClause; + orderBy?: JqlQueryOrderByClause; +} diff --git a/src/version3/models/jqlQuery.ts b/src/version3/models/jqlQuery.ts deleted file mode 100644 index e9dc1cdbae..0000000000 --- a/src/version3/models/jqlQuery.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JqlQueryClause } from './jqlQueryClause'; -import { JqlQueryOrderByClause } from './jqlQueryOrderByClause'; - -/** A parsed JQL query. */ -export interface JqlQuery { - where?: JqlQueryClause; - orderBy?: JqlQueryOrderByClause; -} diff --git a/src/version3/models/jqlQueryClause.mts b/src/version3/models/jqlQueryClause.mts new file mode 100644 index 0000000000..359f6a2af3 --- /dev/null +++ b/src/version3/models/jqlQueryClause.mts @@ -0,0 +1,2 @@ +/** A Jql query clause. */ +export interface JqlQueryClause {} diff --git a/src/version3/models/jqlQueryClause.ts b/src/version3/models/jqlQueryClause.ts deleted file mode 100644 index 15c1a05c57..0000000000 --- a/src/version3/models/jqlQueryClause.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** A JQL query clause. */ -export interface JqlQueryClause {} diff --git a/src/version3/models/jqlQueryField.mts b/src/version3/models/jqlQueryField.mts new file mode 100644 index 0000000000..87c8fb4408 --- /dev/null +++ b/src/version3/models/jqlQueryField.mts @@ -0,0 +1,12 @@ +import { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty.mjs'; + +/** + * A field used in a Jql query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) + * for more information about fields in Jql queries. + */ +export interface JqlQueryField { + /** The name of the field. */ + name: string; + /** When the field refers to a value in an entity property, details of the entity property value. */ + property?: JqlQueryFieldEntityProperty[]; +} diff --git a/src/version3/models/jqlQueryField.ts b/src/version3/models/jqlQueryField.ts deleted file mode 100644 index cc1358df46..0000000000 --- a/src/version3/models/jqlQueryField.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { JqlQueryFieldEntityProperty } from './jqlQueryFieldEntityProperty'; - -/** - * A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) - * for more information about fields in JQL queries. - */ -export interface JqlQueryField { - /** The name of the field. */ - name: string; - /** When the field refers to a value in an entity property, details of the entity property value. */ - property?: JqlQueryFieldEntityProperty[]; -} diff --git a/src/version3/models/jqlQueryFieldEntityProperty.ts b/src/version3/models/jqlQueryFieldEntityProperty.mts similarity index 100% rename from src/version3/models/jqlQueryFieldEntityProperty.ts rename to src/version3/models/jqlQueryFieldEntityProperty.mts diff --git a/src/version3/models/jqlQueryOrderByClause.mts b/src/version3/models/jqlQueryOrderByClause.mts new file mode 100644 index 0000000000..dbf27a467d --- /dev/null +++ b/src/version3/models/jqlQueryOrderByClause.mts @@ -0,0 +1,7 @@ +import { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement.mjs'; + +/** Details of the order-by Jql clause. */ +export interface JqlQueryOrderByClause { + /** The list of order-by clause fields and their ordering directives. */ + fields: JqlQueryOrderByClauseElement[]; +} diff --git a/src/version3/models/jqlQueryOrderByClause.ts b/src/version3/models/jqlQueryOrderByClause.ts deleted file mode 100644 index ecd2773b65..0000000000 --- a/src/version3/models/jqlQueryOrderByClause.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { JqlQueryOrderByClauseElement } from './jqlQueryOrderByClauseElement'; - -/** Details of the order-by JQL clause. */ -export interface JqlQueryOrderByClause { - /** The list of order-by clause fields and their ordering directives. */ - fields: JqlQueryOrderByClauseElement[]; -} diff --git a/src/version3/models/jqlQueryOrderByClauseElement.mts b/src/version3/models/jqlQueryOrderByClauseElement.mts new file mode 100644 index 0000000000..8be5d5f22a --- /dev/null +++ b/src/version3/models/jqlQueryOrderByClauseElement.mts @@ -0,0 +1,8 @@ +import { JqlQueryField } from './jqlQueryField.mjs'; + +/** An element of the order-by Jql clause. */ +export interface JqlQueryOrderByClauseElement { + field: JqlQueryField; + /** The direction in which to order the results. */ + direction?: string; +} diff --git a/src/version3/models/jqlQueryOrderByClauseElement.ts b/src/version3/models/jqlQueryOrderByClauseElement.ts deleted file mode 100644 index 925d9ee8ab..0000000000 --- a/src/version3/models/jqlQueryOrderByClauseElement.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { JqlQueryField } from './jqlQueryField'; - -/** An element of the order-by JQL clause. */ -export interface JqlQueryOrderByClauseElement { - field: JqlQueryField; - /** The direction in which to order the results. */ - direction?: string; -} diff --git a/src/version3/models/jqlQueryToSanitize.mts b/src/version3/models/jqlQueryToSanitize.mts new file mode 100644 index 0000000000..93ae518e5b --- /dev/null +++ b/src/version3/models/jqlQueryToSanitize.mts @@ -0,0 +1,13 @@ +/** + * The Jql query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous + * user. + */ +export interface JqlQueryToSanitize { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The query to sanitize. */ + query: string; +} diff --git a/src/version3/models/jqlQueryToSanitize.ts b/src/version3/models/jqlQueryToSanitize.ts deleted file mode 100644 index e774eaf2af..0000000000 --- a/src/version3/models/jqlQueryToSanitize.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous - * user. - */ -export interface JqlQueryToSanitize { - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The query to sanitize. */ - query: string; -} diff --git a/src/version3/models/jsonType.ts b/src/version3/models/jsonType.mts similarity index 100% rename from src/version3/models/jsonType.ts rename to src/version3/models/jsonType.mts diff --git a/src/version3/models/license.mts b/src/version3/models/license.mts new file mode 100644 index 0000000000..70db44801a --- /dev/null +++ b/src/version3/models/license.mts @@ -0,0 +1,7 @@ +import { LicensedApplication } from './licensedApplication.mjs'; + +/** Details about a license for the Jira instance. */ +export interface License { + /** The applications under this license. */ + applications: LicensedApplication[]; +} diff --git a/src/version3/models/license.ts b/src/version3/models/license.ts deleted file mode 100644 index bda74a19a9..0000000000 --- a/src/version3/models/license.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { LicensedApplication } from './licensedApplication'; - -/** Details about a license for the Jira instance. */ -export interface License { - /** The applications under this license. */ - applications: LicensedApplication[]; -} diff --git a/src/version3/models/licenseMetric.ts b/src/version3/models/licenseMetric.mts similarity index 100% rename from src/version3/models/licenseMetric.ts rename to src/version3/models/licenseMetric.mts diff --git a/src/version3/models/licensedApplication.ts b/src/version3/models/licensedApplication.mts similarity index 100% rename from src/version3/models/licensedApplication.ts rename to src/version3/models/licensedApplication.mts diff --git a/src/version3/models/linkGroup.mts b/src/version3/models/linkGroup.mts new file mode 100644 index 0000000000..592d094e0a --- /dev/null +++ b/src/version3/models/linkGroup.mts @@ -0,0 +1,11 @@ +import type { SimpleLink } from './simpleLink.mjs'; + +/** Details a link group, which defines issue operations. */ +export interface LinkGroup { + id?: string; + styleClass?: string; + header?: SimpleLink; + weight?: number; + links?: SimpleLink[]; + groups?: LinkGroup[]; +} diff --git a/src/version3/models/linkGroup.ts b/src/version3/models/linkGroup.ts deleted file mode 100644 index 3450796946..0000000000 --- a/src/version3/models/linkGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SimpleLink } from './simpleLink'; - -/** Details a link group, which defines issue operations. */ -export interface LinkGroup { - id?: string; - styleClass?: string; - header?: SimpleLink; - weight?: number; - links?: SimpleLink[]; - groups?: LinkGroup[]; -} diff --git a/src/version3/models/linkIssueRequestJson.mts b/src/version3/models/linkIssueRequestJson.mts new file mode 100644 index 0000000000..b7ad004e56 --- /dev/null +++ b/src/version3/models/linkIssueRequestJson.mts @@ -0,0 +1,10 @@ +import type { Comment } from './comment.mjs'; +import { IssueLinkType } from './issueLinkType.mjs'; +import { LinkedIssue } from './linkedIssue.mjs'; + +export interface LinkIssueRequestJson { + type: IssueLinkType; + inwardIssue: LinkedIssue; + outwardIssue: LinkedIssue; + comment?: Comment; +} diff --git a/src/version3/models/linkIssueRequestJson.ts b/src/version3/models/linkIssueRequestJson.ts deleted file mode 100644 index 9445d9845a..0000000000 --- a/src/version3/models/linkIssueRequestJson.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Comment } from './comment'; -import { IssueLinkType } from './issueLinkType'; -import { LinkedIssue } from './linkedIssue'; - -export interface LinkIssueRequestJson { - type: IssueLinkType; - inwardIssue: LinkedIssue; - outwardIssue: LinkedIssue; - comment?: Comment; -} diff --git a/src/version3/models/linkedIssue.mts b/src/version3/models/linkedIssue.mts new file mode 100644 index 0000000000..7ac7651e5b --- /dev/null +++ b/src/version3/models/linkedIssue.mts @@ -0,0 +1,12 @@ +import { Fields } from './fields.mjs'; + +/** The ID or key of a linked issue. */ +export interface LinkedIssue { + /** The ID of an issue. Required if `key` isn't provided. */ + id?: string; + /** The key of an issue. Required if `id` isn't provided. */ + key?: string; + /** The URL of the issue. */ + self?: string; + fields?: Fields; +} diff --git a/src/version3/models/linkedIssue.ts b/src/version3/models/linkedIssue.ts deleted file mode 100644 index 3d4638fc94..0000000000 --- a/src/version3/models/linkedIssue.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Fields } from './fields'; - -/** The ID or key of a linked issue. */ -export interface LinkedIssue { - /** The ID of an issue. Required if `key` isn't provided. */ - id?: string; - /** The key of an issue. Required if `id` isn't provided. */ - key?: string; - /** The URL of the issue. */ - self?: string; - fields?: Fields; -} diff --git a/src/version3/models/listWrapperCallbackApplicationRole.ts b/src/version3/models/listWrapperCallbackApplicationRole.mts similarity index 100% rename from src/version3/models/listWrapperCallbackApplicationRole.ts rename to src/version3/models/listWrapperCallbackApplicationRole.mts diff --git a/src/version3/models/listWrapperCallbackGroupName.ts b/src/version3/models/listWrapperCallbackGroupName.mts similarity index 100% rename from src/version3/models/listWrapperCallbackGroupName.ts rename to src/version3/models/listWrapperCallbackGroupName.mts diff --git a/src/version3/models/locale.ts b/src/version3/models/locale.mts similarity index 100% rename from src/version3/models/locale.ts rename to src/version3/models/locale.mts diff --git a/src/version3/models/mark.ts b/src/version3/models/mark.mts similarity index 100% rename from src/version3/models/mark.ts rename to src/version3/models/mark.mts diff --git a/src/version3/models/moveField.ts b/src/version3/models/moveField.mts similarity index 100% rename from src/version3/models/moveField.ts rename to src/version3/models/moveField.mts diff --git a/src/version3/models/multiIssueEntityProperties.mts b/src/version3/models/multiIssueEntityProperties.mts new file mode 100644 index 0000000000..6b7c919a8c --- /dev/null +++ b/src/version3/models/multiIssueEntityProperties.mts @@ -0,0 +1,10 @@ +import { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate.mjs'; + +/** + * A list of issues and their respective properties to set or update. See [Entity + * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. + */ +export interface MultiIssueEntityProperties { + /** A list of issue IDs and their respective properties. */ + issues?: IssueEntityPropertiesForMultiUpdate[]; +} diff --git a/src/version3/models/multiIssueEntityProperties.ts b/src/version3/models/multiIssueEntityProperties.ts deleted file mode 100644 index 3e54265bc3..0000000000 --- a/src/version3/models/multiIssueEntityProperties.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { IssueEntityPropertiesForMultiUpdate } from './issueEntityPropertiesForMultiUpdate'; - -/** - * A list of issues and their respective properties to set or update. See [Entity - * properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. - */ -export interface MultiIssueEntityProperties { - /** A list of issue IDs and their respective properties. */ - issues?: IssueEntityPropertiesForMultiUpdate[]; -} diff --git a/src/version3/models/multipleCustomFieldValuesUpdate.ts b/src/version3/models/multipleCustomFieldValuesUpdate.mts similarity index 100% rename from src/version3/models/multipleCustomFieldValuesUpdate.ts rename to src/version3/models/multipleCustomFieldValuesUpdate.mts diff --git a/src/version3/models/multipleCustomFieldValuesUpdateDetails.mts b/src/version3/models/multipleCustomFieldValuesUpdateDetails.mts new file mode 100644 index 0000000000..c15e9e08de --- /dev/null +++ b/src/version3/models/multipleCustomFieldValuesUpdateDetails.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate.mjs'; + +/** List of updates for a custom fields. */ +export interface MultipleCustomFieldValuesUpdateDetails { + updates?: MultipleCustomFieldValuesUpdate[]; +} diff --git a/src/version3/models/multipleCustomFieldValuesUpdateDetails.ts b/src/version3/models/multipleCustomFieldValuesUpdateDetails.ts deleted file mode 100644 index 8df22e82e4..0000000000 --- a/src/version3/models/multipleCustomFieldValuesUpdateDetails.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MultipleCustomFieldValuesUpdate } from './multipleCustomFieldValuesUpdate'; - -/** List of updates for a custom fields. */ -export interface MultipleCustomFieldValuesUpdateDetails { - updates?: MultipleCustomFieldValuesUpdate[]; -} diff --git a/src/version3/models/nestedResponse.mts b/src/version3/models/nestedResponse.mts new file mode 100644 index 0000000000..704158d3ea --- /dev/null +++ b/src/version3/models/nestedResponse.mts @@ -0,0 +1,6 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +export interface NestedResponse { + status?: number; + errorCollection?: ErrorCollection; +} diff --git a/src/version3/models/nestedResponse.ts b/src/version3/models/nestedResponse.ts deleted file mode 100644 index ffcb96ccec..0000000000 --- a/src/version3/models/nestedResponse.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ErrorCollection } from './errorCollection'; - -export interface NestedResponse { - status?: number; - errorCollection?: ErrorCollection; -} diff --git a/src/version3/models/newUserDetails.ts b/src/version3/models/newUserDetails.mts similarity index 100% rename from src/version3/models/newUserDetails.ts rename to src/version3/models/newUserDetails.mts diff --git a/src/version3/models/notification.mts b/src/version3/models/notification.mts new file mode 100644 index 0000000000..8c816841ed --- /dev/null +++ b/src/version3/models/notification.mts @@ -0,0 +1,17 @@ +import { NotificationRecipients } from './notificationRecipients.mjs'; +import { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions.mjs'; + +/** Details about a notification. */ +export interface Notification { + /** + * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue + * key and summary. + */ + subject?: string; + /** The plain text body of the email notification for the issue. */ + textBody?: string; + /** The HTML body of the email notification for the issue. */ + htmlBody?: string; + to?: NotificationRecipients; + restrict?: NotificationRecipientsRestrictions; +} diff --git a/src/version3/models/notification.ts b/src/version3/models/notification.ts deleted file mode 100644 index e8526c2660..0000000000 --- a/src/version3/models/notification.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NotificationRecipients } from './notificationRecipients'; -import { NotificationRecipientsRestrictions } from './notificationRecipientsRestrictions'; - -/** Details about a notification. */ -export interface Notification { - /** - * The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue - * key and summary. - */ - subject?: string; - /** The plain text body of the email notification for the issue. */ - textBody?: string; - /** The HTML body of the email notification for the issue. */ - htmlBody?: string; - to?: NotificationRecipients; - restrict?: NotificationRecipientsRestrictions; -} diff --git a/src/version3/models/notificationEvent.ts b/src/version3/models/notificationEvent.mts similarity index 100% rename from src/version3/models/notificationEvent.ts rename to src/version3/models/notificationEvent.mts diff --git a/src/version3/models/notificationRecipients.mts b/src/version3/models/notificationRecipients.mts new file mode 100644 index 0000000000..970aed49e5 --- /dev/null +++ b/src/version3/models/notificationRecipients.mts @@ -0,0 +1,20 @@ +import type { GroupName } from './groupName.mjs'; +import { UserDetails } from './userDetails.mjs'; + +/** Details of the users and groups to receive the notification. */ +export interface NotificationRecipients { + /** Whether the notification should be sent to the issue's reporter. */ + reporter?: boolean; + /** Whether the notification should be sent to the issue's assignees. */ + assignee?: boolean; + /** Whether the notification should be sent to the issue's watchers. */ + watchers?: boolean; + /** Whether the notification should be sent to the issue's voters. */ + voters?: boolean; + /** List of users to receive the notification. */ + users?: UserDetails[]; + /** List of groups to receive the notification. */ + groups?: GroupName[]; + /** List of groupIds to receive the notification. */ + groupIds?: string[]; +} diff --git a/src/version3/models/notificationRecipients.ts b/src/version3/models/notificationRecipients.ts deleted file mode 100644 index beed8f9e51..0000000000 --- a/src/version3/models/notificationRecipients.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { GroupName } from './groupName'; -import { UserDetails } from './userDetails'; - -/** Details of the users and groups to receive the notification. */ -export interface NotificationRecipients { - /** Whether the notification should be sent to the issue's reporter. */ - reporter?: boolean; - /** Whether the notification should be sent to the issue's assignees. */ - assignee?: boolean; - /** Whether the notification should be sent to the issue's watchers. */ - watchers?: boolean; - /** Whether the notification should be sent to the issue's voters. */ - voters?: boolean; - /** List of users to receive the notification. */ - users?: UserDetails[]; - /** List of groups to receive the notification. */ - groups?: GroupName[]; - /** List of groupIds to receive the notification. */ - groupIds?: string[]; -} diff --git a/src/version3/models/notificationRecipientsRestrictions.mts b/src/version3/models/notificationRecipientsRestrictions.mts new file mode 100644 index 0000000000..7c183c3834 --- /dev/null +++ b/src/version3/models/notificationRecipientsRestrictions.mts @@ -0,0 +1,12 @@ +import type { GroupName } from './groupName.mjs'; +import { RestrictedPermission } from './restrictedPermission.mjs'; + +/** Details of the group membership or permissions needed to receive the notification. */ +export interface NotificationRecipientsRestrictions { + /** List of group memberships required to receive the notification. */ + groups?: GroupName[]; + /** List of groupId memberships required to receive the notification. */ + groupIds?: string[]; + /** List of permissions required to receive the notification. */ + permissions?: RestrictedPermission[]; +} diff --git a/src/version3/models/notificationRecipientsRestrictions.ts b/src/version3/models/notificationRecipientsRestrictions.ts deleted file mode 100644 index 30a9b7bc37..0000000000 --- a/src/version3/models/notificationRecipientsRestrictions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { GroupName } from './groupName'; -import { RestrictedPermission } from './restrictedPermission'; - -/** Details of the group membership or permissions needed to receive the notification. */ -export interface NotificationRecipientsRestrictions { - /** List of group memberships required to receive the notification. */ - groups?: GroupName[]; - /** List of groupId memberships required to receive the notification. */ - groupIds?: string[]; - /** List of permissions required to receive the notification. */ - permissions?: RestrictedPermission[]; -} diff --git a/src/version3/models/notificationScheme.mts b/src/version3/models/notificationScheme.mts new file mode 100644 index 0000000000..242a08c3f4 --- /dev/null +++ b/src/version3/models/notificationScheme.mts @@ -0,0 +1,18 @@ +import { NotificationSchemeEvent } from './notificationSchemeEvent.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about a notification scheme. */ +export interface NotificationScheme { + /** Expand options that include additional notification scheme details in the response. */ + expand?: string; + /** The ID of the notification scheme. */ + id?: number; + self?: string; + /** The name of the notification scheme. */ + name?: string; + /** The description of the notification scheme. */ + description?: string; + /** The notification events and associated recipients. */ + notificationSchemeEvents?: NotificationSchemeEvent[]; + scope?: Scope; +} diff --git a/src/version3/models/notificationScheme.ts b/src/version3/models/notificationScheme.ts deleted file mode 100644 index 5547d49c15..0000000000 --- a/src/version3/models/notificationScheme.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { NotificationSchemeEvent } from './notificationSchemeEvent'; -import { Scope } from './scope'; - -/** Details about a notification scheme. */ -export interface NotificationScheme { - /** Expand options that include additional notification scheme details in the response. */ - expand?: string; - /** The ID of the notification scheme. */ - id?: number; - self?: string; - /** The name of the notification scheme. */ - name?: string; - /** The description of the notification scheme. */ - description?: string; - /** The notification events and associated recipients. */ - notificationSchemeEvents?: NotificationSchemeEvent[]; - scope?: Scope; -} diff --git a/src/version3/models/notificationSchemeAndProjectMapping.ts b/src/version3/models/notificationSchemeAndProjectMapping.mts similarity index 100% rename from src/version3/models/notificationSchemeAndProjectMapping.ts rename to src/version3/models/notificationSchemeAndProjectMapping.mts diff --git a/src/version3/models/notificationSchemeAndProjectMappingPage.mts b/src/version3/models/notificationSchemeAndProjectMappingPage.mts new file mode 100644 index 0000000000..c8278b5b3e --- /dev/null +++ b/src/version3/models/notificationSchemeAndProjectMappingPage.mts @@ -0,0 +1,19 @@ +import { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping.mjs'; + +/** A page of items. */ +export interface NotificationSchemeAndProjectMappingPage { + /** 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?: NotificationSchemeAndProjectMapping[]; +} diff --git a/src/version3/models/notificationSchemeAndProjectMappingPage.ts b/src/version3/models/notificationSchemeAndProjectMappingPage.ts deleted file mode 100644 index 21a77840dc..0000000000 --- a/src/version3/models/notificationSchemeAndProjectMappingPage.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NotificationSchemeAndProjectMapping } from './notificationSchemeAndProjectMapping'; - -/** A page of items. */ -export interface NotificationSchemeAndProjectMappingPage { - /** 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?: NotificationSchemeAndProjectMapping[]; -} diff --git a/src/version3/models/notificationSchemeEvent.mts b/src/version3/models/notificationSchemeEvent.mts new file mode 100644 index 0000000000..f135060a6d --- /dev/null +++ b/src/version3/models/notificationSchemeEvent.mts @@ -0,0 +1,8 @@ +import { EventNotification } from './eventNotification.mjs'; +import { NotificationEvent } from './notificationEvent.mjs'; + +/** Details about a notification scheme event. */ +export interface NotificationSchemeEvent { + event?: NotificationEvent; + notifications?: EventNotification[]; +} diff --git a/src/version3/models/notificationSchemeEvent.ts b/src/version3/models/notificationSchemeEvent.ts deleted file mode 100644 index 9f67d81317..0000000000 --- a/src/version3/models/notificationSchemeEvent.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { EventNotification } from './eventNotification'; -import { NotificationEvent } from './notificationEvent'; - -/** Details about a notification scheme event. */ -export interface NotificationSchemeEvent { - event?: NotificationEvent; - notifications?: EventNotification[]; -} diff --git a/src/version3/models/notificationSchemeEventDetails.mts b/src/version3/models/notificationSchemeEventDetails.mts new file mode 100644 index 0000000000..1bc5e86fb2 --- /dev/null +++ b/src/version3/models/notificationSchemeEventDetails.mts @@ -0,0 +1,9 @@ +import { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId.mjs'; +import { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails.mjs'; + +/** Details of a notification scheme event. */ +export interface NotificationSchemeEventDetails { + event?: NotificationSchemeEventTypeId; + /** The list of notifications mapped to a specified event. */ + notifications: NotificationSchemeNotificationDetails[]; +} diff --git a/src/version3/models/notificationSchemeEventDetails.ts b/src/version3/models/notificationSchemeEventDetails.ts deleted file mode 100644 index 254082cad8..0000000000 --- a/src/version3/models/notificationSchemeEventDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { NotificationSchemeEventTypeId } from './notificationSchemeEventTypeId'; -import { NotificationSchemeNotificationDetails } from './notificationSchemeNotificationDetails'; - -/** Details of a notification scheme event. */ -export interface NotificationSchemeEventDetails { - event?: NotificationSchemeEventTypeId; - /** The list of notifications mapped to a specified event. */ - notifications: NotificationSchemeNotificationDetails[]; -} diff --git a/src/version3/models/notificationSchemeEventTypeId.ts b/src/version3/models/notificationSchemeEventTypeId.mts similarity index 100% rename from src/version3/models/notificationSchemeEventTypeId.ts rename to src/version3/models/notificationSchemeEventTypeId.mts diff --git a/src/version3/models/notificationSchemeId.ts b/src/version3/models/notificationSchemeId.mts similarity index 100% rename from src/version3/models/notificationSchemeId.ts rename to src/version3/models/notificationSchemeId.mts diff --git a/src/version3/models/notificationSchemeNotificationDetails.ts b/src/version3/models/notificationSchemeNotificationDetails.mts similarity index 100% rename from src/version3/models/notificationSchemeNotificationDetails.ts rename to src/version3/models/notificationSchemeNotificationDetails.mts diff --git a/src/version3/models/oldToNewSecurityLevelMappings.ts b/src/version3/models/oldToNewSecurityLevelMappings.mts similarity index 100% rename from src/version3/models/oldToNewSecurityLevelMappings.ts rename to src/version3/models/oldToNewSecurityLevelMappings.mts diff --git a/src/version3/models/operationMessage.ts b/src/version3/models/operationMessage.mts similarity index 100% rename from src/version3/models/operationMessage.ts rename to src/version3/models/operationMessage.mts diff --git a/src/version3/models/operations.mts b/src/version3/models/operations.mts new file mode 100644 index 0000000000..abc4e9bf0e --- /dev/null +++ b/src/version3/models/operations.mts @@ -0,0 +1,7 @@ +import { LinkGroup } from './linkGroup.mjs'; + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; +} diff --git a/src/version3/models/operations.ts b/src/version3/models/operations.ts deleted file mode 100644 index 11702d0336..0000000000 --- a/src/version3/models/operations.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { LinkGroup } from './linkGroup'; - -/** Details of the operations that can be performed on the issue. */ -export interface Operations { - /** Details of the link groups defining issue operations. */ - linkGroups?: LinkGroup[]; -} diff --git a/src/version3/models/orderOfCustomFieldOptions.ts b/src/version3/models/orderOfCustomFieldOptions.mts similarity index 100% rename from src/version3/models/orderOfCustomFieldOptions.ts rename to src/version3/models/orderOfCustomFieldOptions.mts diff --git a/src/version3/models/orderOfIssueTypes.ts b/src/version3/models/orderOfIssueTypes.mts similarity index 100% rename from src/version3/models/orderOfIssueTypes.ts rename to src/version3/models/orderOfIssueTypes.mts diff --git a/src/version3/models/pageBeanFieldConfigurationDetails.mts b/src/version3/models/pageBeanFieldConfigurationDetails.mts new file mode 100644 index 0000000000..0ac6e017c2 --- /dev/null +++ b/src/version3/models/pageBeanFieldConfigurationDetails.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationDetails } from './fieldConfigurationDetails.mjs'; + +/** 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; + /** 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?: FieldConfigurationDetails[]; +} diff --git a/src/version3/models/pageBeanFieldConfigurationDetails.ts b/src/version3/models/pageBeanFieldConfigurationDetails.ts deleted file mode 100644 index 37b3f277a9..0000000000 --- a/src/version3/models/pageBeanFieldConfigurationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationDetails } from './fieldConfigurationDetails'; - -/** 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; - /** 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?: FieldConfigurationDetails[]; -} diff --git a/src/version3/models/pageChangelog.mts b/src/version3/models/pageChangelog.mts new file mode 100644 index 0000000000..236b9f4e51 --- /dev/null +++ b/src/version3/models/pageChangelog.mts @@ -0,0 +1,19 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of items. */ +export interface PageChangelog { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Changelog[]; +} diff --git a/src/version3/models/pageChangelog.ts b/src/version3/models/pageChangelog.ts deleted file mode 100644 index 2d8414d867..0000000000 --- a/src/version3/models/pageChangelog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Changelog } from './changelog'; - -/** A page of items. */ -export interface PageChangelog { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Changelog[]; -} diff --git a/src/version3/models/pageComment.mts b/src/version3/models/pageComment.mts new file mode 100644 index 0000000000..4dfbfec3e5 --- /dev/null +++ b/src/version3/models/pageComment.mts @@ -0,0 +1,19 @@ +import type { Comment } from './comment.mjs'; + +/** A page of items. */ +export interface PageComment { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Comment[]; +} diff --git a/src/version3/models/pageComment.ts b/src/version3/models/pageComment.ts deleted file mode 100644 index cfe680d593..0000000000 --- a/src/version3/models/pageComment.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Comment } from './comment'; - -/** A page of items. */ -export interface PageComment { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Comment[]; -} diff --git a/src/version3/models/pageComponentWithIssueCount.mts b/src/version3/models/pageComponentWithIssueCount.mts new file mode 100644 index 0000000000..d1ad1deb33 --- /dev/null +++ b/src/version3/models/pageComponentWithIssueCount.mts @@ -0,0 +1,19 @@ +import { ComponentWithIssueCount } from './componentWithIssueCount.mjs'; + +/** A page of items. */ +export interface PageComponentWithIssueCount { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ComponentWithIssueCount[]; +} diff --git a/src/version3/models/pageComponentWithIssueCount.ts b/src/version3/models/pageComponentWithIssueCount.ts deleted file mode 100644 index 6d7c829514..0000000000 --- a/src/version3/models/pageComponentWithIssueCount.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ComponentWithIssueCount } from './componentWithIssueCount'; - -/** A page of items. */ -export interface PageComponentWithIssueCount { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ComponentWithIssueCount[]; -} diff --git a/src/version3/models/pageContextForProjectAndIssueType.mts b/src/version3/models/pageContextForProjectAndIssueType.mts new file mode 100644 index 0000000000..6f5fbb6662 --- /dev/null +++ b/src/version3/models/pageContextForProjectAndIssueType.mts @@ -0,0 +1,19 @@ +import { ContextForProjectAndIssueType } from './contextForProjectAndIssueType.mjs'; + +/** A page of items. */ +export interface PageContextForProjectAndIssueType { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ContextForProjectAndIssueType[]; +} diff --git a/src/version3/models/pageContextForProjectAndIssueType.ts b/src/version3/models/pageContextForProjectAndIssueType.ts deleted file mode 100644 index 2c6e95e799..0000000000 --- a/src/version3/models/pageContextForProjectAndIssueType.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ContextForProjectAndIssueType } from './contextForProjectAndIssueType'; - -/** A page of items. */ -export interface PageContextForProjectAndIssueType { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ContextForProjectAndIssueType[]; -} diff --git a/src/version3/models/pageContextualConfiguration.mts b/src/version3/models/pageContextualConfiguration.mts new file mode 100644 index 0000000000..40edfda5f7 --- /dev/null +++ b/src/version3/models/pageContextualConfiguration.mts @@ -0,0 +1,19 @@ +import { ContextualConfiguration } from './contextualConfiguration.mjs'; + +/** A page of items. */ +export interface PageContextualConfiguration { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ContextualConfiguration[]; +} diff --git a/src/version3/models/pageContextualConfiguration.ts b/src/version3/models/pageContextualConfiguration.ts deleted file mode 100644 index bdda760448..0000000000 --- a/src/version3/models/pageContextualConfiguration.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ContextualConfiguration } from './contextualConfiguration'; - -/** A page of items. */ -export interface PageContextualConfiguration { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ContextualConfiguration[]; -} diff --git a/src/version3/models/pageCustomFieldContext.mts b/src/version3/models/pageCustomFieldContext.mts new file mode 100644 index 0000000000..132dfbee53 --- /dev/null +++ b/src/version3/models/pageCustomFieldContext.mts @@ -0,0 +1,19 @@ +import { CustomFieldContext } from './customFieldContext.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContext { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: CustomFieldContext[]; +} diff --git a/src/version3/models/pageCustomFieldContext.ts b/src/version3/models/pageCustomFieldContext.ts deleted file mode 100644 index 3b69305aa9..0000000000 --- a/src/version3/models/pageCustomFieldContext.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContext } from './customFieldContext'; - -/** A page of items. */ -export interface PageCustomFieldContext { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: CustomFieldContext[]; -} diff --git a/src/version3/models/pageCustomFieldContextDefaultValue.mts b/src/version3/models/pageCustomFieldContextDefaultValue.mts new file mode 100644 index 0000000000..f7bb1379e6 --- /dev/null +++ b/src/version3/models/pageCustomFieldContextDefaultValue.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextDefaultValue { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: CustomFieldContextDefaultValue[]; +} diff --git a/src/version3/models/pageCustomFieldContextDefaultValue.ts b/src/version3/models/pageCustomFieldContextDefaultValue.ts deleted file mode 100644 index 3023fd50ed..0000000000 --- a/src/version3/models/pageCustomFieldContextDefaultValue.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContextDefaultValue } from './customFieldContextDefaultValue'; - -/** A page of items. */ -export interface PageCustomFieldContextDefaultValue { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: CustomFieldContextDefaultValue[]; -} diff --git a/src/version3/models/pageCustomFieldContextOption.mts b/src/version3/models/pageCustomFieldContextOption.mts new file mode 100644 index 0000000000..10f820f987 --- /dev/null +++ b/src/version3/models/pageCustomFieldContextOption.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextOption } from './customFieldContextOption.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextOption { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: CustomFieldContextOption[]; +} diff --git a/src/version3/models/pageCustomFieldContextOption.ts b/src/version3/models/pageCustomFieldContextOption.ts deleted file mode 100644 index d3c8f21fb2..0000000000 --- a/src/version3/models/pageCustomFieldContextOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContextOption } from './customFieldContextOption'; - -/** A page of items. */ -export interface PageCustomFieldContextOption { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: CustomFieldContextOption[]; -} diff --git a/src/version3/models/pageCustomFieldContextProjectMapping.mts b/src/version3/models/pageCustomFieldContextProjectMapping.mts new file mode 100644 index 0000000000..64ca191fa0 --- /dev/null +++ b/src/version3/models/pageCustomFieldContextProjectMapping.mts @@ -0,0 +1,19 @@ +import { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping.mjs'; + +/** A page of items. */ +export interface PageCustomFieldContextProjectMapping { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: CustomFieldContextProjectMapping[]; +} diff --git a/src/version3/models/pageCustomFieldContextProjectMapping.ts b/src/version3/models/pageCustomFieldContextProjectMapping.ts deleted file mode 100644 index df43b2affd..0000000000 --- a/src/version3/models/pageCustomFieldContextProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CustomFieldContextProjectMapping } from './customFieldContextProjectMapping'; - -/** A page of items. */ -export interface PageCustomFieldContextProjectMapping { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: CustomFieldContextProjectMapping[]; -} diff --git a/src/version3/models/pageDashboard.mts b/src/version3/models/pageDashboard.mts new file mode 100644 index 0000000000..79095bfd42 --- /dev/null +++ b/src/version3/models/pageDashboard.mts @@ -0,0 +1,19 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page of items. */ +export interface PageDashboard { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Dashboard[]; +} diff --git a/src/version3/models/pageDashboard.ts b/src/version3/models/pageDashboard.ts deleted file mode 100644 index 70159b5973..0000000000 --- a/src/version3/models/pageDashboard.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Dashboard } from './dashboard'; - -/** A page of items. */ -export interface PageDashboard { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Dashboard[]; -} diff --git a/src/version3/models/pageField.mts b/src/version3/models/pageField.mts new file mode 100644 index 0000000000..8db861bd93 --- /dev/null +++ b/src/version3/models/pageField.mts @@ -0,0 +1,19 @@ +import { Field } from './field.mjs'; + +/** A page of items. */ +export interface PageField { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Field[]; +} diff --git a/src/version3/models/pageField.ts b/src/version3/models/pageField.ts deleted file mode 100644 index 77637f8b3d..0000000000 --- a/src/version3/models/pageField.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Field } from './field'; - -/** A page of items. */ -export interface PageField { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Field[]; -} diff --git a/src/version3/models/pageFieldConfigurationIssueTypeItem.mts b/src/version3/models/pageFieldConfigurationIssueTypeItem.mts new file mode 100644 index 0000000000..417998ed1f --- /dev/null +++ b/src/version3/models/pageFieldConfigurationIssueTypeItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationIssueTypeItem { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: FieldConfigurationIssueTypeItem[]; +} diff --git a/src/version3/models/pageFieldConfigurationIssueTypeItem.ts b/src/version3/models/pageFieldConfigurationIssueTypeItem.ts deleted file mode 100644 index f20e3d1251..0000000000 --- a/src/version3/models/pageFieldConfigurationIssueTypeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationIssueTypeItem } from './fieldConfigurationIssueTypeItem'; - -/** A page of items. */ -export interface PageFieldConfigurationIssueTypeItem { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: FieldConfigurationIssueTypeItem[]; -} diff --git a/src/version3/models/pageFieldConfigurationItem.mts b/src/version3/models/pageFieldConfigurationItem.mts new file mode 100644 index 0000000000..848e99508f --- /dev/null +++ b/src/version3/models/pageFieldConfigurationItem.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationItem } from './fieldConfigurationItem.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationItem { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: FieldConfigurationItem[]; +} diff --git a/src/version3/models/pageFieldConfigurationItem.ts b/src/version3/models/pageFieldConfigurationItem.ts deleted file mode 100644 index eb3e38ecbf..0000000000 --- a/src/version3/models/pageFieldConfigurationItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationItem } from './fieldConfigurationItem'; - -/** A page of items. */ -export interface PageFieldConfigurationItem { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: FieldConfigurationItem[]; -} diff --git a/src/version3/models/pageFieldConfigurationScheme.mts b/src/version3/models/pageFieldConfigurationScheme.mts new file mode 100644 index 0000000000..e275f5d0dd --- /dev/null +++ b/src/version3/models/pageFieldConfigurationScheme.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationScheme } from './fieldConfigurationScheme.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: FieldConfigurationScheme[]; +} diff --git a/src/version3/models/pageFieldConfigurationScheme.ts b/src/version3/models/pageFieldConfigurationScheme.ts deleted file mode 100644 index 93c9b24632..0000000000 --- a/src/version3/models/pageFieldConfigurationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationScheme } from './fieldConfigurationScheme'; - -/** A page of items. */ -export interface PageFieldConfigurationScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: FieldConfigurationScheme[]; -} diff --git a/src/version3/models/pageFieldConfigurationSchemeProjects.mts b/src/version3/models/pageFieldConfigurationSchemeProjects.mts new file mode 100644 index 0000000000..d16c46222c --- /dev/null +++ b/src/version3/models/pageFieldConfigurationSchemeProjects.mts @@ -0,0 +1,19 @@ +import { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageFieldConfigurationSchemeProjects { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: FieldConfigurationSchemeProjects[]; +} diff --git a/src/version3/models/pageFieldConfigurationSchemeProjects.ts b/src/version3/models/pageFieldConfigurationSchemeProjects.ts deleted file mode 100644 index c5256eda52..0000000000 --- a/src/version3/models/pageFieldConfigurationSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FieldConfigurationSchemeProjects } from './fieldConfigurationSchemeProjects'; - -/** A page of items. */ -export interface PageFieldConfigurationSchemeProjects { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: FieldConfigurationSchemeProjects[]; -} diff --git a/src/version3/models/pageFilterDetails.mts b/src/version3/models/pageFilterDetails.mts new file mode 100644 index 0000000000..b8fbf30074 --- /dev/null +++ b/src/version3/models/pageFilterDetails.mts @@ -0,0 +1,19 @@ +import { FilterDetails } from './filterDetails.mjs'; + +/** A page of items. */ +export interface PageFilterDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: FilterDetails[]; +} diff --git a/src/version3/models/pageFilterDetails.ts b/src/version3/models/pageFilterDetails.ts deleted file mode 100644 index bdf8189142..0000000000 --- a/src/version3/models/pageFilterDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { FilterDetails } from './filterDetails'; - -/** A page of items. */ -export interface PageFilterDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: FilterDetails[]; -} diff --git a/src/version3/models/pageGroupDetails.mts b/src/version3/models/pageGroupDetails.mts new file mode 100644 index 0000000000..d29a0db1be --- /dev/null +++ b/src/version3/models/pageGroupDetails.mts @@ -0,0 +1,19 @@ +import { GroupDetails } from './groupDetails.mjs'; + +/** A page of items. */ +export interface PageGroupDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: GroupDetails[]; +} diff --git a/src/version3/models/pageGroupDetails.ts b/src/version3/models/pageGroupDetails.ts deleted file mode 100644 index 0d56bb97b1..0000000000 --- a/src/version3/models/pageGroupDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { GroupDetails } from './groupDetails'; - -/** A page of items. */ -export interface PageGroupDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: GroupDetails[]; -} diff --git a/src/version3/models/pageIssueFieldOption.mts b/src/version3/models/pageIssueFieldOption.mts new file mode 100644 index 0000000000..1ca952997c --- /dev/null +++ b/src/version3/models/pageIssueFieldOption.mts @@ -0,0 +1,19 @@ +import { IssueFieldOption } from './issueFieldOption.mjs'; + +/** A page of items. */ +export interface PageIssueFieldOption { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueFieldOption[]; +} diff --git a/src/version3/models/pageIssueFieldOption.ts b/src/version3/models/pageIssueFieldOption.ts deleted file mode 100644 index ff8ce09258..0000000000 --- a/src/version3/models/pageIssueFieldOption.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueFieldOption } from './issueFieldOption'; - -/** A page of items. */ -export interface PageIssueFieldOption { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueFieldOption[]; -} diff --git a/src/version3/models/pageIssueSecurityLevelMember.mts b/src/version3/models/pageIssueSecurityLevelMember.mts new file mode 100644 index 0000000000..22aa0ae316 --- /dev/null +++ b/src/version3/models/pageIssueSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import { IssueSecurityLevelMember } from './issueSecurityLevelMember.mjs'; + +/** A page of items. */ +export interface PageIssueSecurityLevelMember { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueSecurityLevelMember[]; +} diff --git a/src/version3/models/pageIssueSecurityLevelMember.ts b/src/version3/models/pageIssueSecurityLevelMember.ts deleted file mode 100644 index 38f807591b..0000000000 --- a/src/version3/models/pageIssueSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueSecurityLevelMember } from './issueSecurityLevelMember'; - -/** A page of items. */ -export interface PageIssueSecurityLevelMember { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueSecurityLevelMember[]; -} diff --git a/src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts b/src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts new file mode 100644 index 0000000000..aec4eb4ea5 --- /dev/null +++ b/src/version3/models/pageIssueSecuritySchemeToProjectMapping.mts @@ -0,0 +1,19 @@ +import { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping.mjs'; + +/** A page of items. */ +export interface PageIssueSecuritySchemeToProjectMapping { + /** 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?: IssueSecuritySchemeToProjectMapping[]; +} diff --git a/src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts b/src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts deleted file mode 100644 index 86b0e88bfe..0000000000 --- a/src/version3/models/pageIssueSecuritySchemeToProjectMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueSecuritySchemeToProjectMapping } from './issueSecuritySchemeToProjectMapping'; - -/** A page of items. */ -export interface PageIssueSecuritySchemeToProjectMapping { - /** 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?: IssueSecuritySchemeToProjectMapping[]; -} diff --git a/src/version3/models/pageIssueTypeScheme.mts b/src/version3/models/pageIssueTypeScheme.mts new file mode 100644 index 0000000000..22428f1d80 --- /dev/null +++ b/src/version3/models/pageIssueTypeScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScheme } from './issueTypeScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeScheme[]; +} diff --git a/src/version3/models/pageIssueTypeScheme.ts b/src/version3/models/pageIssueTypeScheme.ts deleted file mode 100644 index ea905ca776..0000000000 --- a/src/version3/models/pageIssueTypeScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScheme } from './issueTypeScheme'; - -/** A page of items. */ -export interface PageIssueTypeScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeScheme[]; -} diff --git a/src/version3/models/pageIssueTypeSchemeMapping.mts b/src/version3/models/pageIssueTypeSchemeMapping.mts new file mode 100644 index 0000000000..1c8f0fb052 --- /dev/null +++ b/src/version3/models/pageIssueTypeSchemeMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeMapping } from './issueTypeSchemeMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeMapping { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeSchemeMapping[]; +} diff --git a/src/version3/models/pageIssueTypeSchemeMapping.ts b/src/version3/models/pageIssueTypeSchemeMapping.ts deleted file mode 100644 index 958ef53482..0000000000 --- a/src/version3/models/pageIssueTypeSchemeMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeSchemeMapping } from './issueTypeSchemeMapping'; - -/** A page of items. */ -export interface PageIssueTypeSchemeMapping { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeSchemeMapping[]; -} diff --git a/src/version3/models/pageIssueTypeSchemeProjects.mts b/src/version3/models/pageIssueTypeSchemeProjects.mts new file mode 100644 index 0000000000..7adc22e701 --- /dev/null +++ b/src/version3/models/pageIssueTypeSchemeProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeSchemeProjects } from './issueTypeSchemeProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeSchemeProjects { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeSchemeProjects[]; +} diff --git a/src/version3/models/pageIssueTypeSchemeProjects.ts b/src/version3/models/pageIssueTypeSchemeProjects.ts deleted file mode 100644 index d0d7557155..0000000000 --- a/src/version3/models/pageIssueTypeSchemeProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeSchemeProjects } from './issueTypeSchemeProjects'; - -/** A page of items. */ -export interface PageIssueTypeSchemeProjects { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeSchemeProjects[]; -} diff --git a/src/version3/models/pageIssueTypeScreenScheme.mts b/src/version3/models/pageIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..179710c7f7 --- /dev/null +++ b/src/version3/models/pageIssueTypeScreenScheme.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenScheme } from './issueTypeScreenScheme.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeScreenScheme[]; +} diff --git a/src/version3/models/pageIssueTypeScreenScheme.ts b/src/version3/models/pageIssueTypeScreenScheme.ts deleted file mode 100644 index f48851d10f..0000000000 --- a/src/version3/models/pageIssueTypeScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScreenScheme } from './issueTypeScreenScheme'; - -/** A page of items. */ -export interface PageIssueTypeScreenScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeScreenScheme[]; -} diff --git a/src/version3/models/pageIssueTypeScreenSchemeItem.mts b/src/version3/models/pageIssueTypeScreenSchemeItem.mts new file mode 100644 index 0000000000..04f1134479 --- /dev/null +++ b/src/version3/models/pageIssueTypeScreenSchemeItem.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemeItem { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeScreenSchemeItem[]; +} diff --git a/src/version3/models/pageIssueTypeScreenSchemeItem.ts b/src/version3/models/pageIssueTypeScreenSchemeItem.ts deleted file mode 100644 index dfd4137ed6..0000000000 --- a/src/version3/models/pageIssueTypeScreenSchemeItem.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScreenSchemeItem } from './issueTypeScreenSchemeItem'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemeItem { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeScreenSchemeItem[]; -} diff --git a/src/version3/models/pageIssueTypeScreenSchemesProjects.mts b/src/version3/models/pageIssueTypeScreenSchemesProjects.mts new file mode 100644 index 0000000000..838eda1296 --- /dev/null +++ b/src/version3/models/pageIssueTypeScreenSchemesProjects.mts @@ -0,0 +1,19 @@ +import { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects.mjs'; + +/** A page of items. */ +export interface PageIssueTypeScreenSchemesProjects { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeScreenSchemesProjects[]; +} diff --git a/src/version3/models/pageIssueTypeScreenSchemesProjects.ts b/src/version3/models/pageIssueTypeScreenSchemesProjects.ts deleted file mode 100644 index 5cde072119..0000000000 --- a/src/version3/models/pageIssueTypeScreenSchemesProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeScreenSchemesProjects } from './issueTypeScreenSchemesProjects'; - -/** A page of items. */ -export interface PageIssueTypeScreenSchemesProjects { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeScreenSchemesProjects[]; -} diff --git a/src/version3/models/pageIssueTypeToContextMapping.mts b/src/version3/models/pageIssueTypeToContextMapping.mts new file mode 100644 index 0000000000..2789bb54ae --- /dev/null +++ b/src/version3/models/pageIssueTypeToContextMapping.mts @@ -0,0 +1,19 @@ +import { IssueTypeToContextMapping } from './issueTypeToContextMapping.mjs'; + +/** A page of items. */ +export interface PageIssueTypeToContextMapping { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: IssueTypeToContextMapping[]; +} diff --git a/src/version3/models/pageIssueTypeToContextMapping.ts b/src/version3/models/pageIssueTypeToContextMapping.ts deleted file mode 100644 index 044f3813d7..0000000000 --- a/src/version3/models/pageIssueTypeToContextMapping.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IssueTypeToContextMapping } from './issueTypeToContextMapping'; - -/** A page of items. */ -export interface PageIssueTypeToContextMapping { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: IssueTypeToContextMapping[]; -} diff --git a/src/version3/models/pageJqlFunctionPrecomputation.mts b/src/version3/models/pageJqlFunctionPrecomputation.mts new file mode 100644 index 0000000000..3e2c315a4f --- /dev/null +++ b/src/version3/models/pageJqlFunctionPrecomputation.mts @@ -0,0 +1,19 @@ +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation.mjs'; + +/** A page of items. */ +export interface PageJqlFunctionPrecomputation { + /** 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?: JqlFunctionPrecomputation[]; +} diff --git a/src/version3/models/pageJqlFunctionPrecomputation.ts b/src/version3/models/pageJqlFunctionPrecomputation.ts deleted file mode 100644 index 3104ea5653..0000000000 --- a/src/version3/models/pageJqlFunctionPrecomputation.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; - -/** A page of items. */ -export interface PageJqlFunctionPrecomputation { - /** 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?: JqlFunctionPrecomputation[]; -} diff --git a/src/version3/models/pageNotificationScheme.mts b/src/version3/models/pageNotificationScheme.mts new file mode 100644 index 0000000000..7d916ade36 --- /dev/null +++ b/src/version3/models/pageNotificationScheme.mts @@ -0,0 +1,19 @@ +import { NotificationScheme } from './notificationScheme.mjs'; + +/** A page of items. */ +export interface PageNotificationScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: NotificationScheme[]; +} diff --git a/src/version3/models/pageNotificationScheme.ts b/src/version3/models/pageNotificationScheme.ts deleted file mode 100644 index 5afbda2546..0000000000 --- a/src/version3/models/pageNotificationScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { NotificationScheme } from './notificationScheme'; - -/** A page of items. */ -export interface PageNotificationScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: NotificationScheme[]; -} diff --git a/src/version3/models/pageOfChangelogs.mts b/src/version3/models/pageOfChangelogs.mts new file mode 100644 index 0000000000..65c39d3b34 --- /dev/null +++ b/src/version3/models/pageOfChangelogs.mts @@ -0,0 +1,13 @@ +import type { Changelog } from './changelog.mjs'; + +/** A page of changelogs. */ +export interface PageOfChangelogs { + /** The index of the first item returned on the page. */ + startAt?: number; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The number of results on the page. */ + total?: number; + /** The list of changelogs. */ + histories?: Changelog[]; +} diff --git a/src/version3/models/pageOfChangelogs.ts b/src/version3/models/pageOfChangelogs.ts deleted file mode 100644 index d9a89272b2..0000000000 --- a/src/version3/models/pageOfChangelogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Changelog } from './changelog'; - -/** A page of changelogs. */ -export interface PageOfChangelogs { - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; - /** The list of changelogs. */ - histories?: Changelog[]; -} diff --git a/src/version3/models/pageOfComments.mts b/src/version3/models/pageOfComments.mts new file mode 100644 index 0000000000..f86c2a245a --- /dev/null +++ b/src/version3/models/pageOfComments.mts @@ -0,0 +1,13 @@ +import type { Comment } from './comment.mjs'; + +/** A page of comments. */ +export interface PageOfComments { + /** The index of the first item returned. */ + startAt?: number; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The number of items returned. */ + total?: number; + /** The list of comments. */ + comments?: Comment[]; +} diff --git a/src/version3/models/pageOfComments.ts b/src/version3/models/pageOfComments.ts deleted file mode 100644 index 4939938866..0000000000 --- a/src/version3/models/pageOfComments.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Comment } from './comment'; - -/** A page of comments. */ -export interface PageOfComments { - /** The index of the first item returned. */ - startAt?: number; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The number of items returned. */ - total?: number; - /** The list of comments. */ - comments?: Comment[]; -} diff --git a/src/version3/models/pageOfDashboards.mts b/src/version3/models/pageOfDashboards.mts new file mode 100644 index 0000000000..bef24d1519 --- /dev/null +++ b/src/version3/models/pageOfDashboards.mts @@ -0,0 +1,17 @@ +import type { Dashboard } from './dashboard.mjs'; + +/** A page containing dashboard details. */ +export interface PageOfDashboards { + /** The index of the first item returned on the page. */ + startAt?: number; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The number of results on the page. */ + total?: number; + /** The URL of the previous page of results, if any. */ + prev?: string; + /** The URL of the next page of results, if any. */ + next?: string; + /** List of dashboards. */ + dashboards?: Dashboard[]; +} diff --git a/src/version3/models/pageOfDashboards.ts b/src/version3/models/pageOfDashboards.ts deleted file mode 100644 index 52cd82d27b..0000000000 --- a/src/version3/models/pageOfDashboards.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Dashboard } from './dashboard'; - -/** A page containing dashboard details. */ -export interface PageOfDashboards { - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; - /** The URL of the previous page of results, if any. */ - prev?: string; - /** The URL of the next page of results, if any. */ - next?: string; - /** List of dashboards. */ - dashboards?: Dashboard[]; -} diff --git a/src/version3/models/pageOfStatuses.mts b/src/version3/models/pageOfStatuses.mts new file mode 100644 index 0000000000..69b3437c81 --- /dev/null +++ b/src/version3/models/pageOfStatuses.mts @@ -0,0 +1,18 @@ +import type { JiraStatus } from './jiraStatus.mjs'; + +export interface PageOfStatuses { + /** The index of the first item returned on the page. */ + startAt?: number; + /** Number of items that satisfy the search. */ + total?: number; + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** The list of items. */ + values?: JiraStatus[]; + /** The URL of this page. */ + self?: string; + /** The URL of the next page of results, if any. */ + nextPage?: string; +} diff --git a/src/version3/models/pageOfStatuses.ts b/src/version3/models/pageOfStatuses.ts deleted file mode 100644 index 8b40c3ed66..0000000000 --- a/src/version3/models/pageOfStatuses.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { JiraStatus } from './jiraStatus'; - -export interface PageOfStatuses { - /** The index of the first item returned on the page. */ - startAt?: number; - /** Number of items that satisfy the search. */ - total?: number; - /** Whether this is the last page. */ - isLast?: boolean; - /** The maximum number of items that could be returned. */ - maxResults?: number; - /** The list of items. */ - values?: JiraStatus[]; - /** The URL of this page. */ - self?: string; - /** The URL of the next page of results, if any. */ - nextPage?: string; -} diff --git a/src/version3/models/pageOfWorklogs.mts b/src/version3/models/pageOfWorklogs.mts new file mode 100644 index 0000000000..1d507308a1 --- /dev/null +++ b/src/version3/models/pageOfWorklogs.mts @@ -0,0 +1,13 @@ +import type { Worklog } from './worklog.mjs'; + +/** Paginated list of worklog details */ +export interface PageOfWorklogs { + /** The index of the first item returned on the page. */ + startAt: number; + /** The maximum number of results that could be on the page. */ + maxResults: number; + /** The number of results on the page. */ + total: number; + /** List of worklogs. */ + worklogs: Worklog[]; +} diff --git a/src/version3/models/pageOfWorklogs.ts b/src/version3/models/pageOfWorklogs.ts deleted file mode 100644 index 08620e1ded..0000000000 --- a/src/version3/models/pageOfWorklogs.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Worklog } from './worklog'; - -/** Paginated list of worklog details */ -export interface PageOfWorklogs { - /** The index of the first item returned on the page. */ - startAt: number; - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The number of results on the page. */ - total: number; - /** List of worklogs. */ - worklogs: Worklog[]; -} diff --git a/src/version3/models/pagePriority.mts b/src/version3/models/pagePriority.mts new file mode 100644 index 0000000000..bac0150bcd --- /dev/null +++ b/src/version3/models/pagePriority.mts @@ -0,0 +1,19 @@ +import type { Priority } from './priority.mjs'; + +/** A page of items. */ +export interface PagePriority { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Priority[]; +} diff --git a/src/version3/models/pagePriority.ts b/src/version3/models/pagePriority.ts deleted file mode 100644 index 4aa76c37cc..0000000000 --- a/src/version3/models/pagePriority.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Priority } from './priority'; - -/** A page of items. */ -export interface PagePriority { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Priority[]; -} diff --git a/src/version3/models/pageProject.mts b/src/version3/models/pageProject.mts new file mode 100644 index 0000000000..4622178218 --- /dev/null +++ b/src/version3/models/pageProject.mts @@ -0,0 +1,19 @@ +import type { Project } from './project.mjs'; + +/** A page of items. */ +export interface PageProject { + /** The URL of the page. */ + self: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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: Project[]; +} diff --git a/src/version3/models/pageProject.ts b/src/version3/models/pageProject.ts deleted file mode 100644 index 2da9654a91..0000000000 --- a/src/version3/models/pageProject.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Project } from './project'; - -/** A page of items. */ -export interface PageProject { - /** The URL of the page. */ - self: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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: Project[]; -} diff --git a/src/version3/models/pageProjectDetails.mts b/src/version3/models/pageProjectDetails.mts new file mode 100644 index 0000000000..bb6f771d7b --- /dev/null +++ b/src/version3/models/pageProjectDetails.mts @@ -0,0 +1,19 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** A page of items. */ +export interface PageProjectDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ProjectDetails[]; +} diff --git a/src/version3/models/pageProjectDetails.ts b/src/version3/models/pageProjectDetails.ts deleted file mode 100644 index 0f1672409d..0000000000 --- a/src/version3/models/pageProjectDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ProjectDetails } from './projectDetails'; - -/** A page of items. */ -export interface PageProjectDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ProjectDetails[]; -} diff --git a/src/version3/models/pageResolution.mts b/src/version3/models/pageResolution.mts new file mode 100644 index 0000000000..59c7355b3f --- /dev/null +++ b/src/version3/models/pageResolution.mts @@ -0,0 +1,19 @@ +import type { Resolution } from './resolution.mjs'; + +/** A page of items. */ +export interface PageResolution { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Resolution[]; +} diff --git a/src/version3/models/pageResolution.ts b/src/version3/models/pageResolution.ts deleted file mode 100644 index 28760b7a99..0000000000 --- a/src/version3/models/pageResolution.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Resolution } from './resolution'; - -/** A page of items. */ -export interface PageResolution { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Resolution[]; -} diff --git a/src/version3/models/pageScreen.mts b/src/version3/models/pageScreen.mts new file mode 100644 index 0000000000..a980ea516f --- /dev/null +++ b/src/version3/models/pageScreen.mts @@ -0,0 +1,19 @@ +import type { Screen } from './screen.mjs'; + +/** A page of items. */ +export interface PageScreen { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Screen[]; +} diff --git a/src/version3/models/pageScreen.ts b/src/version3/models/pageScreen.ts deleted file mode 100644 index 82435a4d0a..0000000000 --- a/src/version3/models/pageScreen.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Screen } from './screen'; - -/** A page of items. */ -export interface PageScreen { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Screen[]; -} diff --git a/src/version3/models/pageScreenScheme.mts b/src/version3/models/pageScreenScheme.mts new file mode 100644 index 0000000000..a02d16b405 --- /dev/null +++ b/src/version3/models/pageScreenScheme.mts @@ -0,0 +1,19 @@ +import type { ScreenScheme } from './screenScheme.mjs'; + +/** A page of items. */ +export interface PageScreenScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ScreenScheme[]; +} diff --git a/src/version3/models/pageScreenScheme.ts b/src/version3/models/pageScreenScheme.ts deleted file mode 100644 index a5023d3c76..0000000000 --- a/src/version3/models/pageScreenScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ScreenScheme } from './screenScheme'; - -/** A page of items. */ -export interface PageScreenScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ScreenScheme[]; -} diff --git a/src/version3/models/pageScreenWithTab.mts b/src/version3/models/pageScreenWithTab.mts new file mode 100644 index 0000000000..1857917bbd --- /dev/null +++ b/src/version3/models/pageScreenWithTab.mts @@ -0,0 +1,19 @@ +import type { ScreenWithTab } from './screenWithTab.mjs'; + +/** A page of items. */ +export interface PageScreenWithTab { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: ScreenWithTab[]; +} diff --git a/src/version3/models/pageScreenWithTab.ts b/src/version3/models/pageScreenWithTab.ts deleted file mode 100644 index df960a6bb3..0000000000 --- a/src/version3/models/pageScreenWithTab.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ScreenWithTab } from './screenWithTab'; - -/** A page of items. */ -export interface PageScreenWithTab { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: ScreenWithTab[]; -} diff --git a/src/version3/models/pageSecurityLevel.mts b/src/version3/models/pageSecurityLevel.mts new file mode 100644 index 0000000000..a7fbe1dd43 --- /dev/null +++ b/src/version3/models/pageSecurityLevel.mts @@ -0,0 +1,19 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** A page of items. */ +export interface PageSecurityLevel { + /** 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?: SecurityLevel[]; +} diff --git a/src/version3/models/pageSecurityLevel.ts b/src/version3/models/pageSecurityLevel.ts deleted file mode 100644 index 9248cd0c9c..0000000000 --- a/src/version3/models/pageSecurityLevel.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SecurityLevel } from './securityLevel'; - -/** A page of items. */ -export interface PageSecurityLevel { - /** 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?: SecurityLevel[]; -} diff --git a/src/version3/models/pageSecurityLevelMember.mts b/src/version3/models/pageSecurityLevelMember.mts new file mode 100644 index 0000000000..df7be8f250 --- /dev/null +++ b/src/version3/models/pageSecurityLevelMember.mts @@ -0,0 +1,19 @@ +import type { SecurityLevelMember } from './securityLevelMember.mjs'; + +/** A page of items. */ +export interface PageSecurityLevelMember { + /** 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?: SecurityLevelMember[]; +} diff --git a/src/version3/models/pageSecurityLevelMember.ts b/src/version3/models/pageSecurityLevelMember.ts deleted file mode 100644 index b168666ffc..0000000000 --- a/src/version3/models/pageSecurityLevelMember.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SecurityLevelMember } from './securityLevelMember'; - -/** A page of items. */ -export interface PageSecurityLevelMember { - /** 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?: SecurityLevelMember[]; -} diff --git a/src/version3/models/pageSecuritySchemeWithProjects.mts b/src/version3/models/pageSecuritySchemeWithProjects.mts new file mode 100644 index 0000000000..c2840d1bc0 --- /dev/null +++ b/src/version3/models/pageSecuritySchemeWithProjects.mts @@ -0,0 +1,19 @@ +import type { SecuritySchemeWithProjects } from './securitySchemeWithProjects.mjs'; + +/** A page of items. */ +export interface PageSecuritySchemeWithProjects { + /** 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?: SecuritySchemeWithProjects[]; +} diff --git a/src/version3/models/pageSecuritySchemeWithProjects.ts b/src/version3/models/pageSecuritySchemeWithProjects.ts deleted file mode 100644 index 06b1431177..0000000000 --- a/src/version3/models/pageSecuritySchemeWithProjects.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SecuritySchemeWithProjects } from './securitySchemeWithProjects'; - -/** A page of items. */ -export interface PageSecuritySchemeWithProjects { - /** 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?: SecuritySchemeWithProjects[]; -} diff --git a/src/version3/models/pageString.ts b/src/version3/models/pageString.mts similarity index 100% rename from src/version3/models/pageString.ts rename to src/version3/models/pageString.mts diff --git a/src/version3/models/pageUiModificationDetails.mts b/src/version3/models/pageUiModificationDetails.mts new file mode 100644 index 0000000000..3c85bb4b3a --- /dev/null +++ b/src/version3/models/pageUiModificationDetails.mts @@ -0,0 +1,19 @@ +import type { UiModificationDetails } from './uiModificationDetails.mjs'; + +/** A page of items. */ +export interface PageUiModificationDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: UiModificationDetails[]; +} diff --git a/src/version3/models/pageUiModificationDetails.ts b/src/version3/models/pageUiModificationDetails.ts deleted file mode 100644 index b29e8c928e..0000000000 --- a/src/version3/models/pageUiModificationDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UiModificationDetails } from './uiModificationDetails'; - -/** A page of items. */ -export interface PageUiModificationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: UiModificationDetails[]; -} diff --git a/src/version3/models/pageUser.mts b/src/version3/models/pageUser.mts new file mode 100644 index 0000000000..482de7ed89 --- /dev/null +++ b/src/version3/models/pageUser.mts @@ -0,0 +1,19 @@ +import { User } from './user.mjs'; + +/** A page of items. */ +export interface PageUser { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: User[]; +} diff --git a/src/version3/models/pageUser.ts b/src/version3/models/pageUser.ts deleted file mode 100644 index 34572905e2..0000000000 --- a/src/version3/models/pageUser.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { User } from './user'; - -/** A page of items. */ -export interface PageUser { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: User[]; -} diff --git a/src/version3/models/pageUserDetails.mts b/src/version3/models/pageUserDetails.mts new file mode 100644 index 0000000000..48f60845a6 --- /dev/null +++ b/src/version3/models/pageUserDetails.mts @@ -0,0 +1,19 @@ +import { UserDetails } from './userDetails.mjs'; + +/** A page of items. */ +export interface PageUserDetails { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: UserDetails[]; +} diff --git a/src/version3/models/pageUserDetails.ts b/src/version3/models/pageUserDetails.ts deleted file mode 100644 index e6811dd394..0000000000 --- a/src/version3/models/pageUserDetails.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** A page of items. */ -export interface PageUserDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: UserDetails[]; -} diff --git a/src/version3/models/pageUserKey.mts b/src/version3/models/pageUserKey.mts new file mode 100644 index 0000000000..ec7a92d177 --- /dev/null +++ b/src/version3/models/pageUserKey.mts @@ -0,0 +1,19 @@ +import type { UserKey } from './userKey.mjs'; + +/** A page of items. */ +export interface PageUserKey { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: UserKey[]; +} diff --git a/src/version3/models/pageUserKey.ts b/src/version3/models/pageUserKey.ts deleted file mode 100644 index 015d8a4d22..0000000000 --- a/src/version3/models/pageUserKey.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UserKey } from './userKey'; - -/** A page of items. */ -export interface PageUserKey { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: UserKey[]; -} diff --git a/src/version3/models/pageVersion.mts b/src/version3/models/pageVersion.mts new file mode 100644 index 0000000000..2523d4bef7 --- /dev/null +++ b/src/version3/models/pageVersion.mts @@ -0,0 +1,19 @@ +import type { Version } from './version.mjs'; + +/** A page of items. */ +export interface PageVersion { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Version[]; +} diff --git a/src/version3/models/pageVersion.ts b/src/version3/models/pageVersion.ts deleted file mode 100644 index 32cd68c57f..0000000000 --- a/src/version3/models/pageVersion.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Version } from './version'; - -/** A page of items. */ -export interface PageVersion { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Version[]; -} diff --git a/src/version3/models/pageWebhook.mts b/src/version3/models/pageWebhook.mts new file mode 100644 index 0000000000..c23ed7d088 --- /dev/null +++ b/src/version3/models/pageWebhook.mts @@ -0,0 +1,19 @@ +import type { Webhook } from './webhook.mjs'; + +/** A page of items. */ +export interface PageWebhook { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Webhook[]; +} diff --git a/src/version3/models/pageWebhook.ts b/src/version3/models/pageWebhook.ts deleted file mode 100644 index 0af6a7d896..0000000000 --- a/src/version3/models/pageWebhook.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Webhook } from './webhook'; - -/** A page of items. */ -export interface PageWebhook { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Webhook[]; -} diff --git a/src/version3/models/pageWorkflow.mts b/src/version3/models/pageWorkflow.mts new file mode 100644 index 0000000000..20d6adcef7 --- /dev/null +++ b/src/version3/models/pageWorkflow.mts @@ -0,0 +1,19 @@ +import type { Workflow } from './workflow.mjs'; + +/** A page of items. */ +export interface PageWorkflow { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: Workflow[]; +} diff --git a/src/version3/models/pageWorkflow.ts b/src/version3/models/pageWorkflow.ts deleted file mode 100644 index 838f83cbe4..0000000000 --- a/src/version3/models/pageWorkflow.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Workflow } from './workflow'; - -/** A page of items. */ -export interface PageWorkflow { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: Workflow[]; -} diff --git a/src/version3/models/pageWorkflowScheme.mts b/src/version3/models/pageWorkflowScheme.mts new file mode 100644 index 0000000000..1ffdefb917 --- /dev/null +++ b/src/version3/models/pageWorkflowScheme.mts @@ -0,0 +1,19 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A page of items. */ +export interface PageWorkflowScheme { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: WorkflowScheme[]; +} diff --git a/src/version3/models/pageWorkflowScheme.ts b/src/version3/models/pageWorkflowScheme.ts deleted file mode 100644 index 5f13702201..0000000000 --- a/src/version3/models/pageWorkflowScheme.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { WorkflowScheme } from './workflowScheme'; - -/** A page of items. */ -export interface PageWorkflowScheme { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: WorkflowScheme[]; -} diff --git a/src/version3/models/pageWorkflowTransitionRules.mts b/src/version3/models/pageWorkflowTransitionRules.mts new file mode 100644 index 0000000000..68e7be22e3 --- /dev/null +++ b/src/version3/models/pageWorkflowTransitionRules.mts @@ -0,0 +1,19 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** A page of items. */ +export interface PageWorkflowTransitionRules { + /** The URL of the page. */ + self?: string; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** 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?: WorkflowTransitionRules[]; +} diff --git a/src/version3/models/pageWorkflowTransitionRules.ts b/src/version3/models/pageWorkflowTransitionRules.ts deleted file mode 100644 index 2502898916..0000000000 --- a/src/version3/models/pageWorkflowTransitionRules.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** A page of items. */ -export interface PageWorkflowTransitionRules { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; - /** 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?: WorkflowTransitionRules[]; -} diff --git a/src/version3/models/pagedListUserDetailsApplicationUser.mts b/src/version3/models/pagedListUserDetailsApplicationUser.mts new file mode 100644 index 0000000000..3afe7ecbf6 --- /dev/null +++ b/src/version3/models/pagedListUserDetailsApplicationUser.mts @@ -0,0 +1,18 @@ +import { UserDetails } from './userDetails.mjs'; + +/** + * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, + * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. + */ +export interface PagedListUserDetailsApplicationUser { + /** The number of items on the page. */ + size?: number; + /** The list of items. */ + items?: UserDetails[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; + /** The index of the last item returned on the page. */ + 'end-index'?: number; +} diff --git a/src/version3/models/pagedListUserDetailsApplicationUser.ts b/src/version3/models/pagedListUserDetailsApplicationUser.ts deleted file mode 100644 index 98f6dd85ee..0000000000 --- a/src/version3/models/pagedListUserDetailsApplicationUser.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** - * A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, - * `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. - */ -export interface PagedListUserDetailsApplicationUser { - /** The number of items on the page. */ - size?: number; - /** The list of items. */ - items?: UserDetails[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; - /** The index of the last item returned on the page. */ - 'end-index'?: number; -} diff --git a/src/version3/models/parsedJqlQueries.mts b/src/version3/models/parsedJqlQueries.mts new file mode 100644 index 0000000000..e4ae784f63 --- /dev/null +++ b/src/version3/models/parsedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { ParsedJqlQuery } from './parsedJqlQuery.mjs'; + +/** A list of parsed Jql queries. */ +export interface ParsedJqlQueries { + /** A list of parsed Jql queries. */ + queries: ParsedJqlQuery[]; +} diff --git a/src/version3/models/parsedJqlQueries.ts b/src/version3/models/parsedJqlQueries.ts deleted file mode 100644 index bb75f00a3c..0000000000 --- a/src/version3/models/parsedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ParsedJqlQuery } from './parsedJqlQuery'; - -/** A list of parsed JQL queries. */ -export interface ParsedJqlQueries { - /** A list of parsed JQL queries. */ - queries: ParsedJqlQuery[]; -} diff --git a/src/version3/models/parsedJqlQuery.mts b/src/version3/models/parsedJqlQuery.mts new file mode 100644 index 0000000000..98304c5e95 --- /dev/null +++ b/src/version3/models/parsedJqlQuery.mts @@ -0,0 +1,10 @@ +import type { JqlQuery } from './jqlQuery.mjs'; + +/** Details of a parsed Jql query. */ +export interface ParsedJqlQuery { + /** The Jql query that was parsed and validated. */ + query: string; + structure?: JqlQuery; + /** The list of syntax or validation errors. */ + errors?: string[]; +} diff --git a/src/version3/models/parsedJqlQuery.ts b/src/version3/models/parsedJqlQuery.ts deleted file mode 100644 index 2a6dd3a724..0000000000 --- a/src/version3/models/parsedJqlQuery.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { JqlQuery } from './jqlQuery'; - -/** Details of a parsed JQL query. */ -export interface ParsedJqlQuery { - /** The JQL query that was parsed and validated. */ - query: string; - structure?: JqlQuery; - /** The list of syntax or validation errors. */ - errors?: string[]; -} diff --git a/src/version3/models/permissionDetails.mts b/src/version3/models/permissionDetails.mts new file mode 100644 index 0000000000..14aaa79dd6 --- /dev/null +++ b/src/version3/models/permissionDetails.mts @@ -0,0 +1,9 @@ +import type { SharePermission } from './sharePermission.mjs'; + +/** Details for permissions of shareable entities */ +export interface PermissionDetails { + /** The edit permissions for the shareable entities. */ + editPermissions: SharePermission[]; + /** The share permissions for the shareable entities. */ + sharePermissions: SharePermission[]; +} diff --git a/src/version3/models/permissionDetails.ts b/src/version3/models/permissionDetails.ts deleted file mode 100644 index df73897699..0000000000 --- a/src/version3/models/permissionDetails.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { SharePermission } from './sharePermission'; - -/** Details for permissions of shareable entities */ -export interface PermissionDetails { - /** The edit permissions for the shareable entities. */ - editPermissions: SharePermission[]; - /** The share permissions for the shareable entities. */ - sharePermissions: SharePermission[]; -} diff --git a/src/version3/models/permissionGrant.mts b/src/version3/models/permissionGrant.mts new file mode 100644 index 0000000000..6a1a58e1a7 --- /dev/null +++ b/src/version3/models/permissionGrant.mts @@ -0,0 +1,19 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Details about a permission granted to a user or group. */ +export interface PermissionGrant { + /** The ID of the permission granted details. */ + id?: number; + /** The URL of the permission granted details. */ + self?: string; + holder?: PermissionHolder; + /** + * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an + * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission + * schemes_ for more information about the built-in permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information about custom permissions. + */ + permission?: string; +} diff --git a/src/version3/models/permissionGrant.ts b/src/version3/models/permissionGrant.ts deleted file mode 100644 index bcc8a165b5..0000000000 --- a/src/version3/models/permissionGrant.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { PermissionHolder } from './permissionHolder'; - -/** Details about a permission granted to a user or group. */ -export interface PermissionGrant { - /** The ID of the permission granted details. */ - id?: number; - /** The URL of the permission granted details. */ - self?: string; - holder?: PermissionHolder; - /** - * The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an - * app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in _Get all permission - * schemes_ for more information about the built-in permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information about custom permissions. - */ - permission?: string; -} diff --git a/src/version3/models/permissionGrants.mts b/src/version3/models/permissionGrants.mts new file mode 100644 index 0000000000..c47ba064fe --- /dev/null +++ b/src/version3/models/permissionGrants.mts @@ -0,0 +1,9 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; + +/** List of permission grants. */ +export interface PermissionGrants { + /** Permission grants list. */ + permissions?: PermissionGrant[]; + /** Expand options that include additional permission grant details in the response. */ + expand?: string; +} diff --git a/src/version3/models/permissionGrants.ts b/src/version3/models/permissionGrants.ts deleted file mode 100644 index 8f4bcc01f1..0000000000 --- a/src/version3/models/permissionGrants.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { PermissionGrant } from './permissionGrant'; - -/** List of permission grants. */ -export interface PermissionGrants { - /** Permission grants list. */ - permissions?: PermissionGrant[]; - /** Expand options that include additional permission grant details in the response. */ - expand?: string; -} diff --git a/src/version3/models/permissionHolder.ts b/src/version3/models/permissionHolder.mts similarity index 100% rename from src/version3/models/permissionHolder.ts rename to src/version3/models/permissionHolder.mts diff --git a/src/version3/models/permissionScheme.mts b/src/version3/models/permissionScheme.mts new file mode 100644 index 0000000000..8ad4000e63 --- /dev/null +++ b/src/version3/models/permissionScheme.mts @@ -0,0 +1,22 @@ +import type { PermissionGrant } from './permissionGrant.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details of a permission scheme. */ +export interface PermissionScheme { + /** The expand options available for the permission scheme. */ + expand?: string; + /** The ID of the permission scheme. */ + id?: number; + /** The URL of the permission scheme. */ + self?: string; + /** The name of the permission scheme. Must be unique. */ + name: string; + /** A description for the permission scheme. */ + description?: string; + scope?: Scope; + /** + * The permission scheme to create or update. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. + */ + permissions?: PermissionGrant[]; +} diff --git a/src/version3/models/permissionScheme.ts b/src/version3/models/permissionScheme.ts deleted file mode 100644 index 367d4222db..0000000000 --- a/src/version3/models/permissionScheme.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { PermissionGrant } from './permissionGrant'; -import { Scope } from './scope'; - -/** Details of a permission scheme. */ -export interface PermissionScheme { - /** The expand options available for the permission scheme. */ - expand?: string; - /** The ID of the permission scheme. */ - id?: number; - /** The URL of the permission scheme. */ - self?: string; - /** The name of the permission scheme. Must be unique. */ - name: string; - /** A description for the permission scheme. */ - description?: string; - scope?: Scope; - /** - * The permission scheme to create or update. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. - */ - permissions?: PermissionGrant[]; -} diff --git a/src/version3/models/permissionSchemes.mts b/src/version3/models/permissionSchemes.mts new file mode 100644 index 0000000000..2ac1a132e5 --- /dev/null +++ b/src/version3/models/permissionSchemes.mts @@ -0,0 +1,7 @@ +import type { PermissionScheme } from './permissionScheme.mjs'; + +/** List of all permission schemes. */ +export interface PermissionSchemes { + /** Permission schemes list. */ + permissionSchemes?: PermissionScheme[]; +} diff --git a/src/version3/models/permissionSchemes.ts b/src/version3/models/permissionSchemes.ts deleted file mode 100644 index 181dd57788..0000000000 --- a/src/version3/models/permissionSchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PermissionScheme } from './permissionScheme'; - -/** List of all permission schemes. */ -export interface PermissionSchemes { - /** Permission schemes list. */ - permissionSchemes?: PermissionScheme[]; -} diff --git a/src/version3/models/permissions.ts b/src/version3/models/permissions.mts similarity index 100% rename from src/version3/models/permissions.ts rename to src/version3/models/permissions.mts diff --git a/src/version3/models/permissionsKeys.ts b/src/version3/models/permissionsKeys.mts similarity index 100% rename from src/version3/models/permissionsKeys.ts rename to src/version3/models/permissionsKeys.mts diff --git a/src/version3/models/permittedProjects.mts b/src/version3/models/permittedProjects.mts new file mode 100644 index 0000000000..3b1dad5f77 --- /dev/null +++ b/src/version3/models/permittedProjects.mts @@ -0,0 +1,7 @@ +import type { ProjectIdentifier } from './projectIdentifier.mjs'; + +/** A list of projects in which a user is granted permissions. */ +export interface PermittedProjects { + /** A list of projects. */ + projects?: ProjectIdentifier[]; +} diff --git a/src/version3/models/permittedProjects.ts b/src/version3/models/permittedProjects.ts deleted file mode 100644 index 80cf250e71..0000000000 --- a/src/version3/models/permittedProjects.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProjectIdentifier } from './projectIdentifier'; - -/** A list of projects in which a user is granted permissions. */ -export interface PermittedProjects { - /** A list of projects. */ - projects?: ProjectIdentifier[]; -} diff --git a/src/version3/models/priority.ts b/src/version3/models/priority.mts similarity index 100% rename from src/version3/models/priority.ts rename to src/version3/models/priority.mts diff --git a/src/version3/models/priorityId.ts b/src/version3/models/priorityId.mts similarity index 100% rename from src/version3/models/priorityId.ts rename to src/version3/models/priorityId.mts diff --git a/src/version3/models/project.mts b/src/version3/models/project.mts new file mode 100644 index 0000000000..460fb19304 --- /dev/null +++ b/src/version3/models/project.mts @@ -0,0 +1,88 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { Hierarchy } from './hierarchy.mjs'; +import type { IssueTypeDetails } from './issueTypeDetails.mjs'; +import type { ProjectCategory } from './projectCategory.mjs'; +import type { ProjectComponent } from './projectComponent.mjs'; +import type { ProjectInsight } from './projectInsight.mjs'; +import type { ProjectLandingPageInfo } from './projectLandingPageInfo.mjs'; +import type { ProjectPermissions } from './projectPermissions.mjs'; +import type { User } from './user.mjs'; +import type { Version } from './version.mjs'; + +/** Details about a project. */ +export interface Project { + /** Expand options that include additional project details in the response. */ + expand?: + | 'description' + | 'issueTypes' + | 'lead' + | 'projectKeys' + | 'issueTypeHierarchy' + | ('description' | 'issueTypes' | 'lead' | 'projectKeys' | 'issueTypeHierarchy')[] + | string + | string[]; + /** The URL of the project details. */ + self?: string; + /** The ID of the project. */ + id: string; + /** The key of the project. */ + key: string; + /** A brief description of the project. */ + description?: string; + lead: User; + /** List of the components contained in the project. */ + components?: ProjectComponent[]; + /** List of the issue types available in the project. */ + issueTypes?: IssueTypeDetails[]; + /** A link to information about this project, such as project documentation. */ + url?: string; + /** An email address associated with the project. */ + email?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: string; + /** The versions defined in the project. For more information, see [Create version](#api-rest-api-3-version-post). */ + versions?: Version[]; + /** The name of the project. */ + name: string; + /** + * The name and self URL for each role defined in the project. For more information, see [Create project + * role](#api-rest-api-3-role-post). + */ + roles?: {}; + avatarUrls?: AvatarUrls; + projectCategory?: ProjectCategory; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** Whether the project is simplified. */ + simplified?: boolean; + /** The type of the project. */ + style?: string; + /** Whether the project is selected as a favorite. */ + favourite?: boolean; + /** Whether the project is private. */ + isPrivate?: boolean; + issueTypeHierarchy?: Hierarchy; + permissions?: ProjectPermissions; + /** Map of project properties */ + properties?: {}; + /** Unique ID for next-gen projects. */ + uuid?: string; + insight?: ProjectInsight; + /** Whether the project is marked as deleted. */ + deleted?: boolean; + /** The date when the project is deleted permanently. */ + retentionTillDate?: string; + /** The date when the project was marked as deleted. */ + deletedDate?: string; + deletedBy?: User; + /** Whether the project is archived. */ + archived?: boolean; + /** The date when the project was archived. */ + archivedDate?: string; + archivedBy?: User; + landingPageInfo?: ProjectLandingPageInfo; +} diff --git a/src/version3/models/project.ts b/src/version3/models/project.ts deleted file mode 100644 index c851daa5b0..0000000000 --- a/src/version3/models/project.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { Hierarchy } from './hierarchy'; -import { IssueTypeDetails } from './issueTypeDetails'; -import { ProjectCategory } from './projectCategory'; -import { ProjectComponent } from './projectComponent'; -import { ProjectInsight } from './projectInsight'; -import { ProjectLandingPageInfo } from './projectLandingPageInfo'; -import { ProjectPermissions } from './projectPermissions'; -import { User } from './user'; -import { Version } from './version'; - -/** Details about a project. */ -export interface Project { - /** Expand options that include additional project details in the response. */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | 'issueTypeHierarchy' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys' | 'issueTypeHierarchy')[] - | string - | string[]; - /** The URL of the project details. */ - self?: string; - /** The ID of the project. */ - id: string; - /** The key of the project. */ - key: string; - /** A brief description of the project. */ - description?: string; - lead: User; - /** List of the components contained in the project. */ - components?: ProjectComponent[]; - /** List of the issue types available in the project. */ - issueTypes?: IssueTypeDetails[]; - /** A link to information about this project, such as project documentation. */ - url?: string; - /** An email address associated with the project. */ - email?: string; - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - /** The versions defined in the project. For more information, see [Create version](#api-rest-api-3-version-post). */ - versions?: Version[]; - /** The name of the project. */ - name: string; - /** - * The name and self URL for each role defined in the project. For more information, see [Create project - * role](#api-rest-api-3-role-post). - */ - roles?: {}; - avatarUrls?: AvatarUrls; - projectCategory?: ProjectCategory; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Whether the project is simplified. */ - simplified?: boolean; - /** The type of the project. */ - style?: string; - /** Whether the project is selected as a favorite. */ - favourite?: boolean; - /** Whether the project is private. */ - isPrivate?: boolean; - issueTypeHierarchy?: Hierarchy; - permissions?: ProjectPermissions; - /** Map of project properties */ - properties?: {}; - /** Unique ID for next-gen projects. */ - uuid?: string; - insight?: ProjectInsight; - /** Whether the project is marked as deleted. */ - deleted?: boolean; - /** The date when the project is deleted permanently. */ - retentionTillDate?: string; - /** The date when the project was marked as deleted. */ - deletedDate?: string; - deletedBy?: User; - /** Whether the project is archived. */ - archived?: boolean; - /** The date when the project was archived. */ - archivedDate?: string; - archivedBy?: User; - landingPageInfo?: ProjectLandingPageInfo; -} diff --git a/src/version3/models/projectAvatars.mts b/src/version3/models/projectAvatars.mts new file mode 100644 index 0000000000..8928a953a0 --- /dev/null +++ b/src/version3/models/projectAvatars.mts @@ -0,0 +1,9 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of project avatars. */ +export interface ProjectAvatars { + /** List of avatars included with Jira. These avatars cannot be deleted. */ + system?: Avatar[]; + /** List of avatars added to Jira. These avatars may be deleted. */ + custom?: Avatar[]; +} diff --git a/src/version3/models/projectAvatars.ts b/src/version3/models/projectAvatars.ts deleted file mode 100644 index 0f8c833f2c..0000000000 --- a/src/version3/models/projectAvatars.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Avatar } from './avatar'; - -/** List of project avatars. */ -export interface ProjectAvatars { - /** List of avatars included with Jira. These avatars cannot be deleted. */ - system?: Avatar[]; - /** List of avatars added to Jira. These avatars may be deleted. */ - custom?: Avatar[]; -} diff --git a/src/version3/models/projectCategory.ts b/src/version3/models/projectCategory.mts similarity index 100% rename from src/version3/models/projectCategory.ts rename to src/version3/models/projectCategory.mts diff --git a/src/version3/models/projectComponent.mts b/src/version3/models/projectComponent.mts new file mode 100644 index 0000000000..5438226425 --- /dev/null +++ b/src/version3/models/projectComponent.mts @@ -0,0 +1,66 @@ +import { User } from './user.mjs'; + +/** Details about a project component. */ +export interface ProjectComponent { + 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. + * + * Default value: `PROJECT_DEFAULT`. + * Optional when creating or updating a component. + */ + assigneeType?: string; + /** The description for the component. Optional when creating or updating a component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** + * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but + * the component lead is not set, then `false` is returned. + */ + isAssigneeTypeValid?: boolean; + lead?: User; + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian + * products. For example, _5b10ac8d82e05b22cc7d4ef5_. + */ + 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. + */ + leadUserName?: string; + /** + * 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. + */ + name?: string; + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project?: string; + /** The ID of the project the component is assigned to. */ + projectId?: number; + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set + * 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. + */ + realAssigneeType?: string; + /** The URL of the component. */ + self?: string; +} diff --git a/src/version3/models/projectComponent.ts b/src/version3/models/projectComponent.ts deleted file mode 100644 index 6703ca07d0..0000000000 --- a/src/version3/models/projectComponent.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { User } from './user'; - -/** Details about a project component. */ -export interface ProjectComponent { - 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. - * - * Default value: `PROJECT_DEFAULT`. - * Optional when creating or updating a component. - */ - assigneeType?: string; - /** The description for the component. Optional when creating or updating a component. */ - description?: string; - /** The unique identifier for the component. */ - id?: string; - /** - * Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but - * the component lead is not set, then `false` is returned. - */ - isAssigneeTypeValid?: boolean; - lead?: User; - /** - * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian - * products. For example, _5b10ac8d82e05b22cc7d4ef5_. - */ - 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. - */ - leadUserName?: string; - /** - * 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. - */ - name?: string; - /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ - project?: string; - /** The ID of the project the component is assigned to. */ - projectId?: number; - realAssignee?: User; - /** - * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set - * 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. - */ - realAssigneeType?: string; - /** The URL of the component. */ - self?: string; -} diff --git a/src/version3/models/projectDetails.mts b/src/version3/models/projectDetails.mts new file mode 100644 index 0000000000..642e2cad4b --- /dev/null +++ b/src/version3/models/projectDetails.mts @@ -0,0 +1,24 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { UpdatedProjectCategory } from './updatedProjectCategory.mjs'; + +/** Details about a project. */ +export interface ProjectDetails { + /** The URL of the project details. */ + self?: string; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; + avatarUrls?: AvatarUrls; + projectCategory?: UpdatedProjectCategory; +} diff --git a/src/version3/models/projectDetails.ts b/src/version3/models/projectDetails.ts deleted file mode 100644 index 8a68dbde84..0000000000 --- a/src/version3/models/projectDetails.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { UpdatedProjectCategory } from './updatedProjectCategory'; - -/** Details about a project. */ -export interface ProjectDetails { - /** The URL of the project details. */ - self?: string; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - /** - * The [project - * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the - * project. - */ - projectTypeKey?: string; - /** Whether or not the project is simplified. */ - simplified?: boolean; - avatarUrls?: AvatarUrls; - projectCategory?: UpdatedProjectCategory; -} diff --git a/src/version3/models/projectEmailAddress.ts b/src/version3/models/projectEmailAddress.mts similarity index 100% rename from src/version3/models/projectEmailAddress.ts rename to src/version3/models/projectEmailAddress.mts diff --git a/src/version3/models/projectFeature.ts b/src/version3/models/projectFeature.mts similarity index 100% rename from src/version3/models/projectFeature.ts rename to src/version3/models/projectFeature.mts diff --git a/src/version3/models/projectFeatureToggleRequest.ts b/src/version3/models/projectFeatureToggleRequest.mts similarity index 100% rename from src/version3/models/projectFeatureToggleRequest.ts rename to src/version3/models/projectFeatureToggleRequest.mts diff --git a/src/version3/models/projectId.ts b/src/version3/models/projectId.mts similarity index 100% rename from src/version3/models/projectId.ts rename to src/version3/models/projectId.mts diff --git a/src/version3/models/projectIdentifier.ts b/src/version3/models/projectIdentifier.mts similarity index 100% rename from src/version3/models/projectIdentifier.ts rename to src/version3/models/projectIdentifier.mts diff --git a/src/version3/models/projectIdentifiers.ts b/src/version3/models/projectIdentifiers.mts similarity index 100% rename from src/version3/models/projectIdentifiers.ts rename to src/version3/models/projectIdentifiers.mts diff --git a/src/version3/models/projectIds.ts b/src/version3/models/projectIds.mts similarity index 100% rename from src/version3/models/projectIds.ts rename to src/version3/models/projectIds.mts diff --git a/src/version3/models/projectInsight.ts b/src/version3/models/projectInsight.mts similarity index 100% rename from src/version3/models/projectInsight.ts rename to src/version3/models/projectInsight.mts diff --git a/src/version3/models/projectIssueCreateMetadata.mts b/src/version3/models/projectIssueCreateMetadata.mts new file mode 100644 index 0000000000..73366ba4e6 --- /dev/null +++ b/src/version3/models/projectIssueCreateMetadata.mts @@ -0,0 +1,19 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata.mjs'; + +/** Details of the issue creation metadata for a project. */ +export interface ProjectIssueCreateMetadata { + /** Expand options that include additional project issue create metadata details in the response. */ + expand?: string; + /** The URL of the project. */ + self?: string; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + avatarUrls?: AvatarUrls; + /** List of the issue types supported by the project. */ + issuetypes?: IssueTypeIssueCreateMetadata[]; +} diff --git a/src/version3/models/projectIssueCreateMetadata.ts b/src/version3/models/projectIssueCreateMetadata.ts deleted file mode 100644 index f0ebe11d3c..0000000000 --- a/src/version3/models/projectIssueCreateMetadata.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; - -/** Details of the issue creation metadata for a project. */ -export interface ProjectIssueCreateMetadata { - /** Expand options that include additional project issue create metadata details in the response. */ - expand?: string; - /** The URL of the project. */ - self?: string; - /** The ID of the project. */ - id?: string; - /** The key of the project. */ - key?: string; - /** The name of the project. */ - name?: string; - avatarUrls?: AvatarUrls; - /** List of the issue types supported by the project. */ - issuetypes?: IssueTypeIssueCreateMetadata[]; -} diff --git a/src/version3/models/projectIssueSecurityLevels.mts b/src/version3/models/projectIssueSecurityLevels.mts new file mode 100644 index 0000000000..f8a3d01fbe --- /dev/null +++ b/src/version3/models/projectIssueSecurityLevels.mts @@ -0,0 +1,7 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** List of issue level security items in a project. */ +export interface ProjectIssueSecurityLevels { + /** Issue level security items list. */ + levels: SecurityLevel[]; +} diff --git a/src/version3/models/projectIssueSecurityLevels.ts b/src/version3/models/projectIssueSecurityLevels.ts deleted file mode 100644 index 410834302f..0000000000 --- a/src/version3/models/projectIssueSecurityLevels.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SecurityLevel } from './securityLevel'; - -/** List of issue level security items in a project. */ -export interface ProjectIssueSecurityLevels { - /** Issue level security items list. */ - levels: SecurityLevel[]; -} diff --git a/src/version3/models/projectIssueTypeHierarchy.mts b/src/version3/models/projectIssueTypeHierarchy.mts new file mode 100644 index 0000000000..cccc5fd714 --- /dev/null +++ b/src/version3/models/projectIssueTypeHierarchy.mts @@ -0,0 +1,9 @@ +import type { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel.mjs'; + +/** The hierarchy of issue types within a project. */ +export interface ProjectIssueTypeHierarchy { + /** The ID of the project. */ + projectId?: number; + /** Details of an issue type hierarchy level. */ + hierarchy?: ProjectIssueTypesHierarchyLevel[]; +} diff --git a/src/version3/models/projectIssueTypeHierarchy.ts b/src/version3/models/projectIssueTypeHierarchy.ts deleted file mode 100644 index e0825a17ac..0000000000 --- a/src/version3/models/projectIssueTypeHierarchy.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ProjectIssueTypesHierarchyLevel } from './projectIssueTypesHierarchyLevel'; - -/** The hierarchy of issue types within a project. */ -export interface ProjectIssueTypeHierarchy { - /** The ID of the project. */ - projectId?: number; - /** Details of an issue type hierarchy level. */ - hierarchy?: ProjectIssueTypesHierarchyLevel[]; -} diff --git a/src/version3/models/projectIssueTypeMapping.ts b/src/version3/models/projectIssueTypeMapping.mts similarity index 100% rename from src/version3/models/projectIssueTypeMapping.ts rename to src/version3/models/projectIssueTypeMapping.mts diff --git a/src/version3/models/projectIssueTypeMappings.mts b/src/version3/models/projectIssueTypeMappings.mts new file mode 100644 index 0000000000..81055b4ebe --- /dev/null +++ b/src/version3/models/projectIssueTypeMappings.mts @@ -0,0 +1,7 @@ +import type { ProjectIssueTypeMapping } from './projectIssueTypeMapping.mjs'; + +/** The project and issue type mappings. */ +export interface ProjectIssueTypeMappings { + /** The project and issue type mappings. */ + mappings: ProjectIssueTypeMapping[]; +} diff --git a/src/version3/models/projectIssueTypeMappings.ts b/src/version3/models/projectIssueTypeMappings.ts deleted file mode 100644 index ac79a3ad1a..0000000000 --- a/src/version3/models/projectIssueTypeMappings.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ProjectIssueTypeMapping } from './projectIssueTypeMapping'; - -/** The project and issue type mappings. */ -export interface ProjectIssueTypeMappings { - /** The project and issue type mappings. */ - mappings: ProjectIssueTypeMapping[]; -} diff --git a/src/version3/models/projectIssueTypes.mts b/src/version3/models/projectIssueTypes.mts new file mode 100644 index 0000000000..fd9d812d54 --- /dev/null +++ b/src/version3/models/projectIssueTypes.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ +export interface ProjectIssueTypes { + project?: ProjectId; + /** IDs of the issue types */ + issueTypes?: string[]; +} diff --git a/src/version3/models/projectIssueTypes.ts b/src/version3/models/projectIssueTypes.ts deleted file mode 100644 index a712f1e06e..0000000000 --- a/src/version3/models/projectIssueTypes.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectId } from './projectId'; - -/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ -export interface ProjectIssueTypes { - project?: ProjectId; - /** IDs of the issue types */ - issueTypes?: string[]; -} diff --git a/src/version3/models/projectIssueTypesHierarchyLevel.mts b/src/version3/models/projectIssueTypesHierarchyLevel.mts new file mode 100644 index 0000000000..a1dabec65d --- /dev/null +++ b/src/version3/models/projectIssueTypesHierarchyLevel.mts @@ -0,0 +1,11 @@ +import type { IssueTypeInfo } from './issueTypeInfo.mjs'; + +/** Details of an issue type hierarchy level. */ +export interface ProjectIssueTypesHierarchyLevel { + /** The level of the issue type hierarchy level. */ + level?: number; + /** The name of the issue type hierarchy level. */ + name?: string; + /** The list of issue types in the hierarchy level. */ + issueTypes?: IssueTypeInfo[]; +} diff --git a/src/version3/models/projectIssueTypesHierarchyLevel.ts b/src/version3/models/projectIssueTypesHierarchyLevel.ts deleted file mode 100644 index b4d9b2bc88..0000000000 --- a/src/version3/models/projectIssueTypesHierarchyLevel.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { IssueTypeInfo } from './issueTypeInfo'; - -/** Details of an issue type hierarchy level. */ -export interface ProjectIssueTypesHierarchyLevel { - /** The level of the issue type hierarchy level. */ - level?: number; - /** The name of the issue type hierarchy level. */ - name?: string; - /** The list of issue types in the hierarchy level. */ - issueTypes?: IssueTypeInfo[]; -} diff --git a/src/version3/models/projectLandingPageInfo.ts b/src/version3/models/projectLandingPageInfo.mts similarity index 100% rename from src/version3/models/projectLandingPageInfo.ts rename to src/version3/models/projectLandingPageInfo.mts diff --git a/src/version3/models/projectPermissions.ts b/src/version3/models/projectPermissions.mts similarity index 100% rename from src/version3/models/projectPermissions.ts rename to src/version3/models/projectPermissions.mts diff --git a/src/version3/models/projectRole.mts b/src/version3/models/projectRole.mts new file mode 100644 index 0000000000..d6dfeb1858 --- /dev/null +++ b/src/version3/models/projectRole.mts @@ -0,0 +1,27 @@ +import type { RoleActor } from './roleActor.mjs'; +import type { Scope } from './scope.mjs'; + +/** Details about the roles in a project. */ +export interface ProjectRole { + /** The URL the project role details. */ + self?: string; + /** The name of the project role. */ + name?: string; + /** The ID of the project role. */ + id?: number; + /** The description of the project role. */ + description?: string; + /** The list of users who act in this role. */ + actors?: RoleActor[]; + scope?: Scope; + /** The translated name of the project role. */ + translatedName?: string; + /** Whether the calling user is part of this role. */ + currentUserRole?: boolean; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + /** Whether this role is the default role for the project */ + default?: boolean; +} diff --git a/src/version3/models/projectRole.ts b/src/version3/models/projectRole.ts deleted file mode 100644 index 247bc363bf..0000000000 --- a/src/version3/models/projectRole.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { RoleActor } from './roleActor'; -import { Scope } from './scope'; - -/** Details about the roles in a project. */ -export interface ProjectRole { - /** The URL the project role details. */ - self?: string; - /** The name of the project role. */ - name?: string; - /** The ID of the project role. */ - id?: number; - /** The description of the project role. */ - description?: string; - /** The list of users who act in this role. */ - actors?: RoleActor[]; - scope?: Scope; - /** The translated name of the project role. */ - translatedName?: string; - /** Whether the calling user is part of this role. */ - currentUserRole?: boolean; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - /** Whether this role is the default role for the project */ - default?: boolean; -} diff --git a/src/version3/models/projectRoleActorsUpdate.ts b/src/version3/models/projectRoleActorsUpdate.mts similarity index 100% rename from src/version3/models/projectRoleActorsUpdate.ts rename to src/version3/models/projectRoleActorsUpdate.mts diff --git a/src/version3/models/projectRoleDetails.mts b/src/version3/models/projectRoleDetails.mts new file mode 100644 index 0000000000..66e584e461 --- /dev/null +++ b/src/version3/models/projectRoleDetails.mts @@ -0,0 +1,22 @@ +import type { Scope } from './scope.mjs'; + +/** Details about a project role. */ +export interface ProjectRoleDetails { + /** The URL the project role details. */ + self?: string; + /** The name of the project role. */ + name?: string; + /** The ID of the project role. */ + id?: number; + /** The description of the project role. */ + description?: string; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + scope?: Scope; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + /** The translated name of the project role. */ + translatedName?: string; + /** Whether this role is the default role for the project. */ + default?: boolean; +} diff --git a/src/version3/models/projectRoleDetails.ts b/src/version3/models/projectRoleDetails.ts deleted file mode 100644 index 2b42382288..0000000000 --- a/src/version3/models/projectRoleDetails.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Scope } from './scope'; - -/** Details about a project role. */ -export interface ProjectRoleDetails { - /** The URL the project role details. */ - self?: string; - /** The name of the project role. */ - name?: string; - /** The ID of the project role. */ - id?: number; - /** The description of the project role. */ - description?: string; - /** Whether this role is the admin role for the project. */ - admin?: boolean; - scope?: Scope; - /** Whether the roles are configurable for this project. */ - roleConfigurable?: boolean; - /** The translated name of the project role. */ - translatedName?: string; - /** Whether this role is the default role for the project. */ - default?: boolean; -} diff --git a/src/version3/models/projectRoleGroup.ts b/src/version3/models/projectRoleGroup.mts similarity index 100% rename from src/version3/models/projectRoleGroup.ts rename to src/version3/models/projectRoleGroup.mts diff --git a/src/version3/models/projectRoleUser.ts b/src/version3/models/projectRoleUser.mts similarity index 100% rename from src/version3/models/projectRoleUser.ts rename to src/version3/models/projectRoleUser.mts diff --git a/src/version3/models/projectScope.ts b/src/version3/models/projectScope.mts similarity index 100% rename from src/version3/models/projectScope.ts rename to src/version3/models/projectScope.mts diff --git a/src/version3/models/projectType.ts b/src/version3/models/projectType.mts similarity index 100% rename from src/version3/models/projectType.ts rename to src/version3/models/projectType.mts diff --git a/src/version3/models/propertyKey.ts b/src/version3/models/propertyKey.mts similarity index 100% rename from src/version3/models/propertyKey.ts rename to src/version3/models/propertyKey.mts diff --git a/src/version3/models/propertyKeys.mts b/src/version3/models/propertyKeys.mts new file mode 100644 index 0000000000..3db8a9493c --- /dev/null +++ b/src/version3/models/propertyKeys.mts @@ -0,0 +1,7 @@ +import type { PropertyKey } from './propertyKey.mjs'; + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} diff --git a/src/version3/models/propertyKeys.ts b/src/version3/models/propertyKeys.ts deleted file mode 100644 index f4e13a499e..0000000000 --- a/src/version3/models/propertyKeys.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { PropertyKey } from './propertyKey'; - -/** List of property keys. */ -export interface PropertyKeys { - /** Property key details. */ - keys?: PropertyKey[]; -} diff --git a/src/version3/models/publishedWorkflowId.ts b/src/version3/models/publishedWorkflowId.mts similarity index 100% rename from src/version3/models/publishedWorkflowId.ts rename to src/version3/models/publishedWorkflowId.mts diff --git a/src/version3/models/registeredWebhook.ts b/src/version3/models/registeredWebhook.mts similarity index 100% rename from src/version3/models/registeredWebhook.ts rename to src/version3/models/registeredWebhook.mts diff --git a/src/version3/models/remoteIssueLink.mts b/src/version3/models/remoteIssueLink.mts new file mode 100644 index 0000000000..89a472ec1a --- /dev/null +++ b/src/version3/models/remoteIssueLink.mts @@ -0,0 +1,16 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of an issue remote link. */ +export interface RemoteIssueLink { + /** The ID of the link. */ + id?: number; + /** The URL of the link. */ + self?: string; + /** The global ID of the link, such as the ID of the item on the remote system. */ + globalId?: string; + application?: Application; + /** Description of the relationship between the issue and the linked item. */ + relationship?: string; + object?: RemoteObject; +} diff --git a/src/version3/models/remoteIssueLink.ts b/src/version3/models/remoteIssueLink.ts deleted file mode 100644 index 362b92a6e2..0000000000 --- a/src/version3/models/remoteIssueLink.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Application } from './application'; -import { RemoteObject } from './remoteObject'; - -/** Details of an issue remote link. */ -export interface RemoteIssueLink { - /** The ID of the link. */ - id?: number; - /** The URL of the link. */ - self?: string; - /** The global ID of the link, such as the ID of the item on the remote system. */ - globalId?: string; - application?: Application; - /** Description of the relationship between the issue and the linked item. */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version3/models/remoteIssueLinkIdentifies.ts b/src/version3/models/remoteIssueLinkIdentifies.mts similarity index 100% rename from src/version3/models/remoteIssueLinkIdentifies.ts rename to src/version3/models/remoteIssueLinkIdentifies.mts diff --git a/src/version3/models/remoteIssueLinkRequest.mts b/src/version3/models/remoteIssueLinkRequest.mts new file mode 100644 index 0000000000..c12f620dda --- /dev/null +++ b/src/version3/models/remoteIssueLinkRequest.mts @@ -0,0 +1,23 @@ +import type { Application } from './application.mjs'; +import type { RemoteObject } from './remoteObject.mjs'; + +/** Details of a remote issue link. */ +export interface RemoteIssueLinkRequest { + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence + * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item + * details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId?: string; + application?: Application; + /** + * Description of the relationship between the issue and the linked item. If not set, the relationship description + * "links to" is used in Jira. + */ + relationship?: string; + object?: RemoteObject; +} diff --git a/src/version3/models/remoteIssueLinkRequest.ts b/src/version3/models/remoteIssueLinkRequest.ts deleted file mode 100644 index 71f47f2043..0000000000 --- a/src/version3/models/remoteIssueLinkRequest.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Application } from './application'; -import { RemoteObject } from './remoteObject'; - -/** Details of a remote issue link. */ -export interface RemoteIssueLinkRequest { - /** - * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence - * would consist of the app ID and page ID, like this: `appId=456&pageId=123`. - * - * Setting this field enables the remote issue link details to be updated or deleted using remote system and item - * details as the record identifier, rather than using the record's Jira ID. - * - * The maximum length is 255 characters. - */ - globalId?: string; - application?: Application; - /** - * Description of the relationship between the issue and the linked item. If not set, the relationship description - * "links to" is used in Jira. - */ - relationship?: string; - object?: RemoteObject; -} diff --git a/src/version3/models/remoteObject.mts b/src/version3/models/remoteObject.mts new file mode 100644 index 0000000000..c2a49b94a4 --- /dev/null +++ b/src/version3/models/remoteObject.mts @@ -0,0 +1,14 @@ +import type { Icon } from './icon.mjs'; +import type { Status } from './status.mjs'; + +/** The linked item. */ +export interface RemoteObject { + /** The URL of the item. */ + url: string; + /** The title of the item. */ + title: string; + /** The summary details of the item. */ + summary?: string; + icon?: Icon; + status?: Status; +} diff --git a/src/version3/models/remoteObject.ts b/src/version3/models/remoteObject.ts deleted file mode 100644 index be26a2abe2..0000000000 --- a/src/version3/models/remoteObject.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Icon } from './icon'; -import { Status } from './status'; - -/** The linked item. */ -export interface RemoteObject { - /** The URL of the item. */ - url: string; - /** The title of the item. */ - title: string; - /** The summary details of the item. */ - summary?: string; - icon?: Icon; - status?: Status; -} diff --git a/src/version3/models/removeOptionFromIssuesResult.mts b/src/version3/models/removeOptionFromIssuesResult.mts new file mode 100644 index 0000000000..e2f22f459e --- /dev/null +++ b/src/version3/models/removeOptionFromIssuesResult.mts @@ -0,0 +1,9 @@ +import type { SimpleErrorCollection } from './simpleErrorCollection.mjs'; + +export interface RemoveOptionFromIssuesResult { + /** The IDs of the modified issues. */ + modifiedIssues?: number[]; + /** The IDs of the unchanged issues, those issues where errors prevent modification. */ + unmodifiedIssues?: number[]; + errors?: SimpleErrorCollection; +} diff --git a/src/version3/models/removeOptionFromIssuesResult.ts b/src/version3/models/removeOptionFromIssuesResult.ts deleted file mode 100644 index 9331f4d676..0000000000 --- a/src/version3/models/removeOptionFromIssuesResult.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { SimpleErrorCollection } from './simpleErrorCollection'; - -export interface RemoveOptionFromIssuesResult { - /** The IDs of the modified issues. */ - modifiedIssues?: number[]; - /** The IDs of the unchanged issues, those issues where errors prevent modification. */ - unmodifiedIssues?: number[]; - errors?: SimpleErrorCollection; -} diff --git a/src/version3/models/reorderIssuePriorities.ts b/src/version3/models/reorderIssuePriorities.mts similarity index 100% rename from src/version3/models/reorderIssuePriorities.ts rename to src/version3/models/reorderIssuePriorities.mts diff --git a/src/version3/models/reorderIssueResolutionsRequest.ts b/src/version3/models/reorderIssueResolutionsRequest.mts similarity index 100% rename from src/version3/models/reorderIssueResolutionsRequest.ts rename to src/version3/models/reorderIssueResolutionsRequest.mts diff --git a/src/version3/models/resolution.ts b/src/version3/models/resolution.mts similarity index 100% rename from src/version3/models/resolution.ts rename to src/version3/models/resolution.mts diff --git a/src/version3/models/resolutionId.ts b/src/version3/models/resolutionId.mts similarity index 100% rename from src/version3/models/resolutionId.ts rename to src/version3/models/resolutionId.mts diff --git a/src/version3/models/restrictedPermission.ts b/src/version3/models/restrictedPermission.mts similarity index 100% rename from src/version3/models/restrictedPermission.ts rename to src/version3/models/restrictedPermission.mts diff --git a/src/version3/models/richText.ts b/src/version3/models/richText.mts similarity index 100% rename from src/version3/models/richText.ts rename to src/version3/models/richText.mts diff --git a/src/version3/models/roleActor.mts b/src/version3/models/roleActor.mts new file mode 100644 index 0000000000..84f2abbfb1 --- /dev/null +++ b/src/version3/models/roleActor.mts @@ -0,0 +1,25 @@ +import type { ProjectRoleGroup } from './projectRoleGroup.mjs'; +import type { ProjectRoleUser } from './projectRoleUser.mjs'; + +/** Details about a user assigned to a project role. */ +export interface RoleActor { + /** The ID of the role actor. */ + id?: number; + /** + * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an + * alternative value for the user's name. + */ + displayName?: string; + /** The type of role actor. */ + type?: 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. + */ + name?: string; + /** The avatar of the role actor. */ + avatarUrl?: string; + actorUser?: ProjectRoleUser; + actorGroup?: ProjectRoleGroup; +} diff --git a/src/version3/models/roleActor.ts b/src/version3/models/roleActor.ts deleted file mode 100644 index 8069252dc5..0000000000 --- a/src/version3/models/roleActor.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ProjectRoleGroup } from './projectRoleGroup'; -import { ProjectRoleUser } from './projectRoleUser'; - -/** Details about a user assigned to a project role. */ -export interface RoleActor { - /** The ID of the role actor. */ - id?: number; - /** - * The display name of the role actor. For users, depending on the user’s privacy setting, this may return an - * alternative value for the user's name. - */ - displayName?: string; - /** The type of role actor. */ - type?: 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. - */ - name?: string; - /** The avatar of the role actor. */ - avatarUrl?: string; - actorUser?: ProjectRoleUser; - actorGroup?: ProjectRoleGroup; -} diff --git a/src/version3/models/ruleConfiguration.ts b/src/version3/models/ruleConfiguration.mts similarity index 100% rename from src/version3/models/ruleConfiguration.ts rename to src/version3/models/ruleConfiguration.mts diff --git a/src/version3/models/sanitizedJqlQueries.mts b/src/version3/models/sanitizedJqlQueries.mts new file mode 100644 index 0000000000..462913b181 --- /dev/null +++ b/src/version3/models/sanitizedJqlQueries.mts @@ -0,0 +1,7 @@ +import type { SanitizedJqlQuery } from './sanitizedJqlQuery.mjs'; + +/** The sanitized Jql queries for the given account IDs. */ +export interface SanitizedJqlQueries { + /** The list of sanitized Jql queries. */ + queries?: SanitizedJqlQuery[]; +} diff --git a/src/version3/models/sanitizedJqlQueries.ts b/src/version3/models/sanitizedJqlQueries.ts deleted file mode 100644 index 94ca4c611c..0000000000 --- a/src/version3/models/sanitizedJqlQueries.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SanitizedJqlQuery } from './sanitizedJqlQuery'; - -/** The sanitized JQL queries for the given account IDs. */ -export interface SanitizedJqlQueries { - /** The list of sanitized JQL queries. */ - queries?: SanitizedJqlQuery[]; -} diff --git a/src/version3/models/sanitizedJqlQuery.mts b/src/version3/models/sanitizedJqlQuery.mts new file mode 100644 index 0000000000..70d6121d33 --- /dev/null +++ b/src/version3/models/sanitizedJqlQuery.mts @@ -0,0 +1,12 @@ +import type { ErrorCollection } from './errorCollection.mjs'; + +/** Details of the sanitized Jql query. */ +export interface SanitizedJqlQuery { + /** The initial query. */ + initialQuery?: string; + /** The sanitized query, if there were no errors. */ + sanitizedQuery?: string; + errors?: ErrorCollection; + /** The account ID of the user for whom sanitization was performed. */ + accountId?: string; +} diff --git a/src/version3/models/sanitizedJqlQuery.ts b/src/version3/models/sanitizedJqlQuery.ts deleted file mode 100644 index fe84f38438..0000000000 --- a/src/version3/models/sanitizedJqlQuery.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ErrorCollection } from './errorCollection'; - -/** Details of the sanitized JQL query. */ -export interface SanitizedJqlQuery { - /** The initial query. */ - initialQuery?: string; - /** The sanitized query, if there were no errors. */ - sanitizedQuery?: string; - errors?: ErrorCollection; - /** The account ID of the user for whom sanitization was performed. */ - accountId?: string; -} diff --git a/src/version3/models/scope.mts b/src/version3/models/scope.mts new file mode 100644 index 0000000000..3f7e248a87 --- /dev/null +++ b/src/version3/models/scope.mts @@ -0,0 +1,11 @@ +import type { ProjectDetails } from './projectDetails.mjs'; + +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + /** The type of scope. */ + type?: string; + project?: ProjectDetails; +} diff --git a/src/version3/models/scope.ts b/src/version3/models/scope.ts deleted file mode 100644 index 944ba58162..0000000000 --- a/src/version3/models/scope.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ProjectDetails } from './projectDetails'; - -/** - * The projects the item is associated with. Indicated for items associated with [next-gen - * projects](https://confluence.atlassian.com/x/loMyO). - */ -export interface Scope { - /** The type of scope. */ - type?: string; - project?: ProjectDetails; -} diff --git a/src/version3/models/screen.mts b/src/version3/models/screen.mts new file mode 100644 index 0000000000..3544aa4c74 --- /dev/null +++ b/src/version3/models/screen.mts @@ -0,0 +1,12 @@ +import type { Scope } from './scope.mjs'; + +/** A screen. */ +export interface Screen { + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + /** The description of the screen. */ + description?: string; + scope?: Scope; +} diff --git a/src/version3/models/screen.ts b/src/version3/models/screen.ts deleted file mode 100644 index 82c0d7211d..0000000000 --- a/src/version3/models/screen.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Scope } from './scope'; - -/** A screen. */ -export interface Screen { - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - /** The description of the screen. */ - description?: string; - scope?: Scope; -} diff --git a/src/version3/models/screenDetails.ts b/src/version3/models/screenDetails.mts similarity index 100% rename from src/version3/models/screenDetails.ts rename to src/version3/models/screenDetails.mts diff --git a/src/version3/models/screenID.ts b/src/version3/models/screenID.mts similarity index 100% rename from src/version3/models/screenID.ts rename to src/version3/models/screenID.mts diff --git a/src/version3/models/screenScheme.mts b/src/version3/models/screenScheme.mts new file mode 100644 index 0000000000..7cc890a47d --- /dev/null +++ b/src/version3/models/screenScheme.mts @@ -0,0 +1,14 @@ +import type { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme.mjs'; +import type { ScreenTypes } from './screenTypes.mjs'; + +/** A screen scheme. */ +export interface ScreenScheme { + /** The ID of the screen scheme. */ + id?: number; + /** The name of the screen scheme. */ + name?: string; + /** The description of the screen scheme. */ + description?: string; + screens?: ScreenTypes; + issueTypeScreenSchemes?: PageIssueTypeScreenScheme; +} diff --git a/src/version3/models/screenScheme.ts b/src/version3/models/screenScheme.ts deleted file mode 100644 index 3332909366..0000000000 --- a/src/version3/models/screenScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { PageIssueTypeScreenScheme } from './pageIssueTypeScreenScheme'; -import { ScreenTypes } from './screenTypes'; - -/** A screen scheme. */ -export interface ScreenScheme { - /** The ID of the screen scheme. */ - id?: number; - /** The name of the screen scheme. */ - name?: string; - /** The description of the screen scheme. */ - description?: string; - screens?: ScreenTypes; - issueTypeScreenSchemes?: PageIssueTypeScreenScheme; -} diff --git a/src/version3/models/screenSchemeDetails.mts b/src/version3/models/screenSchemeDetails.mts new file mode 100644 index 0000000000..4497b0d2fb --- /dev/null +++ b/src/version3/models/screenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { ScreenTypes } from './screenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface ScreenSchemeDetails { + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + screens?: ScreenTypes; +} diff --git a/src/version3/models/screenSchemeDetails.ts b/src/version3/models/screenSchemeDetails.ts deleted file mode 100644 index 7461ff0801..0000000000 --- a/src/version3/models/screenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ScreenTypes } from './screenTypes'; - -/** Details of a screen scheme. */ -export interface ScreenSchemeDetails { - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name: string; - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - screens?: ScreenTypes; -} diff --git a/src/version3/models/screenSchemeId.ts b/src/version3/models/screenSchemeId.mts similarity index 100% rename from src/version3/models/screenSchemeId.ts rename to src/version3/models/screenSchemeId.mts diff --git a/src/version3/models/screenTypes.ts b/src/version3/models/screenTypes.mts similarity index 100% rename from src/version3/models/screenTypes.ts rename to src/version3/models/screenTypes.mts diff --git a/src/version3/models/screenWithTab.mts b/src/version3/models/screenWithTab.mts new file mode 100644 index 0000000000..a274e5ae74 --- /dev/null +++ b/src/version3/models/screenWithTab.mts @@ -0,0 +1,14 @@ +import type { Scope } from './scope.mjs'; +import type { ScreenableTab } from './screenableTab.mjs'; + +/** A screen with tab details. */ +export interface ScreenWithTab { + /** The ID of the screen. */ + id?: number; + /** The name of the screen. */ + name?: string; + /** The description of the screen. */ + description?: string; + scope?: Scope; + tab?: ScreenableTab; +} diff --git a/src/version3/models/screenWithTab.ts b/src/version3/models/screenWithTab.ts deleted file mode 100644 index f39dab72d6..0000000000 --- a/src/version3/models/screenWithTab.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Scope } from './scope'; -import { ScreenableTab } from './screenableTab'; - -/** A screen with tab details. */ -export interface ScreenWithTab { - /** The ID of the screen. */ - id?: number; - /** The name of the screen. */ - name?: string; - /** The description of the screen. */ - description?: string; - scope?: Scope; - tab?: ScreenableTab; -} diff --git a/src/version3/models/screenableField.ts b/src/version3/models/screenableField.mts similarity index 100% rename from src/version3/models/screenableField.ts rename to src/version3/models/screenableField.mts diff --git a/src/version3/models/screenableTab.ts b/src/version3/models/screenableTab.mts similarity index 100% rename from src/version3/models/screenableTab.ts rename to src/version3/models/screenableTab.mts diff --git a/src/version3/models/searchAutoCompleteFilter.ts b/src/version3/models/searchAutoCompleteFilter.mts similarity index 100% rename from src/version3/models/searchAutoCompleteFilter.ts rename to src/version3/models/searchAutoCompleteFilter.mts diff --git a/src/version3/models/searchRequest.mts b/src/version3/models/searchRequest.mts new file mode 100644 index 0000000000..56ce441ad6 --- /dev/null +++ b/src/version3/models/searchRequest.mts @@ -0,0 +1,80 @@ +export interface SearchRequest { + /** A [Jql](https://confluence.atlassian.com/x/egORLQ) expression. */ + jql?: string; + /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ + startAt?: number; + /** The maximum number of items to return per page. */ + 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. 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?: string[]; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values: + * + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * The default is `strict`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: string; + /** + * Use [expand](em>#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' + | ( + | '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; +} diff --git a/src/version3/models/searchRequest.ts b/src/version3/models/searchRequest.ts deleted file mode 100644 index fd3fcf0e6f..0000000000 --- a/src/version3/models/searchRequest.ts +++ /dev/null @@ -1,80 +0,0 @@ -export interface SearchRequest { - /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ - jql?: string; - /** The index of the first item to return in the page of results (page offset). The base index is `0`. */ - startAt?: number; - /** The maximum number of items to return per page. */ - 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. 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?: string[]; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values: - * - * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * The default is `strict`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: string; - /** - * Use [expand](em>#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' - | ( - | '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; -} diff --git a/src/version3/models/searchResults.mts b/src/version3/models/searchResults.mts new file mode 100644 index 0000000000..54552e3722 --- /dev/null +++ b/src/version3/models/searchResults.mts @@ -0,0 +1,21 @@ +import type { Issue } from './issue.mjs'; + +/** The result of a Jql search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The number of results on the page. */ + total?: number; + /** The list of issues found by the search. */ + issues?: Issue[]; + /** Any warnings related to the Jql query. */ + warningMessages?: string[]; + /** The ID and name of each field in the search results. */ + names?: {}; + /** The schema describing the field types in the search results. */ + schema?: {}; +} diff --git a/src/version3/models/searchResults.ts b/src/version3/models/searchResults.ts deleted file mode 100644 index 49911301ed..0000000000 --- a/src/version3/models/searchResults.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Issue } from './issue'; - -/** The result of a JQL search. */ -export interface SearchResults { - /** Expand options that include additional search result details in the response. */ - expand?: string; - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; - /** The list of issues found by the search. */ - issues?: Issue[]; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; - /** The ID and name of each field in the search results. */ - names?: {}; - /** The schema describing the field types in the search results. */ - schema?: {}; -} diff --git a/src/version3/models/securityLevel.ts b/src/version3/models/securityLevel.mts similarity index 100% rename from src/version3/models/securityLevel.ts rename to src/version3/models/securityLevel.mts diff --git a/src/version3/models/securityLevelMember.mts b/src/version3/models/securityLevelMember.mts new file mode 100644 index 0000000000..f9723fbfb0 --- /dev/null +++ b/src/version3/models/securityLevelMember.mts @@ -0,0 +1,12 @@ +import type { PermissionHolder } from './permissionHolder.mjs'; + +/** Issue security level member. */ +export interface SecurityLevelMember { + holder?: PermissionHolder; + /** The ID of the issue security level member. */ + id: string; + /** The ID of the issue security level. */ + issueSecurityLevelId: string; + /** The ID of the issue security scheme. */ + issueSecuritySchemeId: string; +} diff --git a/src/version3/models/securityLevelMember.ts b/src/version3/models/securityLevelMember.ts deleted file mode 100644 index 4c2f05fc63..0000000000 --- a/src/version3/models/securityLevelMember.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { PermissionHolder } from './permissionHolder'; - -/** Issue security level member. */ -export interface SecurityLevelMember { - holder?: PermissionHolder; - /** The ID of the issue security level member. */ - id: string; - /** The ID of the issue security level. */ - issueSecurityLevelId: string; - /** The ID of the issue security scheme. */ - issueSecuritySchemeId: string; -} diff --git a/src/version3/models/securityScheme.mts b/src/version3/models/securityScheme.mts new file mode 100644 index 0000000000..1b77931eec --- /dev/null +++ b/src/version3/models/securityScheme.mts @@ -0,0 +1,16 @@ +import type { SecurityLevel } from './securityLevel.mjs'; + +/** Details about a security scheme. */ +export interface SecurityScheme { + /** The URL of the issue security scheme. */ + self?: string; + /** The ID of the issue security scheme. */ + id?: number; + /** The name of the issue security scheme. */ + name?: string; + /** The description of the issue security scheme. */ + description?: string; + /** The ID of the default security level. */ + defaultSecurityLevelId?: number; + levels?: SecurityLevel[]; +} diff --git a/src/version3/models/securityScheme.ts b/src/version3/models/securityScheme.ts deleted file mode 100644 index 2e744250f8..0000000000 --- a/src/version3/models/securityScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { SecurityLevel } from './securityLevel'; - -/** Details about a security scheme. */ -export interface SecurityScheme { - /** The URL of the issue security scheme. */ - self?: string; - /** The ID of the issue security scheme. */ - id?: number; - /** The name of the issue security scheme. */ - name?: string; - /** The description of the issue security scheme. */ - description?: string; - /** The ID of the default security level. */ - defaultSecurityLevelId?: number; - levels?: SecurityLevel[]; -} diff --git a/src/version3/models/securitySchemeId.ts b/src/version3/models/securitySchemeId.mts similarity index 100% rename from src/version3/models/securitySchemeId.ts rename to src/version3/models/securitySchemeId.mts diff --git a/src/version3/models/securitySchemeLevel.mts b/src/version3/models/securitySchemeLevel.mts new file mode 100644 index 0000000000..55f6505285 --- /dev/null +++ b/src/version3/models/securitySchemeLevel.mts @@ -0,0 +1,12 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +export interface SecuritySchemeLevel { + /** The description of the issue security scheme level. */ + description?: string; + /** Specifies whether the level is the default level. False by default. */ + isDefault?: boolean; + /** The list of level members which should be added to the issue security scheme level. */ + members?: SecuritySchemeLevelMember[]; + /** The name of the issue security scheme level. Must be unique. */ + name: string; +} diff --git a/src/version3/models/securitySchemeLevel.ts b/src/version3/models/securitySchemeLevel.ts deleted file mode 100644 index a1e5b28ac4..0000000000 --- a/src/version3/models/securitySchemeLevel.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { SecuritySchemeLevelMember } from './securitySchemeLevelMember'; - -export interface SecuritySchemeLevel { - /** The description of the issue security scheme level. */ - description?: string; - /** Specifies whether the level is the default level. False by default. */ - isDefault?: boolean; - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; - /** The name of the issue security scheme level. Must be unique. */ - name: string; -} diff --git a/src/version3/models/securitySchemeLevelMember.ts b/src/version3/models/securitySchemeLevelMember.mts similarity index 100% rename from src/version3/models/securitySchemeLevelMember.ts rename to src/version3/models/securitySchemeLevelMember.mts diff --git a/src/version3/models/securitySchemeMembersRequest.mts b/src/version3/models/securitySchemeMembersRequest.mts new file mode 100644 index 0000000000..d2ff6a1419 --- /dev/null +++ b/src/version3/models/securitySchemeMembersRequest.mts @@ -0,0 +1,7 @@ +import type { SecuritySchemeLevelMember } from './securitySchemeLevelMember.mjs'; + +/** Details of issue security scheme level new members. */ +export interface SecuritySchemeMembersRequest { + /** The list of level members which should be added to the issue security scheme level. */ + members?: SecuritySchemeLevelMember[]; +} diff --git a/src/version3/models/securitySchemeMembersRequest.ts b/src/version3/models/securitySchemeMembersRequest.ts deleted file mode 100644 index 0c8146b55c..0000000000 --- a/src/version3/models/securitySchemeMembersRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SecuritySchemeLevelMember } from './securitySchemeLevelMember'; - -/** Details of issue security scheme level new members. */ -export interface SecuritySchemeMembersRequest { - /** The list of level members which should be added to the issue security scheme level. */ - members?: SecuritySchemeLevelMember[]; -} diff --git a/src/version3/models/securitySchemeWithProjects.ts b/src/version3/models/securitySchemeWithProjects.mts similarity index 100% rename from src/version3/models/securitySchemeWithProjects.ts rename to src/version3/models/securitySchemeWithProjects.mts diff --git a/src/version3/models/securitySchemes.mts b/src/version3/models/securitySchemes.mts new file mode 100644 index 0000000000..cc5c5d77a1 --- /dev/null +++ b/src/version3/models/securitySchemes.mts @@ -0,0 +1,7 @@ +import type { SecurityScheme } from './securityScheme.mjs'; + +/** List of security schemes. */ +export interface SecuritySchemes { + /** List of security schemes. */ + issueSecuritySchemes?: SecurityScheme[]; +} diff --git a/src/version3/models/securitySchemes.ts b/src/version3/models/securitySchemes.ts deleted file mode 100644 index 2ee8c346cd..0000000000 --- a/src/version3/models/securitySchemes.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { SecurityScheme } from './securityScheme'; - -/** List of security schemes. */ -export interface SecuritySchemes { - /** List of security schemes. */ - issueSecuritySchemes?: SecurityScheme[]; -} diff --git a/src/version3/models/serverInformation.ts b/src/version3/models/serverInformation.mts similarity index 100% rename from src/version3/models/serverInformation.ts rename to src/version3/models/serverInformation.mts diff --git a/src/version3/models/setDefaultLevelsRequest.mts b/src/version3/models/setDefaultLevelsRequest.mts new file mode 100644 index 0000000000..9aeece50e4 --- /dev/null +++ b/src/version3/models/setDefaultLevelsRequest.mts @@ -0,0 +1,7 @@ +import type { DefaultLevelValue } from './defaultLevelValue.mjs'; + +/** Details of new default levels. */ +export interface SetDefaultLevelsRequest { + /** List of objects with issue security scheme ID and new default level ID. */ + defaultValues: DefaultLevelValue[]; +} diff --git a/src/version3/models/setDefaultLevelsRequest.ts b/src/version3/models/setDefaultLevelsRequest.ts deleted file mode 100644 index 64888b0ce6..0000000000 --- a/src/version3/models/setDefaultLevelsRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DefaultLevelValue } from './defaultLevelValue'; - -/** Details of new default levels. */ -export interface SetDefaultLevelsRequest { - /** List of objects with issue security scheme ID and new default level ID. */ - defaultValues: DefaultLevelValue[]; -} diff --git a/src/version3/models/setDefaultPriorityRequest.ts b/src/version3/models/setDefaultPriorityRequest.mts similarity index 100% rename from src/version3/models/setDefaultPriorityRequest.ts rename to src/version3/models/setDefaultPriorityRequest.mts diff --git a/src/version3/models/setDefaultResolutionRequest.ts b/src/version3/models/setDefaultResolutionRequest.mts similarity index 100% rename from src/version3/models/setDefaultResolutionRequest.ts rename to src/version3/models/setDefaultResolutionRequest.mts diff --git a/src/version3/models/sharePermission.mts b/src/version3/models/sharePermission.mts new file mode 100644 index 0000000000..07aae3a6f4 --- /dev/null +++ b/src/version3/models/sharePermission.mts @@ -0,0 +1,28 @@ +import type { DashboardUser } from './dashboardUser.mjs'; +import type { GroupName } from './groupName.mjs'; +import type { Project } from './project.mjs'; +import type { ProjectRole } from './projectRole.mjs'; + +/** Details of a share permission for the filter. */ +export interface SharePermission { + /** The unique identifier of the share permission. */ + id?: number; + /** + * The type of share permission: + * + * - `user` Shared with a user. + * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. + * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. + * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in + * requests, where it needs to be specify with `projectId` and `projectRoleId`. + * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. + * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as + * the `type`. + * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. + */ + type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; + project?: Project; + role?: ProjectRole; + group?: GroupName; + user?: DashboardUser; +} diff --git a/src/version3/models/sharePermission.ts b/src/version3/models/sharePermission.ts deleted file mode 100644 index 42b5e1002a..0000000000 --- a/src/version3/models/sharePermission.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { DashboardUser } from './dashboardUser'; -import { GroupName } from './groupName'; -import { Project } from './project'; -import { ProjectRole } from './projectRole'; - -/** Details of a share permission for the filter. */ -export interface SharePermission { - /** The unique identifier of the share permission. */ - id?: number; - /** - * The type of share permission: - * - * - `user` Shared with a user. - * - `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. - * - `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. - * - `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in - * requests, where it needs to be specify with `projectId` and `projectRoleId`. - * - `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. - * - `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as - * the `type`. - * - `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. - */ - type: 'user' | 'group' | 'project' | 'projectRole' | 'global' | 'loggedin' | 'project-unknown' | string; - project?: Project; - role?: ProjectRole; - group?: GroupName; - user?: DashboardUser; -} diff --git a/src/version3/models/sharePermissionInput.ts b/src/version3/models/sharePermissionInput.mts similarity index 100% rename from src/version3/models/sharePermissionInput.ts rename to src/version3/models/sharePermissionInput.mts diff --git a/src/version3/models/simpleApplicationProperty.ts b/src/version3/models/simpleApplicationProperty.mts similarity index 100% rename from src/version3/models/simpleApplicationProperty.ts rename to src/version3/models/simpleApplicationProperty.mts diff --git a/src/version3/models/simpleErrorCollection.ts b/src/version3/models/simpleErrorCollection.mts similarity index 100% rename from src/version3/models/simpleErrorCollection.ts rename to src/version3/models/simpleErrorCollection.mts diff --git a/src/version3/models/simpleLink.ts b/src/version3/models/simpleLink.mts similarity index 100% rename from src/version3/models/simpleLink.ts rename to src/version3/models/simpleLink.mts diff --git a/src/version3/models/simpleListWrapperApplicationRole.mts b/src/version3/models/simpleListWrapperApplicationRole.mts new file mode 100644 index 0000000000..4a7c24ae22 --- /dev/null +++ b/src/version3/models/simpleListWrapperApplicationRole.mts @@ -0,0 +1,10 @@ +import type { ApplicationRole } from './applicationRole.mjs'; +import type { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole.mjs'; + +export interface SimpleListWrapperApplicationRole { + size?: number; + items?: ApplicationRole[]; + pagingCallback?: ListWrapperCallbackApplicationRole; + callback?: ListWrapperCallbackApplicationRole; + 'max-results'?: number; +} diff --git a/src/version3/models/simpleListWrapperApplicationRole.ts b/src/version3/models/simpleListWrapperApplicationRole.ts deleted file mode 100644 index 0320fce728..0000000000 --- a/src/version3/models/simpleListWrapperApplicationRole.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ApplicationRole } from './applicationRole'; -import { ListWrapperCallbackApplicationRole } from './listWrapperCallbackApplicationRole'; - -export interface SimpleListWrapperApplicationRole { - size?: number; - items?: ApplicationRole[]; - pagingCallback?: ListWrapperCallbackApplicationRole; - callback?: ListWrapperCallbackApplicationRole; - 'max-results'?: number; -} diff --git a/src/version3/models/simpleListWrapperGroupName.mts b/src/version3/models/simpleListWrapperGroupName.mts new file mode 100644 index 0000000000..8da5e4edaf --- /dev/null +++ b/src/version3/models/simpleListWrapperGroupName.mts @@ -0,0 +1,10 @@ +import type { GroupName } from './groupName.mjs'; +import type { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName.mjs'; + +export interface SimpleListWrapperGroupName { + size?: number; + items?: GroupName[]; + pagingCallback?: ListWrapperCallbackGroupName; + callback?: ListWrapperCallbackGroupName; + 'max-results'?: number; +} diff --git a/src/version3/models/simpleListWrapperGroupName.ts b/src/version3/models/simpleListWrapperGroupName.ts deleted file mode 100644 index d8b4abc96f..0000000000 --- a/src/version3/models/simpleListWrapperGroupName.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GroupName } from './groupName'; -import { ListWrapperCallbackGroupName } from './listWrapperCallbackGroupName'; - -export interface SimpleListWrapperGroupName { - size?: number; - items?: GroupName[]; - pagingCallback?: ListWrapperCallbackGroupName; - callback?: ListWrapperCallbackGroupName; - 'max-results'?: number; -} diff --git a/src/version3/models/status.mts b/src/version3/models/status.mts new file mode 100644 index 0000000000..8e0abfcbc5 --- /dev/null +++ b/src/version3/models/status.mts @@ -0,0 +1,11 @@ +import type { Icon } from './icon.mjs'; + +/** The status of the item. */ +export interface Status { + /** + * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, + * otherwise the link displays in normal font. + */ + resolved?: boolean; + icon?: Icon; +} diff --git a/src/version3/models/status.ts b/src/version3/models/status.ts deleted file mode 100644 index feb6a52f14..0000000000 --- a/src/version3/models/status.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Icon } from './icon'; - -/** The status of the item. */ -export interface Status { - /** - * Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, - * otherwise the link displays in normal font. - */ - resolved?: boolean; - icon?: Icon; -} diff --git a/src/version3/models/statusCategory.ts b/src/version3/models/statusCategory.mts similarity index 100% rename from src/version3/models/statusCategory.ts rename to src/version3/models/statusCategory.mts diff --git a/src/version3/models/statusCreate.ts b/src/version3/models/statusCreate.mts similarity index 100% rename from src/version3/models/statusCreate.ts rename to src/version3/models/statusCreate.mts diff --git a/src/version3/models/statusCreateRequest.mts b/src/version3/models/statusCreateRequest.mts new file mode 100644 index 0000000000..c4418f5612 --- /dev/null +++ b/src/version3/models/statusCreateRequest.mts @@ -0,0 +1,9 @@ +import type { StatusCreate } from './statusCreate.mjs'; +import type { StatusScope } from './statusScope.mjs'; + +/** Details of the statuses being created and their scope. */ +export interface StatusCreateRequest { + /** Details of the statuses being created. */ + statuses: StatusCreate[]; + scope: StatusScope; +} diff --git a/src/version3/models/statusCreateRequest.ts b/src/version3/models/statusCreateRequest.ts deleted file mode 100644 index 05948a5bc7..0000000000 --- a/src/version3/models/statusCreateRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { StatusCreate } from './statusCreate'; -import { StatusScope } from './statusScope'; - -/** Details of the statuses being created and their scope. */ -export interface StatusCreateRequest { - /** Details of the statuses being created. */ - statuses: StatusCreate[]; - scope: StatusScope; -} diff --git a/src/version3/models/statusDetails.mts b/src/version3/models/statusDetails.mts new file mode 100644 index 0000000000..affd80d616 --- /dev/null +++ b/src/version3/models/statusDetails.mts @@ -0,0 +1,16 @@ +import type { StatusCategory } from './statusCategory.mjs'; + +/** A status. */ +export interface StatusDetails { + /** The URL of the status. */ + self?: string; + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The name of the status. */ + name?: string; + /** The ID of the status. */ + id?: string; + statusCategory?: StatusCategory; +} diff --git a/src/version3/models/statusDetails.ts b/src/version3/models/statusDetails.ts deleted file mode 100644 index cff803cfad..0000000000 --- a/src/version3/models/statusDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { StatusCategory } from './statusCategory'; - -/** A status. */ -export interface StatusDetails { - /** The URL of the status. */ - self?: string; - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The name of the status. */ - name?: string; - /** The ID of the status. */ - id?: string; - statusCategory?: StatusCategory; -} diff --git a/src/version3/models/statusMapping.ts b/src/version3/models/statusMapping.mts similarity index 100% rename from src/version3/models/statusMapping.ts rename to src/version3/models/statusMapping.mts diff --git a/src/version3/models/statusScope.mts b/src/version3/models/statusScope.mts new file mode 100644 index 0000000000..8b1eca6645 --- /dev/null +++ b/src/version3/models/statusScope.mts @@ -0,0 +1,8 @@ +import type { ProjectId } from './projectId.mjs'; + +/** The scope of the status. */ +export interface StatusScope { + /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: string; + project?: ProjectId; +} diff --git a/src/version3/models/statusScope.ts b/src/version3/models/statusScope.ts deleted file mode 100644 index 00007de4ef..0000000000 --- a/src/version3/models/statusScope.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectId } from './projectId'; - -/** The scope of the status. */ -export interface StatusScope { - /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ - type: string; - project?: ProjectId; -} diff --git a/src/version3/models/statusUpdate.ts b/src/version3/models/statusUpdate.mts similarity index 100% rename from src/version3/models/statusUpdate.ts rename to src/version3/models/statusUpdate.mts diff --git a/src/version3/models/statusUpdateRequest.mts b/src/version3/models/statusUpdateRequest.mts new file mode 100644 index 0000000000..2ae0c2697a --- /dev/null +++ b/src/version3/models/statusUpdateRequest.mts @@ -0,0 +1,7 @@ +import type { StatusUpdate } from './statusUpdate.mjs'; + +/** The list of statuses that will be updated. */ +export interface StatusUpdateRequest { + /** The list of statuses that will be updated. */ + statuses?: StatusUpdate[]; +} diff --git a/src/version3/models/statusUpdateRequest.ts b/src/version3/models/statusUpdateRequest.ts deleted file mode 100644 index d68fbf12d4..0000000000 --- a/src/version3/models/statusUpdateRequest.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { StatusUpdate } from './statusUpdate'; - -/** The list of statuses that will be updated. */ -export interface StatusUpdateRequest { - /** The list of statuses that will be updated. */ - statuses?: StatusUpdate[]; -} diff --git a/src/version3/models/suggestedIssue.ts b/src/version3/models/suggestedIssue.mts similarity index 100% rename from src/version3/models/suggestedIssue.ts rename to src/version3/models/suggestedIssue.mts diff --git a/src/version3/models/systemAvatars.mts b/src/version3/models/systemAvatars.mts new file mode 100644 index 0000000000..7984cb58a8 --- /dev/null +++ b/src/version3/models/systemAvatars.mts @@ -0,0 +1,7 @@ +import type { Avatar } from './avatar.mjs'; + +/** List of system avatars. */ +export interface SystemAvatars { + /** A list of avatar details. */ + system?: Avatar[]; +} diff --git a/src/version3/models/systemAvatars.ts b/src/version3/models/systemAvatars.ts deleted file mode 100644 index b7a72d47f9..0000000000 --- a/src/version3/models/systemAvatars.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Avatar } from './avatar'; - -/** List of system avatars. */ -export interface SystemAvatars { - /** A list of avatar details. */ - system?: Avatar[]; -} diff --git a/src/version3/models/taskProgressObject.ts b/src/version3/models/taskProgressObject.mts similarity index 100% rename from src/version3/models/taskProgressObject.ts rename to src/version3/models/taskProgressObject.mts diff --git a/src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts b/src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts new file mode 100644 index 0000000000..72fe897ff4 --- /dev/null +++ b/src/version3/models/taskProgressRemoveOptionFromIssuesResult.mts @@ -0,0 +1,30 @@ +import type { RemoveOptionFromIssuesResult } from './removeOptionFromIssuesResult.mjs'; + +/** Details about a task. */ +export interface TaskProgressRemoveOptionFromIssuesResult { + /** The URL of the task. */ + self: string; + /** The ID of the task. */ + id: string; + /** The description of the task. */ + description?: string; + /** The status of the task. */ + status: string; + /** Information about the progress of the task. */ + message?: string; + result?: RemoveOptionFromIssuesResult; + /** The ID of the user who submitted the task. */ + submittedBy: number; + /** The progress of the task, as a percentage complete. */ + progress: number; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** A timestamp recording when the task was started. */ + started?: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; +} diff --git a/src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts b/src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts deleted file mode 100644 index a154fb2629..0000000000 --- a/src/version3/models/taskProgressRemoveOptionFromIssuesResult.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { RemoveOptionFromIssuesResult } from './removeOptionFromIssuesResult'; - -/** Details about a task. */ -export interface TaskProgressRemoveOptionFromIssuesResult { - /** The URL of the task. */ - self: string; - /** The ID of the task. */ - id: string; - /** The description of the task. */ - description?: string; - /** The status of the task. */ - status: string; - /** Information about the progress of the task. */ - message?: string; - result?: RemoveOptionFromIssuesResult; - /** The ID of the user who submitted the task. */ - submittedBy: number; - /** The progress of the task, as a percentage complete. */ - progress: number; - /** The execution time of the task, in milliseconds. */ - elapsedRuntime: number; - /** A timestamp recording when the task was submitted. */ - submitted: number; - /** A timestamp recording when the task was started. */ - started?: number; - /** A timestamp recording when the task was finished. */ - finished?: number; - /** A timestamp recording when the task progress was last updated. */ - lastUpdate: number; -} diff --git a/src/version3/models/timeTrackingConfiguration.ts b/src/version3/models/timeTrackingConfiguration.mts similarity index 100% rename from src/version3/models/timeTrackingConfiguration.ts rename to src/version3/models/timeTrackingConfiguration.mts diff --git a/src/version3/models/timeTrackingDetails.ts b/src/version3/models/timeTrackingDetails.mts similarity index 100% rename from src/version3/models/timeTrackingDetails.ts rename to src/version3/models/timeTrackingDetails.mts diff --git a/src/version3/models/timeTrackingProvider.ts b/src/version3/models/timeTrackingProvider.mts similarity index 100% rename from src/version3/models/timeTrackingProvider.ts rename to src/version3/models/timeTrackingProvider.mts diff --git a/src/version3/models/transition.mts b/src/version3/models/transition.mts new file mode 100644 index 0000000000..a8215dcaa0 --- /dev/null +++ b/src/version3/models/transition.mts @@ -0,0 +1,22 @@ +import { ScreenID } from './screenID.mjs'; +import type { WorkflowRules } from './workflowRules.mjs'; + +/** Details of a workflow transition. */ +export interface Transition { + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The description of the transition. */ + description: string; + /** The statuses the transition can start from. */ + from: string[]; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: string; + screen?: ScreenID; + rules?: WorkflowRules; + /** The properties of the transition. */ + properties?: {}; +} diff --git a/src/version3/models/transition.ts b/src/version3/models/transition.ts deleted file mode 100644 index d8396a74c4..0000000000 --- a/src/version3/models/transition.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { ScreenID } from './screenID'; -import { WorkflowRules } from './workflowRules'; - -/** Details of a workflow transition. */ -export interface Transition { - /** The ID of the transition. */ - id: string; - /** The name of the transition. */ - name: string; - /** The description of the transition. */ - description: string; - /** The statuses the transition can start from. */ - from: string[]; - /** The status the transition goes to. */ - to: string; - /** The type of the transition. */ - type: string; - screen?: ScreenID; - rules?: WorkflowRules; - /** The properties of the transition. */ - properties?: {}; -} diff --git a/src/version3/models/transitions.mts b/src/version3/models/transitions.mts new file mode 100644 index 0000000000..58362e7767 --- /dev/null +++ b/src/version3/models/transitions.mts @@ -0,0 +1,9 @@ +import type { IssueTransition } from './issueTransition.mjs'; + +/** List of issue transitions. */ +export interface Transitions { + /** Expand options that include additional transitions details in the response. */ + expand?: string; + /** List of issue transitions. */ + transitions?: IssueTransition[]; +} diff --git a/src/version3/models/transitions.ts b/src/version3/models/transitions.ts deleted file mode 100644 index 1423f0d5a8..0000000000 --- a/src/version3/models/transitions.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IssueTransition } from './issueTransition'; - -/** List of issue transitions. */ -export interface Transitions { - /** Expand options that include additional transitions details in the response. */ - expand?: string; - /** List of issue transitions. */ - transitions?: IssueTransition[]; -} diff --git a/src/version3/models/uiModificationContextDetails.ts b/src/version3/models/uiModificationContextDetails.mts similarity index 100% rename from src/version3/models/uiModificationContextDetails.ts rename to src/version3/models/uiModificationContextDetails.mts diff --git a/src/version3/models/uiModificationDetails.mts b/src/version3/models/uiModificationDetails.mts new file mode 100644 index 0000000000..f422718c91 --- /dev/null +++ b/src/version3/models/uiModificationDetails.mts @@ -0,0 +1,17 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UiModificationDetails { + /** The ID of the UI modification. */ + id: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The URL of the UI modification. */ + self: string; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; +} diff --git a/src/version3/models/uiModificationDetails.ts b/src/version3/models/uiModificationDetails.ts deleted file mode 100644 index 62abda4603..0000000000 --- a/src/version3/models/uiModificationDetails.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface UiModificationDetails { - /** The ID of the UI modification. */ - id: string; - /** The name of the UI modification. The maximum length is 255 characters. */ - name: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The URL of the UI modification. */ - self: string; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ - contexts?: UiModificationContextDetails[]; -} diff --git a/src/version3/models/uiModificationIdentifiers.ts b/src/version3/models/uiModificationIdentifiers.mts similarity index 100% rename from src/version3/models/uiModificationIdentifiers.ts rename to src/version3/models/uiModificationIdentifiers.mts diff --git a/src/version3/models/unrestrictedUserEmail.ts b/src/version3/models/unrestrictedUserEmail.mts similarity index 100% rename from src/version3/models/unrestrictedUserEmail.ts rename to src/version3/models/unrestrictedUserEmail.mts diff --git a/src/version3/models/updateCustomFieldDetails.ts b/src/version3/models/updateCustomFieldDetails.mts similarity index 100% rename from src/version3/models/updateCustomFieldDetails.ts rename to src/version3/models/updateCustomFieldDetails.mts diff --git a/src/version3/models/updateFieldConfigurationSchemeDetails.ts b/src/version3/models/updateFieldConfigurationSchemeDetails.mts similarity index 100% rename from src/version3/models/updateFieldConfigurationSchemeDetails.ts rename to src/version3/models/updateFieldConfigurationSchemeDetails.mts diff --git a/src/version3/models/updateIssueSecurityLevelDetails.ts b/src/version3/models/updateIssueSecurityLevelDetails.mts similarity index 100% rename from src/version3/models/updateIssueSecurityLevelDetails.ts rename to src/version3/models/updateIssueSecurityLevelDetails.mts diff --git a/src/version3/models/updateIssueSecuritySchemeRequest.ts b/src/version3/models/updateIssueSecuritySchemeRequest.mts similarity index 100% rename from src/version3/models/updateIssueSecuritySchemeRequest.ts rename to src/version3/models/updateIssueSecuritySchemeRequest.mts diff --git a/src/version3/models/updateNotificationSchemeDetails.ts b/src/version3/models/updateNotificationSchemeDetails.mts similarity index 100% rename from src/version3/models/updateNotificationSchemeDetails.ts rename to src/version3/models/updateNotificationSchemeDetails.mts diff --git a/src/version3/models/updatePriorityDetails.ts b/src/version3/models/updatePriorityDetails.mts similarity index 100% rename from src/version3/models/updatePriorityDetails.ts rename to src/version3/models/updatePriorityDetails.mts diff --git a/src/version3/models/updateProjectDetails.ts b/src/version3/models/updateProjectDetails.mts similarity index 100% rename from src/version3/models/updateProjectDetails.ts rename to src/version3/models/updateProjectDetails.mts diff --git a/src/version3/models/updateResolutionDetails.ts b/src/version3/models/updateResolutionDetails.mts similarity index 100% rename from src/version3/models/updateResolutionDetails.ts rename to src/version3/models/updateResolutionDetails.mts diff --git a/src/version3/models/updateScreenDetails.ts b/src/version3/models/updateScreenDetails.mts similarity index 100% rename from src/version3/models/updateScreenDetails.ts rename to src/version3/models/updateScreenDetails.mts diff --git a/src/version3/models/updateScreenSchemeDetails.mts b/src/version3/models/updateScreenSchemeDetails.mts new file mode 100644 index 0000000000..336d94fb7a --- /dev/null +++ b/src/version3/models/updateScreenSchemeDetails.mts @@ -0,0 +1,10 @@ +import type { UpdateScreenTypes } from './updateScreenTypes.mjs'; + +/** Details of a screen scheme. */ +export interface UpdateScreenSchemeDetails { + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + screens?: UpdateScreenTypes; +} diff --git a/src/version3/models/updateScreenSchemeDetails.ts b/src/version3/models/updateScreenSchemeDetails.ts deleted file mode 100644 index ab5320e13c..0000000000 --- a/src/version3/models/updateScreenSchemeDetails.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { UpdateScreenTypes } from './updateScreenTypes'; - -/** Details of a screen scheme. */ -export interface UpdateScreenSchemeDetails { - /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ - name?: string; - /** The description of the screen scheme. The maximum length is 255 characters. */ - description?: string; - screens?: UpdateScreenTypes; -} diff --git a/src/version3/models/updateScreenTypes.ts b/src/version3/models/updateScreenTypes.mts similarity index 100% rename from src/version3/models/updateScreenTypes.ts rename to src/version3/models/updateScreenTypes.mts diff --git a/src/version3/models/updateUiModificationDetails.mts b/src/version3/models/updateUiModificationDetails.mts new file mode 100644 index 0000000000..1ea7cc5901 --- /dev/null +++ b/src/version3/models/updateUiModificationDetails.mts @@ -0,0 +1,16 @@ +import type { UiModificationContextDetails } from './uiModificationContextDetails.mjs'; + +/** The details of a UI modification. */ +export interface UpdateUiModificationDetails { + /** The name of the UI modification. The maximum length is 255 characters. */ + name?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** + * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing + * contexts. + */ + contexts?: UiModificationContextDetails[]; +} diff --git a/src/version3/models/updateUiModificationDetails.ts b/src/version3/models/updateUiModificationDetails.ts deleted file mode 100644 index 3df4eb860b..0000000000 --- a/src/version3/models/updateUiModificationDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { UiModificationContextDetails } from './uiModificationContextDetails'; - -/** The details of a UI modification. */ -export interface UpdateUiModificationDetails { - /** The name of the UI modification. The maximum length is 255 characters. */ - name?: string; - /** The description of the UI modification. The maximum length is 255 characters. */ - description?: string; - /** The data of the UI modification. The maximum size of the data is 50000 characters. */ - data?: string; - /** - * List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing - * contexts. - */ - contexts?: UiModificationContextDetails[]; -} diff --git a/src/version3/models/updateUserToGroup.ts b/src/version3/models/updateUserToGroup.mts similarity index 100% rename from src/version3/models/updateUserToGroup.ts rename to src/version3/models/updateUserToGroup.mts diff --git a/src/version3/models/updatedProjectCategory.ts b/src/version3/models/updatedProjectCategory.mts similarity index 100% rename from src/version3/models/updatedProjectCategory.ts rename to src/version3/models/updatedProjectCategory.mts diff --git a/src/version3/models/user.mts b/src/version3/models/user.mts new file mode 100644 index 0000000000..8bbbe22b5f --- /dev/null +++ b/src/version3/models/user.mts @@ -0,0 +1,62 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; +import type { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole.mjs'; +import type { SimpleListWrapperGroupName } from './simpleListWrapperGroupName.mjs'; + +/** + * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these + * exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface User { + /** The URL of the user. */ + self?: 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. + */ + key?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. + */ + accountId: string; + /** + * The user account type. Can take the following values: + * + * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to + * represent external systems `customer` Jira Service Desk account representing an external service desk + */ + accountType?: 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. + */ + name?: string; + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress?: string; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active: boolean; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as + * null. + */ + timeZone?: string; + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale?: string; + groups?: SimpleListWrapperGroupName; + applicationRoles?: SimpleListWrapperApplicationRole; + /** Expand options that include additional user details in the response. */ + expand?: string; +} diff --git a/src/version3/models/user.ts b/src/version3/models/user.ts deleted file mode 100644 index f5e4ae012c..0000000000 --- a/src/version3/models/user.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; -import { SimpleListWrapperApplicationRole } from './simpleListWrapperApplicationRole'; -import { SimpleListWrapperGroupName } from './simpleListWrapperGroupName'; - -/** - * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these - * exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface User { - /** The URL of the user. */ - self?: 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. - */ - key?: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. Required in requests. - */ - accountId: string; - /** - * The user account type. Can take the following values: - * - * `atlassian` regular Atlassian user account `app` system account used for Connect applications and OAuth to - * represent external systems `customer` Jira Service Desk account representing an external service desk - */ - accountType?: 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. - */ - name?: string; - /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ - emailAddress?: string; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active: boolean; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as - * null. - */ - timeZone?: string; - /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ - locale?: string; - groups?: SimpleListWrapperGroupName; - applicationRoles?: SimpleListWrapperApplicationRole; - /** Expand options that include additional user details in the response. */ - expand?: string; -} diff --git a/src/version3/models/userAvatarUrls.ts b/src/version3/models/userAvatarUrls.mts similarity index 100% rename from src/version3/models/userAvatarUrls.ts rename to src/version3/models/userAvatarUrls.mts diff --git a/src/version3/models/userDetails.mts b/src/version3/models/userDetails.mts new file mode 100644 index 0000000000..5537a8b923 --- /dev/null +++ b/src/version3/models/userDetails.mts @@ -0,0 +1,51 @@ +import type { AvatarUrls } from './avatarUrls.mjs'; + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* + * + * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, + * `displayName` provides an indication and other parameters have default values or are blank (for example, email is + * blank). + * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted + * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. + * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have + * fallback values. + */ +export interface UserDetails { + /** The URL of the user. */ + self?: 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. + */ + name?: 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. + */ + key?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. + */ + accountId?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** Whether the user is active. */ + active?: boolean; + /** + * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as + * null. + */ + timeZone?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; +} diff --git a/src/version3/models/userDetails.ts b/src/version3/models/userDetails.ts deleted file mode 100644 index bcc42c2042..0000000000 --- a/src/version3/models/userDetails.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AvatarUrls } from './avatarUrls'; - -/** - * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions:* - * - * - User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, - * `displayName` provides an indication and other parameters have default values or are blank (for example, email is - * blank). - * - User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted - * users. In this case, `accountId` returns _unknown_ and all other parameters have fallback values. - * - User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have - * fallback values. - */ -export interface UserDetails { - /** The URL of the user. */ - self?: 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. - */ - name?: 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. - */ - key?: string; - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. - */ - accountId?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - avatarUrls?: AvatarUrls; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; - /** - * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as - * null. - */ - timeZone?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; -} diff --git a/src/version3/models/userKey.ts b/src/version3/models/userKey.mts similarity index 100% rename from src/version3/models/userKey.ts rename to src/version3/models/userKey.mts diff --git a/src/version3/models/userList.mts b/src/version3/models/userList.mts new file mode 100644 index 0000000000..43771e38b1 --- /dev/null +++ b/src/version3/models/userList.mts @@ -0,0 +1,18 @@ +import { User } from './user.mjs'; + +/** + * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the + * projects that the filter is shared with. + */ +export interface UserList { + /** The number of items on the page. */ + size?: number; + /** The list of items. */ + items?: User[]; + /** The maximum number of results that could be on the page. */ + 'max-results'?: number; + /** The index of the first item returned on the page. */ + 'start-index'?: number; + /** The index of the last item returned on the page. */ + 'end-index'?: number; +} diff --git a/src/version3/models/userList.ts b/src/version3/models/userList.ts deleted file mode 100644 index 772b28b9fb..0000000000 --- a/src/version3/models/userList.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { User } from './user'; - -/** - * A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the - * projects that the filter is shared with. - */ -export interface UserList { - /** The number of items on the page. */ - size?: number; - /** The list of items. */ - items?: User[]; - /** The maximum number of results that could be on the page. */ - 'max-results'?: number; - /** The index of the first item returned on the page. */ - 'start-index'?: number; - /** The index of the last item returned on the page. */ - 'end-index'?: number; -} diff --git a/src/version3/models/userMigration.ts b/src/version3/models/userMigration.mts similarity index 100% rename from src/version3/models/userMigration.ts rename to src/version3/models/userMigration.mts diff --git a/src/version3/models/userPickerUser.ts b/src/version3/models/userPickerUser.mts similarity index 100% rename from src/version3/models/userPickerUser.ts rename to src/version3/models/userPickerUser.mts diff --git a/src/version3/models/version.mts b/src/version3/models/version.mts new file mode 100644 index 0000000000..51a35835b5 --- /dev/null +++ b/src/version3/models/version.mts @@ -0,0 +1,70 @@ +import type { SimpleLink } from './simpleLink.mjs'; +import type { VersionIssuesStatus } from './versionIssuesStatus.mjs'; + +/** Details about a project version. */ +export interface Version { + /** + * 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_. + * + * Optional for create and update. + */ + expand?: string; + /** The URL of the 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. + */ + released?: boolean; + /** + * 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. + */ + moveUnfixedIssuesTo?: string; + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations?: SimpleLink[]; + issuesStatusForFixVersion?: VersionIssuesStatus; +} diff --git a/src/version3/models/version.ts b/src/version3/models/version.ts deleted file mode 100644 index fd618aefd7..0000000000 --- a/src/version3/models/version.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { SimpleLink } from './simpleLink'; -import { VersionIssuesStatus } from './versionIssuesStatus'; - -/** Details about a project version. */ -export interface Version { - /** - * 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_. - * - * Optional for create and update. - */ - expand?: string; - /** The URL of the 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. - */ - released?: boolean; - /** - * 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. - */ - moveUnfixedIssuesTo?: string; - /** If the expand option `operations` is used, returns the list of operations available for this version. */ - operations?: SimpleLink[]; - issuesStatusForFixVersion?: VersionIssuesStatus; -} diff --git a/src/version3/models/versionIssueCounts.mts b/src/version3/models/versionIssueCounts.mts new file mode 100644 index 0000000000..1dfc89f958 --- /dev/null +++ b/src/version3/models/versionIssueCounts.mts @@ -0,0 +1,15 @@ +import { VersionUsageInCustomField } from './versionUsageInCustomField.mjs'; + +/** Various counts of issues within a version. */ +export interface VersionIssueCounts { + /** The URL of these count details. */ + self?: string; + /** Count of issues where the `fixVersion` is set to the version. */ + issuesFixedCount?: number; + /** Count of issues where the `affectedVersion` is set to the version. */ + issuesAffectedCount?: number; + /** Count of issues where a version custom field is set to the version. */ + issueCountWithCustomFieldsShowingVersion?: number; + /** List of custom fields using the version. */ + customFieldUsage?: VersionUsageInCustomField[]; +} diff --git a/src/version3/models/versionIssueCounts.ts b/src/version3/models/versionIssueCounts.ts deleted file mode 100644 index 2510a6bac0..0000000000 --- a/src/version3/models/versionIssueCounts.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { VersionUsageInCustomField } from './versionUsageInCustomField'; - -/** Various counts of issues within a version. */ -export interface VersionIssueCounts { - /** The URL of these count details. */ - self?: string; - /** Count of issues where the `fixVersion` is set to the version. */ - issuesFixedCount?: number; - /** Count of issues where the `affectedVersion` is set to the version. */ - issuesAffectedCount?: number; - /** Count of issues where a version custom field is set to the version. */ - issueCountWithCustomFieldsShowingVersion?: number; - /** List of custom fields using the version. */ - customFieldUsage?: VersionUsageInCustomField[]; -} diff --git a/src/version3/models/versionIssuesStatus.ts b/src/version3/models/versionIssuesStatus.mts similarity index 100% rename from src/version3/models/versionIssuesStatus.ts rename to src/version3/models/versionIssuesStatus.mts diff --git a/src/version3/models/versionMove.ts b/src/version3/models/versionMove.mts similarity index 100% rename from src/version3/models/versionMove.ts rename to src/version3/models/versionMove.mts diff --git a/src/version3/models/versionUnresolvedIssuesCount.ts b/src/version3/models/versionUnresolvedIssuesCount.mts similarity index 100% rename from src/version3/models/versionUnresolvedIssuesCount.ts rename to src/version3/models/versionUnresolvedIssuesCount.mts diff --git a/src/version3/models/versionUsageInCustomField.ts b/src/version3/models/versionUsageInCustomField.mts similarity index 100% rename from src/version3/models/versionUsageInCustomField.ts rename to src/version3/models/versionUsageInCustomField.mts diff --git a/src/version3/models/visibility.ts b/src/version3/models/visibility.mts similarity index 100% rename from src/version3/models/visibility.ts rename to src/version3/models/visibility.mts diff --git a/src/version3/models/votes.mts b/src/version3/models/votes.mts new file mode 100644 index 0000000000..f371f1135d --- /dev/null +++ b/src/version3/models/votes.mts @@ -0,0 +1,16 @@ +import { User } from './user.mjs'; + +/** The details of votes on an issue. */ +export interface Votes { + /** The URL of these issue vote details. */ + self: string; + /** The number of votes on the issue. */ + votes: number; + /** Whether the user making this request has voted on the issue. */ + hasVoted: boolean; + /** + * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the + * _View voters and watchers_ project permission. + */ + voters: User[]; +} diff --git a/src/version3/models/votes.ts b/src/version3/models/votes.ts deleted file mode 100644 index 6ebda28733..0000000000 --- a/src/version3/models/votes.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { User } from './user'; - -/** The details of votes on an issue. */ -export interface Votes { - /** The URL of these issue vote details. */ - self: string; - /** The number of votes on the issue. */ - votes: number; - /** Whether the user making this request has voted on the issue. */ - hasVoted: boolean; - /** - * List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the - * _View voters and watchers_ project permission. - */ - voters: User[]; -} diff --git a/src/version3/models/watchers.mts b/src/version3/models/watchers.mts new file mode 100644 index 0000000000..7c6c137de3 --- /dev/null +++ b/src/version3/models/watchers.mts @@ -0,0 +1,13 @@ +import { UserDetails } from './userDetails.mjs'; + +/** The details of watchers on an issue. */ +export interface Watchers { + /** The URL of these issue watcher details. */ + self?: string; + /** Whether the calling user is watching this issue. */ + isWatching?: boolean; + /** The number of users watching this issue. */ + watchCount?: number; + /** Details of the users watching this issue. */ + watchers?: UserDetails[]; +} diff --git a/src/version3/models/watchers.ts b/src/version3/models/watchers.ts deleted file mode 100644 index 282914a9b2..0000000000 --- a/src/version3/models/watchers.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { UserDetails } from './userDetails'; - -/** The details of watchers on an issue. */ -export interface Watchers { - /** The URL of these issue watcher details. */ - self?: string; - /** Whether the calling user is watching this issue. */ - isWatching?: boolean; - /** The number of users watching this issue. */ - watchCount?: number; - /** Details of the users watching this issue. */ - watchers?: UserDetails[]; -} diff --git a/src/version3/models/webhook.mts b/src/version3/models/webhook.mts new file mode 100644 index 0000000000..1f4380f3d0 --- /dev/null +++ b/src/version3/models/webhook.mts @@ -0,0 +1,26 @@ +/** A webhook. */ +export interface Webhook { + /** The ID of the webhook. */ + id: number; + /** The Jql filter that specifies which issues the webhook is sent for. */ + jqlFilter: string; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** The Jira events that trigger the 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) + * to extend the date. + */ + expirationDate?: number; +} diff --git a/src/version3/models/webhook.ts b/src/version3/models/webhook.ts deleted file mode 100644 index 68bcbcfd18..0000000000 --- a/src/version3/models/webhook.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** A webhook. */ -export interface Webhook { - /** The ID of the webhook. */ - id: number; - /** The JQL filter that specifies which issues the webhook is sent for. */ - jqlFilter: string; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The Jira events that trigger the 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) - * to extend the date. - */ - expirationDate?: number; -} diff --git a/src/version3/models/webhookDetails.mts b/src/version3/models/webhookDetails.mts new file mode 100644 index 0000000000..78ffca0093 --- /dev/null +++ b/src/version3/models/webhookDetails.mts @@ -0,0 +1,25 @@ +/** A list of webhooks. */ +export interface WebhookDetails { + /** + * The Jql filter that specifies which issues the webhook is sent for. Only a subset of Jql can be used. The supported + * elements are: + * + * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For + * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT + * IN`. + */ + jqlFilter: string; + /** + * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. + * If this parameter is not present, the app is notified about all field updates. + */ + fieldIdsFilter?: string[]; + /** + * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or + * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property + * updates. + */ + issuePropertyKeysFilter?: string[]; + /** The Jira events that trigger the webhook. */ + events: string[]; +} diff --git a/src/version3/models/webhookDetails.ts b/src/version3/models/webhookDetails.ts deleted file mode 100644 index 651f7d4f2e..0000000000 --- a/src/version3/models/webhookDetails.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** A list of webhooks. */ -export interface WebhookDetails { - /** - * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported - * elements are: - * - * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For - * custom fields (`cf[id]`), only the epic label custom field is supported.". Operators: `=`, `!=`, `IN`, and `NOT - * IN`. - */ - jqlFilter: string; - /** - * A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. - * If this parameter is not present, the app is notified about all field updates. - */ - fieldIdsFilter?: string[]; - /** - * A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or - * `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property - * updates. - */ - issuePropertyKeysFilter?: string[]; - /** The Jira events that trigger the webhook. */ - events: string[]; -} diff --git a/src/version3/models/webhookRegistrationDetails.mts b/src/version3/models/webhookRegistrationDetails.mts new file mode 100644 index 0000000000..a0f186fa6e --- /dev/null +++ b/src/version3/models/webhookRegistrationDetails.mts @@ -0,0 +1,12 @@ +import { WebhookDetails } from './webhookDetails.mjs'; + +/** Details of webhooks to register. */ +export interface WebhookRegistrationDetails { + /** A list of webhooks. */ + webhooks: WebhookDetails[]; + /** + * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a + * single URL per app is allowed to be registered. + */ + url: string; +} diff --git a/src/version3/models/webhookRegistrationDetails.ts b/src/version3/models/webhookRegistrationDetails.ts deleted file mode 100644 index 5cd0672740..0000000000 --- a/src/version3/models/webhookRegistrationDetails.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { WebhookDetails } from './webhookDetails'; - -/** Details of webhooks to register. */ -export interface WebhookRegistrationDetails { - /** A list of webhooks. */ - webhooks: WebhookDetails[]; - /** - * The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a - * single URL per app is allowed to be registered. - */ - url: string; -} diff --git a/src/version3/models/webhooksExpirationDate.ts b/src/version3/models/webhooksExpirationDate.mts similarity index 100% rename from src/version3/models/webhooksExpirationDate.ts rename to src/version3/models/webhooksExpirationDate.mts diff --git a/src/version3/models/workflow.mts b/src/version3/models/workflow.mts new file mode 100644 index 0000000000..c1c331599c --- /dev/null +++ b/src/version3/models/workflow.mts @@ -0,0 +1,30 @@ +import type { ProjectDetails } from './projectDetails.mjs'; +import type { PublishedWorkflowId } from './publishedWorkflowId.mjs'; +import type { Transition } from './transition.mjs'; +import type { WorkflowOperations } from './workflowOperations.mjs'; +import type { WorkflowSchemeIdName } from './workflowSchemeIdName.mjs'; +import type { WorkflowStatus } from './workflowStatus.mjs'; + +/** Details about a workflow. */ +export interface Workflow { + id: PublishedWorkflowId; + /** The description of the workflow. */ + description: string; + /** The transitions of the workflow. */ + transitions?: Transition[]; + /** The statuses of the workflow. */ + statuses?: WorkflowStatus[]; + /** Whether this is the default workflow. */ + isDefault?: boolean; + /** The workflow schemes the workflow is assigned to. */ + schemes?: WorkflowSchemeIdName[]; + /** The projects the workflow is assigned to, through workflow schemes. */ + projects?: ProjectDetails[]; + /** Whether the workflow has a draft version. */ + hasDraftWorkflow?: boolean; + operations?: WorkflowOperations; + /** The creation date of the workflow. */ + created?: string; + /** The last edited date of the workflow. */ + updated?: string; +} diff --git a/src/version3/models/workflow.ts b/src/version3/models/workflow.ts deleted file mode 100644 index 741cf819e8..0000000000 --- a/src/version3/models/workflow.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { ProjectDetails } from './projectDetails'; -import { PublishedWorkflowId } from './publishedWorkflowId'; -import { Transition } from './transition'; -import { WorkflowOperations } from './workflowOperations'; -import { WorkflowSchemeIdName } from './workflowSchemeIdName'; -import { WorkflowStatus } from './workflowStatus'; - -/** Details about a workflow. */ -export interface Workflow { - id: PublishedWorkflowId; - /** The description of the workflow. */ - description: string; - /** The transitions of the workflow. */ - transitions?: Transition[]; - /** The statuses of the workflow. */ - statuses?: WorkflowStatus[]; - /** Whether this is the default workflow. */ - isDefault?: boolean; - /** The workflow schemes the workflow is assigned to. */ - schemes?: WorkflowSchemeIdName[]; - /** The projects the workflow is assigned to, through workflow schemes. */ - projects?: ProjectDetails[]; - /** Whether the workflow has a draft version. */ - hasDraftWorkflow?: boolean; - operations?: WorkflowOperations; - /** The creation date of the workflow. */ - created?: string; - /** The last edited date of the workflow. */ - updated?: string; -} diff --git a/src/version3/models/workflowCondition.ts b/src/version3/models/workflowCondition.mts similarity index 100% rename from src/version3/models/workflowCondition.ts rename to src/version3/models/workflowCondition.mts diff --git a/src/version3/models/workflowId.ts b/src/version3/models/workflowId.mts similarity index 100% rename from src/version3/models/workflowId.ts rename to src/version3/models/workflowId.mts diff --git a/src/version3/models/workflowOperations.ts b/src/version3/models/workflowOperations.mts similarity index 100% rename from src/version3/models/workflowOperations.ts rename to src/version3/models/workflowOperations.mts diff --git a/src/version3/models/workflowRules.mts b/src/version3/models/workflowRules.mts new file mode 100644 index 0000000000..14e3c31ffb --- /dev/null +++ b/src/version3/models/workflowRules.mts @@ -0,0 +1,11 @@ +import type { WorkflowCondition } from './workflowCondition.mjs'; +import type { WorkflowTransitionRule } from './workflowTransitionRule.mjs'; + +/** A collection of transition rules. */ +export interface WorkflowRules { + conditionsTree?: WorkflowCondition; + /** The workflow validators. */ + validators?: WorkflowTransitionRule[]; + /** The workflow post functions. */ + postFunctions?: WorkflowTransitionRule[]; +} diff --git a/src/version3/models/workflowRules.ts b/src/version3/models/workflowRules.ts deleted file mode 100644 index 8aab255146..0000000000 --- a/src/version3/models/workflowRules.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { WorkflowCondition } from './workflowCondition'; -import { WorkflowTransitionRule } from './workflowTransitionRule'; - -/** A collection of transition rules. */ -export interface WorkflowRules { - conditionsTree?: WorkflowCondition; - /** The workflow validators. */ - validators?: WorkflowTransitionRule[]; - /** The workflow post functions. */ - postFunctions?: WorkflowTransitionRule[]; -} diff --git a/src/version3/models/workflowRulesSearch.ts b/src/version3/models/workflowRulesSearch.mts similarity index 100% rename from src/version3/models/workflowRulesSearch.ts rename to src/version3/models/workflowRulesSearch.mts diff --git a/src/version3/models/workflowRulesSearchDetails.mts b/src/version3/models/workflowRulesSearchDetails.mts new file mode 100644 index 0000000000..9f7047a954 --- /dev/null +++ b/src/version3/models/workflowRulesSearchDetails.mts @@ -0,0 +1,11 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details of workflow transition rules. */ +export interface WorkflowRulesSearchDetails { + /** The workflow ID. */ + workflowEntityId?: string; + /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ + invalidRules?: string[]; + /** List of valid workflow transition rules. */ + validRules?: WorkflowTransitionRules[]; +} diff --git a/src/version3/models/workflowRulesSearchDetails.ts b/src/version3/models/workflowRulesSearchDetails.ts deleted file mode 100644 index 882a2e1d3b..0000000000 --- a/src/version3/models/workflowRulesSearchDetails.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** Details of workflow transition rules. */ -export interface WorkflowRulesSearchDetails { - /** The workflow ID. */ - workflowEntityId?: string; - /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ - invalidRules?: string[]; - /** List of valid workflow transition rules. */ - validRules?: WorkflowTransitionRules[]; -} diff --git a/src/version3/models/workflowScheme.mts b/src/version3/models/workflowScheme.mts new file mode 100644 index 0000000000..e85842d67e --- /dev/null +++ b/src/version3/models/workflowScheme.mts @@ -0,0 +1,61 @@ +import type { User } from './user.mjs'; + +/** Details about a workflow scheme. */ +export interface WorkflowScheme { + /** The ID of the workflow scheme. */ + id?: number; + /** + * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when + * creating a workflow scheme. + */ + name?: string; + /** The description of the workflow scheme. */ + description?: string; + /** + * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ + * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira + * Workflow (jira)_. + */ + defaultWorkflow?: string; + /** + * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an + * issue type can only be mapped to one workflow in a workflow scheme. + */ + issueTypeMappings?: {}; + /** + * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The + * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. + */ + originalDefaultWorkflow?: string; + /** + * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, + * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one + * workflow in a workflow scheme. + */ + originalIssueTypeMappings?: {}; + /** Whether the workflow scheme is a draft or not. */ + draft?: boolean; + lastModifiedUser?: User; + /** + * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue + * type-project mappings only. This property does not apply to non-draft workflows. + */ + lastModified?: string; + self?: string; + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow + * scheme is a workflow scheme that is used by at least one project. The following examples show how this property + * works: + * + * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is + * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` + * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow + * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do + * not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + /** The issue types available in Jira. */ + issueTypes?: {}; +} diff --git a/src/version3/models/workflowScheme.ts b/src/version3/models/workflowScheme.ts deleted file mode 100644 index da6497af8d..0000000000 --- a/src/version3/models/workflowScheme.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { User } from './user'; - -/** Details about a workflow scheme. */ -export interface WorkflowScheme { - /** The ID of the workflow scheme. */ - id?: number; - /** - * The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when - * creating a workflow scheme. - */ - name?: string; - /** The description of the workflow scheme. */ - description?: string; - /** - * The name of the default workflow for the workflow scheme. The default workflow has _All Unassigned Issue Types_ - * assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to _Jira - * Workflow (jira)_. - */ - defaultWorkflow?: string; - /** - * The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an - * issue type can only be mapped to one workflow in a workflow scheme. - */ - issueTypeMappings?: {}; - /** - * For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The - * default workflow has _All Unassigned Issue Types_ assigned to it in Jira. - */ - originalDefaultWorkflow?: string; - /** - * For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, - * where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one - * workflow in a workflow scheme. - */ - originalIssueTypeMappings?: {}; - /** Whether the workflow scheme is a draft or not. */ - draft?: boolean; - lastModifiedUser?: User; - /** - * The date-time that the draft workflow scheme was last modified. A modification is a change to the issue - * type-project mappings only. This property does not apply to non-draft workflows. - */ - lastModified?: string; - self?: string; - /** - * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow - * scheme is a workflow scheme that is used by at least one project. The following examples show how this property - * works: - * - * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is - * updated. Otherwise, a draft workflow scheme is created. Update an active workflow scheme with `updateDraftIfNeeded` - * set to `false`: An error is returned, as active workflow schemes cannot be updated. Update an inactive workflow - * scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do - * not require drafts to update. - * - * Defaults to `false`. - */ - updateDraftIfNeeded?: boolean; - /** The issue types available in Jira. */ - issueTypes?: {}; -} diff --git a/src/version3/models/workflowSchemeAssociations.mts b/src/version3/models/workflowSchemeAssociations.mts new file mode 100644 index 0000000000..b14453a234 --- /dev/null +++ b/src/version3/models/workflowSchemeAssociations.mts @@ -0,0 +1,8 @@ +import type { WorkflowScheme } from './workflowScheme.mjs'; + +/** A workflow scheme along with a list of projects that use it. */ +export interface WorkflowSchemeAssociations { + /** The list of projects that use the workflow scheme. */ + projectIds: string[]; + workflowScheme?: WorkflowScheme; +} diff --git a/src/version3/models/workflowSchemeAssociations.ts b/src/version3/models/workflowSchemeAssociations.ts deleted file mode 100644 index ac253e98ac..0000000000 --- a/src/version3/models/workflowSchemeAssociations.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { WorkflowScheme } from './workflowScheme'; - -/** A workflow scheme along with a list of projects that use it. */ -export interface WorkflowSchemeAssociations { - /** The list of projects that use the workflow scheme. */ - projectIds: string[]; - workflowScheme?: WorkflowScheme; -} diff --git a/src/version3/models/workflowSchemeIdName.ts b/src/version3/models/workflowSchemeIdName.mts similarity index 100% rename from src/version3/models/workflowSchemeIdName.ts rename to src/version3/models/workflowSchemeIdName.mts diff --git a/src/version3/models/workflowSchemeProjectAssociation.ts b/src/version3/models/workflowSchemeProjectAssociation.mts similarity index 100% rename from src/version3/models/workflowSchemeProjectAssociation.ts rename to src/version3/models/workflowSchemeProjectAssociation.mts diff --git a/src/version3/models/workflowStatus.mts b/src/version3/models/workflowStatus.mts new file mode 100644 index 0000000000..7fb2acdc10 --- /dev/null +++ b/src/version3/models/workflowStatus.mts @@ -0,0 +1,14 @@ +import type { WorkflowStatusProperties } from './workflowStatusProperties.mjs'; + +/** Details of a workflow status. */ +export interface WorkflowStatus { + /** The ID of the issue status. */ + id: string; + /** The name of the status in the workflow. */ + name: string; + /** + * Additional properties that modify the behavior of issues in this status. Supports the properties + * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. + */ + properties?: WorkflowStatusProperties; +} diff --git a/src/version3/models/workflowStatus.ts b/src/version3/models/workflowStatus.ts deleted file mode 100644 index 64b93bff11..0000000000 --- a/src/version3/models/workflowStatus.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { WorkflowStatusProperties } from './workflowStatusProperties'; - -/** Details of a workflow status. */ -export interface WorkflowStatus { - /** The ID of the issue status. */ - id: string; - /** The name of the status in the workflow. */ - name: string; - /** - * Additional properties that modify the behavior of issues in this status. Supports the properties - * `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. - */ - properties?: WorkflowStatusProperties; -} diff --git a/src/version3/models/workflowStatusProperties.ts b/src/version3/models/workflowStatusProperties.mts similarity index 100% rename from src/version3/models/workflowStatusProperties.ts rename to src/version3/models/workflowStatusProperties.mts diff --git a/src/version3/models/workflowTransition.ts b/src/version3/models/workflowTransition.mts similarity index 100% rename from src/version3/models/workflowTransition.ts rename to src/version3/models/workflowTransition.mts diff --git a/src/version3/models/workflowTransitionProperty.ts b/src/version3/models/workflowTransitionProperty.mts similarity index 100% rename from src/version3/models/workflowTransitionProperty.ts rename to src/version3/models/workflowTransitionProperty.mts diff --git a/src/version3/models/workflowTransitionRule.ts b/src/version3/models/workflowTransitionRule.mts similarity index 100% rename from src/version3/models/workflowTransitionRule.ts rename to src/version3/models/workflowTransitionRule.mts diff --git a/src/version3/models/workflowTransitionRules.mts b/src/version3/models/workflowTransitionRules.mts new file mode 100644 index 0000000000..c5b98f0ed0 --- /dev/null +++ b/src/version3/models/workflowTransitionRules.mts @@ -0,0 +1,13 @@ +import type { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule.mjs'; +import type { WorkflowId } from './workflowId.mjs'; + +/** A workflow with transition rules. */ +export interface WorkflowTransitionRules { + workflowId: WorkflowId; + /** The list of post functions within the workflow. */ + postFunctions: ConnectWorkflowTransitionRule[]; + /** The list of conditions within the workflow. */ + conditions: ConnectWorkflowTransitionRule[]; + /** The list of validators within the workflow. */ + validators: ConnectWorkflowTransitionRule[]; +} diff --git a/src/version3/models/workflowTransitionRules.ts b/src/version3/models/workflowTransitionRules.ts deleted file mode 100644 index 88bb365a28..0000000000 --- a/src/version3/models/workflowTransitionRules.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ConnectWorkflowTransitionRule } from './connectWorkflowTransitionRule'; -import { WorkflowId } from './workflowId'; - -/** A workflow with transition rules. */ -export interface WorkflowTransitionRules { - workflowId: WorkflowId; - /** The list of post functions within the workflow. */ - postFunctions: ConnectWorkflowTransitionRule[]; - /** The list of conditions within the workflow. */ - conditions: ConnectWorkflowTransitionRule[]; - /** The list of validators within the workflow. */ - validators: ConnectWorkflowTransitionRule[]; -} diff --git a/src/version3/models/workflowTransitionRulesDetails.mts b/src/version3/models/workflowTransitionRulesDetails.mts new file mode 100644 index 0000000000..c92a7dc6ba --- /dev/null +++ b/src/version3/models/workflowTransitionRulesDetails.mts @@ -0,0 +1,8 @@ +import type { WorkflowId } from './workflowId.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesDetails { + workflowId: WorkflowId; + /** The list of connect workflow rule IDs. */ + workflowRuleIds: string[]; +} diff --git a/src/version3/models/workflowTransitionRulesDetails.ts b/src/version3/models/workflowTransitionRulesDetails.ts deleted file mode 100644 index d09ad9f96f..0000000000 --- a/src/version3/models/workflowTransitionRulesDetails.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { WorkflowId } from './workflowId'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesDetails { - workflowId: WorkflowId; - /** The list of connect workflow rule IDs. */ - workflowRuleIds: string[]; -} diff --git a/src/version3/models/workflowTransitionRulesUpdate.mts b/src/version3/models/workflowTransitionRulesUpdate.mts new file mode 100644 index 0000000000..882da8d8a2 --- /dev/null +++ b/src/version3/models/workflowTransitionRulesUpdate.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRules } from './workflowTransitionRules.mjs'; + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesUpdate { + /** The list of workflows with transition rules to update. */ + workflows: WorkflowTransitionRules[]; +} diff --git a/src/version3/models/workflowTransitionRulesUpdate.ts b/src/version3/models/workflowTransitionRulesUpdate.ts deleted file mode 100644 index 376e0aa354..0000000000 --- a/src/version3/models/workflowTransitionRulesUpdate.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowTransitionRules } from './workflowTransitionRules'; - -/** Details about a workflow configuration update request. */ -export interface WorkflowTransitionRulesUpdate { - /** The list of workflows with transition rules to update. */ - workflows: WorkflowTransitionRules[]; -} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts b/src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts new file mode 100644 index 0000000000..c08db0576f --- /dev/null +++ b/src/version3/models/workflowTransitionRulesUpdateErrorDetails.mts @@ -0,0 +1,16 @@ +import type { WorkflowId } from './workflowId.mjs'; + +/** Details of any errors encountered while updating workflow transition rules for a workflow. */ +export interface WorkflowTransitionRulesUpdateErrorDetails { + workflowId: WorkflowId; + /** + * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here + * wasn't updated. + */ + ruleUpdateErrors: {}; + /** + * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains + * any entries. + */ + updateErrors: string[]; +} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts b/src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts deleted file mode 100644 index c3c2e1b683..0000000000 --- a/src/version3/models/workflowTransitionRulesUpdateErrorDetails.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { WorkflowId } from './workflowId'; - -/** Details of any errors encountered while updating workflow transition rules for a workflow. */ -export interface WorkflowTransitionRulesUpdateErrorDetails { - workflowId: WorkflowId; - /** - * A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here - * wasn't updated. - */ - ruleUpdateErrors: {}; - /** - * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains - * any entries. - */ - updateErrors: string[]; -} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrors.mts b/src/version3/models/workflowTransitionRulesUpdateErrors.mts new file mode 100644 index 0000000000..e4e188dcd1 --- /dev/null +++ b/src/version3/models/workflowTransitionRulesUpdateErrors.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails.mjs'; + +/** Details of any errors encountered while updating workflow transition rules. */ +export interface WorkflowTransitionRulesUpdateErrors { + /** A list of workflows. */ + updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; +} diff --git a/src/version3/models/workflowTransitionRulesUpdateErrors.ts b/src/version3/models/workflowTransitionRulesUpdateErrors.ts deleted file mode 100644 index 4e5c6ce38a..0000000000 --- a/src/version3/models/workflowTransitionRulesUpdateErrors.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowTransitionRulesUpdateErrorDetails } from './workflowTransitionRulesUpdateErrorDetails'; - -/** Details of any errors encountered while updating workflow transition rules. */ -export interface WorkflowTransitionRulesUpdateErrors { - /** A list of workflows. */ - updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; -} diff --git a/src/version3/models/workflowsWithTransitionRulesDetails.mts b/src/version3/models/workflowsWithTransitionRulesDetails.mts new file mode 100644 index 0000000000..2cded9b478 --- /dev/null +++ b/src/version3/models/workflowsWithTransitionRulesDetails.mts @@ -0,0 +1,7 @@ +import type { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails.mjs'; + +/** Details of workflows and their transition rules to delete. */ +export interface WorkflowsWithTransitionRulesDetails { + /** The list of workflows with transition rules to delete. */ + workflows: WorkflowTransitionRulesDetails[]; +} diff --git a/src/version3/models/workflowsWithTransitionRulesDetails.ts b/src/version3/models/workflowsWithTransitionRulesDetails.ts deleted file mode 100644 index b038041dda..0000000000 --- a/src/version3/models/workflowsWithTransitionRulesDetails.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { WorkflowTransitionRulesDetails } from './workflowTransitionRulesDetails'; - -/** Details of workflows and their transition rules to delete. */ -export interface WorkflowsWithTransitionRulesDetails { - /** The list of workflows with transition rules to delete. */ - workflows: WorkflowTransitionRulesDetails[]; -} diff --git a/src/version3/models/worklog.mts b/src/version3/models/worklog.mts new file mode 100644 index 0000000000..3a2eae6817 --- /dev/null +++ b/src/version3/models/worklog.mts @@ -0,0 +1,45 @@ +import type { Document } from './document.mjs'; +import type { EntityProperty } from './entityProperty.mjs'; +import type { UserDetails } from './userDetails.mjs'; +import type { Visibility } from './visibility.mjs'; + +/** Details of a worklog. */ +export interface Worklog { + /** The URL of the worklog item. */ + self?: string; + author?: UserDetails; + updateAuthor?: UserDetails; + /** + * A comment about the worklog in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or + * updating a worklog. + */ + comment?: Document; + /** The datetime on which the worklog was created. */ + created?: string; + /** The datetime on which the worklog was last updated. */ + updated?: string; + visibility?: Visibility; + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a + * worklog. + */ + started?: string; + /** + * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a + * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if + * `timeSpentSecond` is provided. + */ + timeSpent?: string; + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. + * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + */ + timeSpentSeconds?: number; + /** The ID of the worklog record. */ + id?: string; + /** The ID of the issue this worklog is for. */ + issueId?: string; + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties?: EntityProperty[]; +} diff --git a/src/version3/models/worklog.ts b/src/version3/models/worklog.ts deleted file mode 100644 index ccdae4a13c..0000000000 --- a/src/version3/models/worklog.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Document } from './document'; -import { EntityProperty } from './entityProperty'; -import { UserDetails } from './userDetails'; -import { Visibility } from './visibility'; - -/** Details of a worklog. */ -export interface Worklog { - /** The URL of the worklog item. */ - self?: string; - author?: UserDetails; - updateAuthor?: UserDetails; - /** - * A comment about the worklog in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or - * updating a worklog. - */ - comment?: Document; - /** The datetime on which the worklog was created. */ - created?: string; - /** The datetime on which the worklog was last updated. */ - updated?: string; - visibility?: Visibility; - /** - * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a - * worklog. - */ - started?: string; - /** - * The time spent working on the issue as days (#d), hours (#h), or minutes (#m or #). Required when creating a - * worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if - * `timeSpentSecond` is provided. - */ - timeSpent?: string; - /** - * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. - * Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. - */ - timeSpentSeconds?: number; - /** The ID of the worklog record. */ - id?: string; - /** The ID of the issue this worklog is for. */ - issueId?: string; - /** Details of properties for the worklog. Optional when creating or updating a worklog. */ - properties?: EntityProperty[]; -} diff --git a/src/version3/models/worklogIdsRequest.ts b/src/version3/models/worklogIdsRequest.mts similarity index 100% rename from src/version3/models/worklogIdsRequest.ts rename to src/version3/models/worklogIdsRequest.mts diff --git a/src/version3/myself.mts b/src/version3/myself.mts new file mode 100644 index 0000000000..4f2d1412be --- /dev/null +++ b/src/version3/myself.mts @@ -0,0 +1,230 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Myself { + constructor(private client: Client) {} + + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; + /** + * Returns the value of a preference of the current user. + * + * Note that these keys are deprecated: + * + * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the + * instance. + * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the + * instance. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; + async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences', + method: 'GET', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * 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. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; + /** + * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, + * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the + * 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. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; + async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences', + method: 'PUT', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; + /** + * Deletes a preference of the user, which restores the default value of system defined settings. + * + * 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. + * + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; + async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences', + method: 'DELETE', + params: { + key: parameters.key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLocale(callback: Callback): Promise; + /** + * Returns the locale for the user. + * + * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, + * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header + * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getLocale(callback?: never): Promise; + async getLocale(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypreferences/locale', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser( + parameters: Parameters.GetCurrentUser | undefined, + callback: Callback, + ): Promise; + /** + * Returns details for the current user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; + async getCurrentUser( + parameters?: Parameters.GetCurrentUser, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/myself', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/myself.ts b/src/version3/myself.ts deleted file mode 100644 index c7b333331f..0000000000 --- a/src/version3/myself.ts +++ /dev/null @@ -1,230 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Myself { - constructor(private client: Client) {} - - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback: Callback): Promise; - /** - * Returns the value of a preference of the current user. - * - * Note that these keys are deprecated: - * - * - _jira.user.locale_ The locale of the user. By default this is not set and the user takes the locale of the - * instance. - * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the - * instance. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPreference(parameters: Parameters.GetPreference, callback?: never): Promise; - async getPreference(parameters: Parameters.GetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences', - method: 'GET', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * 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. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback: Callback): Promise; - /** - * Creates a preference for the user or updates a preference's value by sending a plain text string. For example, - * `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the - * 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. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async setPreference(parameters: Parameters.SetPreference, callback?: never): Promise; - async setPreference(parameters: Parameters.SetPreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences', - method: 'PUT', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback: Callback): Promise; - /** - * Deletes a preference of the user, which restores the default value of system defined settings. - * - * 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. - * - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async removePreference(parameters: Parameters.RemovePreference, callback?: never): Promise; - async removePreference(parameters: Parameters.RemovePreference, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences', - method: 'DELETE', - params: { - key: parameters.key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLocale(callback: Callback): Promise; - /** - * Returns the locale for the user. - * - * If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, - * the browser locale detected by Jira is returned. Jira detects the browser locale using the _Accept-Language_ header - * in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getLocale(callback?: never): Promise; - async getLocale(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypreferences/locale', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser( - parameters: Parameters.GetCurrentUser | undefined, - callback: Callback, - ): Promise; - /** - * Returns details for the current user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getCurrentUser(parameters?: Parameters.GetCurrentUser, callback?: never): Promise; - async getCurrentUser( - parameters?: Parameters.GetCurrentUser, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/myself', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/parameters/addActorUsers.mts b/src/version3/parameters/addActorUsers.mts new file mode 100644 index 0000000000..7b8d3ff68c --- /dev/null +++ b/src/version3/parameters/addActorUsers.mts @@ -0,0 +1,11 @@ +import { ActorsMap } from '../models/index.mjs'; + +export interface AddActorUsers extends ActorsMap { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * 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. + */ + id: number; +} diff --git a/src/version3/parameters/addActorUsers.ts b/src/version3/parameters/addActorUsers.ts deleted file mode 100644 index 7126621c61..0000000000 --- a/src/version3/parameters/addActorUsers.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ActorsMap } from '../models'; - -export interface AddActorUsers extends ActorsMap { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * 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. - */ - id: number; -} diff --git a/src/version3/parameters/addAttachment.ts b/src/version3/parameters/addAttachment.mts similarity index 100% rename from src/version3/parameters/addAttachment.ts rename to src/version3/parameters/addAttachment.mts diff --git a/src/version3/parameters/addComment.mts b/src/version3/parameters/addComment.mts new file mode 100644 index 0000000000..7bda4f15d9 --- /dev/null +++ b/src/version3/parameters/addComment.mts @@ -0,0 +1,17 @@ +import { Comment, Document } from '../models/index.mjs'; + +export interface AddComment extends Omit { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: string; + /** + * The comment text in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). + */ + comment?: string | Document; +} diff --git a/src/version3/parameters/addComment.ts b/src/version3/parameters/addComment.ts deleted file mode 100644 index 2aadf316e7..0000000000 --- a/src/version3/parameters/addComment.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Comment, Document } from '../models'; - -export interface AddComment extends Omit { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: string; - /** - * The comment text in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). - */ - comment?: string | Document; -} diff --git a/src/version3/parameters/addFieldToDefaultScreen.ts b/src/version3/parameters/addFieldToDefaultScreen.mts similarity index 100% rename from src/version3/parameters/addFieldToDefaultScreen.ts rename to src/version3/parameters/addFieldToDefaultScreen.mts diff --git a/src/version3/parameters/addGadget.mts b/src/version3/parameters/addGadget.mts new file mode 100644 index 0000000000..52cfa03f8c --- /dev/null +++ b/src/version3/parameters/addGadget.mts @@ -0,0 +1,6 @@ +import { DashboardGadgetSettings } from '../models/index.mjs'; + +export interface AddGadget extends DashboardGadgetSettings { + /** The ID of the dashboard. */ + dashboardId: number; +} diff --git a/src/version3/parameters/addGadget.ts b/src/version3/parameters/addGadget.ts deleted file mode 100644 index dd161fea1f..0000000000 --- a/src/version3/parameters/addGadget.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DashboardGadgetSettings } from '../models'; - -export interface AddGadget extends DashboardGadgetSettings { - /** The ID of the dashboard. */ - dashboardId: number; -} diff --git a/src/version3/parameters/addIssueTypesToContext.mts b/src/version3/parameters/addIssueTypesToContext.mts new file mode 100644 index 0000000000..973ad9e1be --- /dev/null +++ b/src/version3/parameters/addIssueTypesToContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/addIssueTypesToContext.ts b/src/version3/parameters/addIssueTypesToContext.ts deleted file mode 100644 index e08bf03d6f..0000000000 --- a/src/version3/parameters/addIssueTypesToContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface AddIssueTypesToContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/addIssueTypesToIssueTypeScheme.mts b/src/version3/parameters/addIssueTypesToIssueTypeScheme.mts new file mode 100644 index 0000000000..e8768623bf --- /dev/null +++ b/src/version3/parameters/addIssueTypesToIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version3/parameters/addIssueTypesToIssueTypeScheme.ts b/src/version3/parameters/addIssueTypesToIssueTypeScheme.ts deleted file mode 100644 index b2c6e15f39..0000000000 --- a/src/version3/parameters/addIssueTypesToIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface AddIssueTypesToIssueTypeScheme extends IssueTypeIds { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version3/parameters/addProjectRoleActorsToRole.mts b/src/version3/parameters/addProjectRoleActorsToRole.mts new file mode 100644 index 0000000000..81945100a7 --- /dev/null +++ b/src/version3/parameters/addProjectRoleActorsToRole.mts @@ -0,0 +1,9 @@ +import { ActorInput } from '../models/index.mjs'; + +export interface AddProjectRoleActorsToRole extends ActorInput { + /** + * 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. + */ + id: number; +} diff --git a/src/version3/parameters/addProjectRoleActorsToRole.ts b/src/version3/parameters/addProjectRoleActorsToRole.ts deleted file mode 100644 index dc0f024bbd..0000000000 --- a/src/version3/parameters/addProjectRoleActorsToRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ActorInput } from '../models'; - -export interface AddProjectRoleActorsToRole extends ActorInput { - /** - * 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. - */ - id: number; -} diff --git a/src/version3/parameters/addScreenTab.mts b/src/version3/parameters/addScreenTab.mts new file mode 100644 index 0000000000..3ce2f3a878 --- /dev/null +++ b/src/version3/parameters/addScreenTab.mts @@ -0,0 +1,6 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface AddScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version3/parameters/addScreenTab.ts b/src/version3/parameters/addScreenTab.ts deleted file mode 100644 index 07962426f2..0000000000 --- a/src/version3/parameters/addScreenTab.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ScreenableTab } from '../models'; - -export interface AddScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version3/parameters/addScreenTabField.mts b/src/version3/parameters/addScreenTabField.mts new file mode 100644 index 0000000000..5bff262102 --- /dev/null +++ b/src/version3/parameters/addScreenTabField.mts @@ -0,0 +1,8 @@ +import { AddField } from '../models/index.mjs'; + +export interface AddScreenTabField extends AddField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version3/parameters/addScreenTabField.ts b/src/version3/parameters/addScreenTabField.ts deleted file mode 100644 index b055647c57..0000000000 --- a/src/version3/parameters/addScreenTabField.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { AddField } from '../models'; - -export interface AddScreenTabField extends AddField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version3/parameters/addSecurityLevel.mts b/src/version3/parameters/addSecurityLevel.mts new file mode 100644 index 0000000000..6891874274 --- /dev/null +++ b/src/version3/parameters/addSecurityLevel.mts @@ -0,0 +1,6 @@ +import { AddSecuritySchemeLevelsRequest } from '../models/index.mjs'; + +export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { + /** The ID of the issue security scheme. */ + schemeId: string; +} diff --git a/src/version3/parameters/addSecurityLevel.ts b/src/version3/parameters/addSecurityLevel.ts deleted file mode 100644 index ed915fa92c..0000000000 --- a/src/version3/parameters/addSecurityLevel.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { AddSecuritySchemeLevelsRequest } from '../models'; - -export interface AddSecurityLevel extends AddSecuritySchemeLevelsRequest { - /** The ID of the issue security scheme. */ - schemeId: string; -} diff --git a/src/version3/parameters/addSecurityLevelMembers.mts b/src/version3/parameters/addSecurityLevelMembers.mts new file mode 100644 index 0000000000..3ed3b0a6f3 --- /dev/null +++ b/src/version3/parameters/addSecurityLevelMembers.mts @@ -0,0 +1,8 @@ +import { SecuritySchemeMembersRequest } from '../models/index.mjs'; + +export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { + /** The ID of the issue security scheme. */ + schemeId: string; + /** The ID of the issue security level. */ + levelId: string; +} diff --git a/src/version3/parameters/addSecurityLevelMembers.ts b/src/version3/parameters/addSecurityLevelMembers.ts deleted file mode 100644 index ac1a26e84d..0000000000 --- a/src/version3/parameters/addSecurityLevelMembers.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { SecuritySchemeMembersRequest } from '../models'; - -export interface AddSecurityLevelMembers extends SecuritySchemeMembersRequest { - /** The ID of the issue security scheme. */ - schemeId: string; - /** The ID of the issue security level. */ - levelId: string; -} diff --git a/src/version3/parameters/addSharePermission.mts b/src/version3/parameters/addSharePermission.mts new file mode 100644 index 0000000000..a55798ad14 --- /dev/null +++ b/src/version3/parameters/addSharePermission.mts @@ -0,0 +1,6 @@ +import { SharePermissionInput } from '../models/index.mjs'; + +export interface AddSharePermission extends SharePermissionInput { + /** The ID of the filter. */ + id: number; +} diff --git a/src/version3/parameters/addSharePermission.ts b/src/version3/parameters/addSharePermission.ts deleted file mode 100644 index 0f672e9756..0000000000 --- a/src/version3/parameters/addSharePermission.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SharePermissionInput } from '../models'; - -export interface AddSharePermission extends SharePermissionInput { - /** The ID of the filter. */ - id: number; -} diff --git a/src/version3/parameters/addUserToGroup.mts b/src/version3/parameters/addUserToGroup.mts new file mode 100644 index 0000000000..0507e8af81 --- /dev/null +++ b/src/version3/parameters/addUserToGroup.mts @@ -0,0 +1,11 @@ +import { UpdateUserToGroup } from '../models/index.mjs'; + +export interface AddUserToGroup extends UpdateUserToGroup { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This + * parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; +} diff --git a/src/version3/parameters/addUserToGroup.ts b/src/version3/parameters/addUserToGroup.ts deleted file mode 100644 index 836eb42c4c..0000000000 --- a/src/version3/parameters/addUserToGroup.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { UpdateUserToGroup } from '../models'; - -export interface AddUserToGroup extends UpdateUserToGroup { - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. The name of the group. This - * parameter cannot be used with the `groupId` parameter. - */ - groupname?: string; - /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ - groupId?: string; -} diff --git a/src/version3/parameters/addVote.ts b/src/version3/parameters/addVote.mts similarity index 100% rename from src/version3/parameters/addVote.ts rename to src/version3/parameters/addVote.mts diff --git a/src/version3/parameters/addWatcher.ts b/src/version3/parameters/addWatcher.mts similarity index 100% rename from src/version3/parameters/addWatcher.ts rename to src/version3/parameters/addWatcher.mts diff --git a/src/version3/parameters/addWorklog.mts b/src/version3/parameters/addWorklog.mts new file mode 100644 index 0000000000..85209f55c5 --- /dev/null +++ b/src/version3/parameters/addWorklog.mts @@ -0,0 +1,45 @@ +import { Document, Worklog } from '../models/index.mjs'; + +export interface AddWorklog extends Omit { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `manual` Reduces the estimate by amount specified in `reduceBy`. + * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * A comment about the worklog in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or + * updating a worklog. + */ + comment?: string | Document; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, + * _2d_. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about work logs in the response. This parameter accepts `properties`, which returns worklog + * properties. + */ + expand?: 'properties' | 'properties'[] | string | string[]; + /** + * Whether the worklog entry should be added 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 + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version3/parameters/addWorklog.ts b/src/version3/parameters/addWorklog.ts deleted file mode 100644 index c3970695c1..0000000000 --- a/src/version3/parameters/addWorklog.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { Document, Worklog } from '../models'; - -export interface AddWorklog extends Omit { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `manual` Reduces the estimate by amount specified in `reduceBy`. - * - `auto` Reduces the estimate by the value of `timeSpent` in the worklog. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * A comment about the worklog in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or - * updating a worklog. - */ - comment?: string | Document; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * The amount to reduce the issue's remaining estimate by, as days (#d), hours (#h), or minutes (#m). For example, - * _2d_. Required when `adjustEstimate` is `manual`. - */ - reduceBy?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about work logs in the response. This parameter accepts `properties`, which returns worklog - * properties. - */ - expand?: 'properties' | 'properties'[] | string | string[]; - /** - * Whether the worklog entry should be added 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 - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version3/parameters/analyseExpression.mts b/src/version3/parameters/analyseExpression.mts new file mode 100644 index 0000000000..8802ab65df --- /dev/null +++ b/src/version3/parameters/analyseExpression.mts @@ -0,0 +1,17 @@ +import { JiraExpressionForAnalysis } from '../models/index.mjs'; + +export interface AnalyseExpression extends JiraExpressionForAnalysis { + /** + * The check to perform: + * + * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are + * validated. For example, the expression's length. + * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors + * that would result in the expression failure at runtime are reported. For example, accessing properties that don't + * exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive + * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each + * expression may execute. + */ + check?: 'syntax' | 'type' | 'complexity' | string; +} diff --git a/src/version3/parameters/analyseExpression.ts b/src/version3/parameters/analyseExpression.ts deleted file mode 100644 index 46d7696d48..0000000000 --- a/src/version3/parameters/analyseExpression.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { JiraExpressionForAnalysis } from '../models'; - -export interface AnalyseExpression extends JiraExpressionForAnalysis { - /** - * The check to perform: - * - * - `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are - * validated. For example, the expression's length. - * - `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors - * that would result in the expression failure at runtime are reported. For example, accessing properties that don't - * exist or passing the wrong number of arguments to functions. Also performs the syntax check. - * - `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive - * operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each - * expression may execute. - */ - check?: 'syntax' | 'type' | 'complexity' | string; -} diff --git a/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts b/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..99bbd0dbc4 --- /dev/null +++ b/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeMappingDetails } from '../models/index.mjs'; + +export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts b/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts deleted file mode 100644 index e31689b20d..0000000000 --- a/src/version3/parameters/appendMappingsForIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeScreenSchemeMappingDetails } from '../models'; - -export interface AppendMappingsForIssueTypeScreenScheme extends IssueTypeScreenSchemeMappingDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version3/parameters/archiveIssues.mts b/src/version3/parameters/archiveIssues.mts new file mode 100644 index 0000000000..79ec0f51a9 --- /dev/null +++ b/src/version3/parameters/archiveIssues.mts @@ -0,0 +1,3 @@ +import { IssueArchivalSyncRequest } from '../models/index.mjs'; + +export interface ArchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/archiveIssues.ts b/src/version3/parameters/archiveIssues.ts deleted file mode 100644 index ffad9a1080..0000000000 --- a/src/version3/parameters/archiveIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueArchivalSyncRequest } from '../models'; - -export interface ArchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/archiveIssuesAsync.mts b/src/version3/parameters/archiveIssuesAsync.mts new file mode 100644 index 0000000000..7eede88179 --- /dev/null +++ b/src/version3/parameters/archiveIssuesAsync.mts @@ -0,0 +1,3 @@ +import { ArchiveIssueAsyncRequest } from '../models/index.mjs'; + +export interface ArchiveIssuesAsync extends ArchiveIssueAsyncRequest {} diff --git a/src/version3/parameters/archiveIssuesAsync.ts b/src/version3/parameters/archiveIssuesAsync.ts deleted file mode 100644 index f0e873569e..0000000000 --- a/src/version3/parameters/archiveIssuesAsync.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ArchiveIssueAsyncRequest } from '../models'; - -export interface ArchiveIssuesAsync extends ArchiveIssueAsyncRequest {} diff --git a/src/version3/parameters/archiveProject.ts b/src/version3/parameters/archiveProject.mts similarity index 100% rename from src/version3/parameters/archiveProject.ts rename to src/version3/parameters/archiveProject.mts diff --git a/src/version3/parameters/assignFieldConfigurationSchemeToProject.mts b/src/version3/parameters/assignFieldConfigurationSchemeToProject.mts new file mode 100644 index 0000000000..93d7163142 --- /dev/null +++ b/src/version3/parameters/assignFieldConfigurationSchemeToProject.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignFieldConfigurationSchemeToProject.ts b/src/version3/parameters/assignFieldConfigurationSchemeToProject.ts deleted file mode 100644 index 8cead61b41..0000000000 --- a/src/version3/parameters/assignFieldConfigurationSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FieldConfigurationSchemeProjectAssociation } from '../models'; - -export interface AssignFieldConfigurationSchemeToProject extends FieldConfigurationSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssue.mts b/src/version3/parameters/assignIssue.mts new file mode 100644 index 0000000000..dd52f8b27e --- /dev/null +++ b/src/version3/parameters/assignIssue.mts @@ -0,0 +1,15 @@ +import { User } from '../models/index.mjs'; + +export interface AssignIssue extends Omit { + /** The ID or key of the issue to be assigned. */ + issueIdOrKey: string; + + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, + * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. + */ + accountId: string | null; + + /** Whether the user is active. */ + active?: boolean; +} diff --git a/src/version3/parameters/assignIssue.ts b/src/version3/parameters/assignIssue.ts deleted file mode 100644 index 5d4f76c84d..0000000000 --- a/src/version3/parameters/assignIssue.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { User } from '../models'; - -export interface AssignIssue extends Omit { - /** The ID or key of the issue to be assigned. */ - issueIdOrKey: string; - - /** - * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, - * _5b10ac8d82e05b22cc7d4ef5_. If passed `null` it will unassigned issue. - */ - accountId: string | null; - - /** Whether the user is active. */ - active?: boolean; -} diff --git a/src/version3/parameters/assignIssueTypeSchemeToProject.mts b/src/version3/parameters/assignIssueTypeSchemeToProject.mts new file mode 100644 index 0000000000..2984b6cc12 --- /dev/null +++ b/src/version3/parameters/assignIssueTypeSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssueTypeSchemeToProject.ts b/src/version3/parameters/assignIssueTypeSchemeToProject.ts deleted file mode 100644 index f297c4d1eb..0000000000 --- a/src/version3/parameters/assignIssueTypeSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeSchemeProjectAssociation } from '../models'; - -export interface AssignIssueTypeSchemeToProject extends IssueTypeSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts b/src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts new file mode 100644 index 0000000000..3a209ea089 --- /dev/null +++ b/src/version3/parameters/assignIssueTypeScreenSchemeToProject.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts b/src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts deleted file mode 100644 index 009b11b8f7..0000000000 --- a/src/version3/parameters/assignIssueTypeScreenSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeScreenSchemeProjectAssociation } from '../models'; - -export interface AssignIssueTypeScreenSchemeToProject extends IssueTypeScreenSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignPermissionScheme.mts b/src/version3/parameters/assignPermissionScheme.mts new file mode 100644 index 0000000000..c75c78628b --- /dev/null +++ b/src/version3/parameters/assignPermissionScheme.mts @@ -0,0 +1,28 @@ +import { Id } from '../models/index.mjs'; + +export interface AssignPermissionScheme extends Id { + /** 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. Note that permissions are included when + * you specify any value. Expand options include: + * + * - `all` Returns all expandable information. + * - `field` Returns information about the custom field granted the permission. + * - `group` Returns information about the group that is granted the permission. + * - `permissions` Returns all permission grants for each permission scheme. + * - `projectRole` Returns information about the project role granted the permission. + * - `user` Returns information about the user who is granted the permission. + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'permissions' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] + | string + | string[]; +} diff --git a/src/version3/parameters/assignPermissionScheme.ts b/src/version3/parameters/assignPermissionScheme.ts deleted file mode 100644 index bb31c75f04..0000000000 --- a/src/version3/parameters/assignPermissionScheme.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { Id } from '../models'; - -export interface AssignPermissionScheme extends Id { - /** 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. Note that permissions are included when - * you specify any value. Expand options include: - * - * - `all` Returns all expandable information. - * - `field` Returns information about the custom field granted the permission. - * - `group` Returns information about the group that is granted the permission. - * - `permissions` Returns all permission grants for each permission scheme. - * - `projectRole` Returns information about the project role granted the permission. - * - `user` Returns information about the user who is granted the permission. - */ - expand?: - | 'all' - | 'field' - | 'group' - | 'permissions' - | 'projectRole' - | 'user' - | ('all' | 'field' | 'group' | 'permissions' | 'projectRole' | 'user')[] - | string - | string[]; -} diff --git a/src/version3/parameters/assignProjectsToCustomFieldContext.mts b/src/version3/parameters/assignProjectsToCustomFieldContext.mts new file mode 100644 index 0000000000..d8b4b090a7 --- /dev/null +++ b/src/version3/parameters/assignProjectsToCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface AssignProjectsToCustomFieldContext extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/assignProjectsToCustomFieldContext.ts b/src/version3/parameters/assignProjectsToCustomFieldContext.ts deleted file mode 100644 index 1f9f35a4f3..0000000000 --- a/src/version3/parameters/assignProjectsToCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectIds } from '../models'; - -export interface AssignProjectsToCustomFieldContext extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/assignSchemeToProject.mts b/src/version3/parameters/assignSchemeToProject.mts new file mode 100644 index 0000000000..31f2210137 --- /dev/null +++ b/src/version3/parameters/assignSchemeToProject.mts @@ -0,0 +1,3 @@ +import { WorkflowSchemeProjectAssociation } from '../models/index.mjs'; + +export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version3/parameters/assignSchemeToProject.ts b/src/version3/parameters/assignSchemeToProject.ts deleted file mode 100644 index 8089f47d09..0000000000 --- a/src/version3/parameters/assignSchemeToProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowSchemeProjectAssociation } from '../models'; - -export interface AssignSchemeToProject extends WorkflowSchemeProjectAssociation {} diff --git a/src/version3/parameters/associateSchemesToProjects.mts b/src/version3/parameters/associateSchemesToProjects.mts new file mode 100644 index 0000000000..14345db44b --- /dev/null +++ b/src/version3/parameters/associateSchemesToProjects.mts @@ -0,0 +1,11 @@ +import { OldToNewSecurityLevelMappings } from '../models/index.mjs'; + +/** Issue security scheme, project, and remapping details. */ +export interface AssociateSchemesToProjects { + /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ + oldToNewSecurityLevelMappings?: OldToNewSecurityLevelMappings[]; + /** The ID of the project. */ + projectId: string; + /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ + schemeId: string; +} diff --git a/src/version3/parameters/associateSchemesToProjects.ts b/src/version3/parameters/associateSchemesToProjects.ts deleted file mode 100644 index 9f959b5dae..0000000000 --- a/src/version3/parameters/associateSchemesToProjects.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { OldToNewSecurityLevelMappings } from '../models'; - -/** Issue security scheme, project, and remapping details. */ -export interface AssociateSchemesToProjects { - /** The list of scheme levels which should be remapped to new levels of the issue security scheme. */ - oldToNewSecurityLevelMappings?: OldToNewSecurityLevelMappings[]; - /** The ID of the project. */ - projectId: string; - /** The ID of the issue security scheme. Providing null will clear the association with the issue security scheme. */ - schemeId: string; -} diff --git a/src/version3/parameters/bulkDeleteIssueProperty.mts b/src/version3/parameters/bulkDeleteIssueProperty.mts new file mode 100644 index 0000000000..bfc78d867e --- /dev/null +++ b/src/version3/parameters/bulkDeleteIssueProperty.mts @@ -0,0 +1,6 @@ +import { IssueFilterForBulkPropertyDelete } from '../models/index.mjs'; + +export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { + /** The key of the property. */ + propertyKey: string; +} diff --git a/src/version3/parameters/bulkDeleteIssueProperty.ts b/src/version3/parameters/bulkDeleteIssueProperty.ts deleted file mode 100644 index b66f3d9f5e..0000000000 --- a/src/version3/parameters/bulkDeleteIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueFilterForBulkPropertyDelete } from '../models'; - -export interface BulkDeleteIssueProperty extends IssueFilterForBulkPropertyDelete { - /** The key of the property. */ - propertyKey: string; -} diff --git a/src/version3/parameters/bulkEditDashboards.mts b/src/version3/parameters/bulkEditDashboards.mts new file mode 100644 index 0000000000..086014ceee --- /dev/null +++ b/src/version3/parameters/bulkEditDashboards.mts @@ -0,0 +1,13 @@ +import { BulkChangeOwnerDetails, PermissionDetails } from '../models/index.mjs'; + +/** Details of a request to bulk edit shareable entity. */ +export interface BulkEditDashboards { + /** Allowed action for bulk edit shareable entity */ + action: string; + changeOwnerDetails?: BulkChangeOwnerDetails; + /** The id list of shareable entities to be changed. */ + entityIds: number[]; + /** Whether the actions are executed by users with Administer Jira global permission. */ + extendAdminPermissions?: boolean; + permissionDetails?: PermissionDetails; +} diff --git a/src/version3/parameters/bulkEditDashboards.ts b/src/version3/parameters/bulkEditDashboards.ts deleted file mode 100644 index 43116d773c..0000000000 --- a/src/version3/parameters/bulkEditDashboards.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { BulkChangeOwnerDetails, PermissionDetails } from '../models'; - -/** Details of a request to bulk edit shareable entity. */ -export interface BulkEditDashboards { - /** Allowed action for bulk edit shareable entity */ - action: string; - changeOwnerDetails?: BulkChangeOwnerDetails; - /** The id list of shareable entities to be changed. */ - entityIds: number[]; - /** Whether the actions are executed by users with Administer Jira global permission. */ - extendAdminPermissions?: boolean; - permissionDetails?: PermissionDetails; -} diff --git a/src/version3/parameters/bulkGetGroups.ts b/src/version3/parameters/bulkGetGroups.mts similarity index 100% rename from src/version3/parameters/bulkGetGroups.ts rename to src/version3/parameters/bulkGetGroups.mts diff --git a/src/version3/parameters/bulkGetUsers.ts b/src/version3/parameters/bulkGetUsers.mts similarity index 100% rename from src/version3/parameters/bulkGetUsers.ts rename to src/version3/parameters/bulkGetUsers.mts diff --git a/src/version3/parameters/bulkGetUsersMigration.ts b/src/version3/parameters/bulkGetUsersMigration.mts similarity index 100% rename from src/version3/parameters/bulkGetUsersMigration.ts rename to src/version3/parameters/bulkGetUsersMigration.mts diff --git a/src/version3/parameters/bulkSetIssuePropertiesByIssue.mts b/src/version3/parameters/bulkSetIssuePropertiesByIssue.mts new file mode 100644 index 0000000000..b96e5308dc --- /dev/null +++ b/src/version3/parameters/bulkSetIssuePropertiesByIssue.mts @@ -0,0 +1,3 @@ +import { MultiIssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version3/parameters/bulkSetIssuePropertiesByIssue.ts b/src/version3/parameters/bulkSetIssuePropertiesByIssue.ts deleted file mode 100644 index c36f8dee79..0000000000 --- a/src/version3/parameters/bulkSetIssuePropertiesByIssue.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { MultiIssueEntityProperties } from '../models'; - -export interface BulkSetIssuePropertiesByIssue extends MultiIssueEntityProperties {} diff --git a/src/version3/parameters/bulkSetIssueProperty.mts b/src/version3/parameters/bulkSetIssueProperty.mts new file mode 100644 index 0000000000..457f8d21b9 --- /dev/null +++ b/src/version3/parameters/bulkSetIssueProperty.mts @@ -0,0 +1,6 @@ +import { BulkIssuePropertyUpdateRequest } from '../models/index.mjs'; + +export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { + /** The key of the property. The maximum length is 255 characters. */ + propertyKey: string; +} diff --git a/src/version3/parameters/bulkSetIssueProperty.ts b/src/version3/parameters/bulkSetIssueProperty.ts deleted file mode 100644 index 3441a3cf2a..0000000000 --- a/src/version3/parameters/bulkSetIssueProperty.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { BulkIssuePropertyUpdateRequest } from '../models'; - -export interface BulkSetIssueProperty extends BulkIssuePropertyUpdateRequest { - /** The key of the property. The maximum length is 255 characters. */ - propertyKey: string; -} diff --git a/src/version3/parameters/bulkSetIssuesProperties.mts b/src/version3/parameters/bulkSetIssuesProperties.mts new file mode 100644 index 0000000000..f6df48500d --- /dev/null +++ b/src/version3/parameters/bulkSetIssuesProperties.mts @@ -0,0 +1,3 @@ +import { IssueEntityProperties } from '../models/index.mjs'; + +export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version3/parameters/bulkSetIssuesProperties.ts b/src/version3/parameters/bulkSetIssuesProperties.ts deleted file mode 100644 index a5524aa6dc..0000000000 --- a/src/version3/parameters/bulkSetIssuesProperties.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueEntityProperties } from '../models'; - -export interface BulkSetIssuesProperties extends IssueEntityProperties {} diff --git a/src/version3/parameters/cancelTask.ts b/src/version3/parameters/cancelTask.mts similarity index 100% rename from src/version3/parameters/cancelTask.ts rename to src/version3/parameters/cancelTask.mts diff --git a/src/version3/parameters/changeFilterOwner.ts b/src/version3/parameters/changeFilterOwner.mts similarity index 100% rename from src/version3/parameters/changeFilterOwner.ts rename to src/version3/parameters/changeFilterOwner.mts diff --git a/src/version3/parameters/copyDashboard.mts b/src/version3/parameters/copyDashboard.mts new file mode 100644 index 0000000000..8233629223 --- /dev/null +++ b/src/version3/parameters/copyDashboard.mts @@ -0,0 +1,5 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface CopyDashboard extends DashboardDetails { + id: string; +} diff --git a/src/version3/parameters/copyDashboard.ts b/src/version3/parameters/copyDashboard.ts deleted file mode 100644 index 1e157d012e..0000000000 --- a/src/version3/parameters/copyDashboard.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { DashboardDetails } from '../models'; - -export interface CopyDashboard extends DashboardDetails { - id: string; -} diff --git a/src/version3/parameters/createComponent.mts b/src/version3/parameters/createComponent.mts new file mode 100644 index 0000000000..82765b5794 --- /dev/null +++ b/src/version3/parameters/createComponent.mts @@ -0,0 +1,3 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface CreateComponent extends ProjectComponent {} diff --git a/src/version3/parameters/createComponent.ts b/src/version3/parameters/createComponent.ts deleted file mode 100644 index d84d76eb7b..0000000000 --- a/src/version3/parameters/createComponent.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ProjectComponent } from '../models'; - -export interface CreateComponent extends ProjectComponent {} diff --git a/src/version3/parameters/createCustomField.mts b/src/version3/parameters/createCustomField.mts new file mode 100644 index 0000000000..409f21d32d --- /dev/null +++ b/src/version3/parameters/createCustomField.mts @@ -0,0 +1,3 @@ +import { CustomFieldDefinitionJson } from '../models/index.mjs'; + +export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version3/parameters/createCustomField.ts b/src/version3/parameters/createCustomField.ts deleted file mode 100644 index b6e8cdd762..0000000000 --- a/src/version3/parameters/createCustomField.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CustomFieldDefinitionJson } from '../models'; - -export interface CreateCustomField extends CustomFieldDefinitionJson {} diff --git a/src/version3/parameters/createCustomFieldContext.ts b/src/version3/parameters/createCustomFieldContext.mts similarity index 100% rename from src/version3/parameters/createCustomFieldContext.ts rename to src/version3/parameters/createCustomFieldContext.mts diff --git a/src/version3/parameters/createCustomFieldOption.mts b/src/version3/parameters/createCustomFieldOption.mts new file mode 100644 index 0000000000..67c684ab53 --- /dev/null +++ b/src/version3/parameters/createCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionCreateRequest } from '../models/index.mjs'; + +export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/createCustomFieldOption.ts b/src/version3/parameters/createCustomFieldOption.ts deleted file mode 100644 index 9bf2208191..0000000000 --- a/src/version3/parameters/createCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BulkCustomFieldOptionCreateRequest } from '../models'; - -export interface CreateCustomFieldOption extends BulkCustomFieldOptionCreateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/createDashboard.mts b/src/version3/parameters/createDashboard.mts new file mode 100644 index 0000000000..08358b7948 --- /dev/null +++ b/src/version3/parameters/createDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails, SharePermission } from '../models/index.mjs'; + +export interface CreateDashboard extends Omit { + /** The edit permissions for the dashboard. */ + editPermissions?: SharePermission[]; +} diff --git a/src/version3/parameters/createDashboard.ts b/src/version3/parameters/createDashboard.ts deleted file mode 100644 index eb78135c41..0000000000 --- a/src/version3/parameters/createDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DashboardDetails, SharePermission } from '../models'; - -export interface CreateDashboard extends Omit { - /** The edit permissions for the dashboard. */ - editPermissions?: SharePermission[]; -} diff --git a/src/version3/parameters/createFieldConfiguration.mts b/src/version3/parameters/createFieldConfiguration.mts new file mode 100644 index 0000000000..fafce9fb0b --- /dev/null +++ b/src/version3/parameters/createFieldConfiguration.mts @@ -0,0 +1,3 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version3/parameters/createFieldConfiguration.ts b/src/version3/parameters/createFieldConfiguration.ts deleted file mode 100644 index 0275a1f5d3..0000000000 --- a/src/version3/parameters/createFieldConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FieldConfigurationDetails } from '../models'; - -export interface CreateFieldConfiguration extends FieldConfigurationDetails {} diff --git a/src/version3/parameters/createFieldConfigurationScheme.mts b/src/version3/parameters/createFieldConfigurationScheme.mts new file mode 100644 index 0000000000..9383fe66df --- /dev/null +++ b/src/version3/parameters/createFieldConfigurationScheme.mts @@ -0,0 +1,3 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version3/parameters/createFieldConfigurationScheme.ts b/src/version3/parameters/createFieldConfigurationScheme.ts deleted file mode 100644 index 007c1dc319..0000000000 --- a/src/version3/parameters/createFieldConfigurationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { UpdateFieldConfigurationSchemeDetails } from '../models'; - -export interface CreateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails {} diff --git a/src/version3/parameters/createFilter.mts b/src/version3/parameters/createFilter.mts new file mode 100644 index 0000000000..dd8e7dcd03 --- /dev/null +++ b/src/version3/parameters/createFilter.mts @@ -0,0 +1,23 @@ +import { Filter } from '../models/index.mjs'; + +export interface CreateFilter extends Filter { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't + * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of + * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to + * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version3/parameters/createFilter.ts b/src/version3/parameters/createFilter.ts deleted file mode 100644 index 98de32f88b..0000000000 --- a/src/version3/parameters/createFilter.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Filter } from '../models'; - -export interface CreateFilter extends Filter { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. `subscriptions` Returns the users that are subscribed to the filter. If you don't - * specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of - * subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to - * the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: string; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version3/parameters/createGroup.mts b/src/version3/parameters/createGroup.mts new file mode 100644 index 0000000000..fcd378a1bb --- /dev/null +++ b/src/version3/parameters/createGroup.mts @@ -0,0 +1,5 @@ +import { AddGroup } from '../models/index.mjs'; + +export interface CreateGroup extends AddGroup { + [key: string]: any; +} diff --git a/src/version3/parameters/createGroup.ts b/src/version3/parameters/createGroup.ts deleted file mode 100644 index 15c93233fd..0000000000 --- a/src/version3/parameters/createGroup.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { AddGroup } from '../models'; - -export interface CreateGroup extends AddGroup { - [key: string]: any; -} diff --git a/src/version3/parameters/createIssue.mts b/src/version3/parameters/createIssue.mts new file mode 100644 index 0000000000..d3ede65cbb --- /dev/null +++ b/src/version3/parameters/createIssue.mts @@ -0,0 +1,64 @@ +import { + Document, IssueUpdateDetails, Project, TimeTrackingDetails, +} from '../models/index.mjs'; + +export interface CreateIssue extends Omit { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a + * project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + + /** + * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field + * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are + * required, use `update`. Fields included in here cannot be included in `update`. + */ + fields: { + [key: string]: any; + summary: string; + project: Partial; + issuetype: { + id?: string | number; + name?: string; + }; + parent?: { + [key: string]: any; + key?: string; + }; + components?: Array<{ + [key: string]: any; + id?: string | number; + }>; + description?: string | Document; + reporter?: { + [key: string]: any; + id?: string | number; + }; + fixVersions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + priority?: { + [key: string]: any; + id?: string | number; + }; + labels?: string[]; + timetracking?: TimeTrackingDetails; + security?: { + [key: string]: any; + id?: string | number; + }; + environment?: any; + versions?: Array<{ + [key: string]: any; + id?: string | number; + }>; + duedate?: string; + assignee?: { + [key: string]: any; + id?: string | number; + }; + }; +} diff --git a/src/version3/parameters/createIssue.ts b/src/version3/parameters/createIssue.ts deleted file mode 100644 index 94849a384e..0000000000 --- a/src/version3/parameters/createIssue.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { - Document, IssueUpdateDetails, Project, TimeTrackingDetails, -} from '../models'; - -export interface CreateIssue extends Omit { - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a - * project. These values are then used to provide defaults on the issue create screen. - */ - updateHistory?: boolean; - - /** - * List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field - * provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are - * required, use `update`. Fields included in here cannot be included in `update`. - */ - fields: { - [key: string]: any; - summary: string; - project: Partial; - issuetype: { - id?: string | number; - name?: string; - }; - parent?: { - [key: string]: any; - key?: string; - }; - components?: Array<{ - [key: string]: any; - id?: string | number; - }>; - description?: string | Document; - reporter?: { - [key: string]: any; - id?: string | number; - }; - fixVersions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - priority?: { - [key: string]: any; - id?: string | number; - }; - labels?: string[]; - timetracking?: TimeTrackingDetails; - security?: { - [key: string]: any; - id?: string | number; - }; - environment?: any; - versions?: Array<{ - [key: string]: any; - id?: string | number; - }>; - duedate?: string; - assignee?: { - [key: string]: any; - id?: string | number; - }; - }; -} diff --git a/src/version3/parameters/createIssueFieldOption.mts b/src/version3/parameters/createIssueFieldOption.mts new file mode 100644 index 0000000000..77e4cc00f8 --- /dev/null +++ b/src/version3/parameters/createIssueFieldOption.mts @@ -0,0 +1,14 @@ +import { IssueFieldOptionCreate } from '../models/index.mjs'; + +export interface CreateIssueFieldOption extends IssueFieldOptionCreate { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; +} diff --git a/src/version3/parameters/createIssueFieldOption.ts b/src/version3/parameters/createIssueFieldOption.ts deleted file mode 100644 index 6fcf535b03..0000000000 --- a/src/version3/parameters/createIssueFieldOption.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { IssueFieldOptionCreate } from '../models'; - -export interface CreateIssueFieldOption extends IssueFieldOptionCreate { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; -} diff --git a/src/version3/parameters/createIssueLinkType.mts b/src/version3/parameters/createIssueLinkType.mts new file mode 100644 index 0000000000..e51df2f5e5 --- /dev/null +++ b/src/version3/parameters/createIssueLinkType.mts @@ -0,0 +1,3 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version3/parameters/createIssueLinkType.ts b/src/version3/parameters/createIssueLinkType.ts deleted file mode 100644 index 10afb86f8c..0000000000 --- a/src/version3/parameters/createIssueLinkType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueLinkType } from '../models'; - -export interface CreateIssueLinkType extends IssueLinkType {} diff --git a/src/version3/parameters/createIssueSecurityScheme.mts b/src/version3/parameters/createIssueSecurityScheme.mts new file mode 100644 index 0000000000..20cbb444a1 --- /dev/null +++ b/src/version3/parameters/createIssueSecurityScheme.mts @@ -0,0 +1,3 @@ +import { CreateIssueSecuritySchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version3/parameters/createIssueSecurityScheme.ts b/src/version3/parameters/createIssueSecurityScheme.ts deleted file mode 100644 index 0f290307b4..0000000000 --- a/src/version3/parameters/createIssueSecurityScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateIssueSecuritySchemeDetails } from '../models'; - -export interface CreateIssueSecurityScheme extends CreateIssueSecuritySchemeDetails {} diff --git a/src/version3/parameters/createIssueType.mts b/src/version3/parameters/createIssueType.mts new file mode 100644 index 0000000000..6181ab8fd6 --- /dev/null +++ b/src/version3/parameters/createIssueType.mts @@ -0,0 +1,3 @@ +import { IssueTypeCreate } from '../models/index.mjs'; + +export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version3/parameters/createIssueType.ts b/src/version3/parameters/createIssueType.ts deleted file mode 100644 index 948fbe0cd8..0000000000 --- a/src/version3/parameters/createIssueType.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeCreate } from '../models'; - -export interface CreateIssueType extends IssueTypeCreate {} diff --git a/src/version3/parameters/createIssueTypeAvatar.ts b/src/version3/parameters/createIssueTypeAvatar.mts similarity index 100% rename from src/version3/parameters/createIssueTypeAvatar.ts rename to src/version3/parameters/createIssueTypeAvatar.mts diff --git a/src/version3/parameters/createIssueTypeScheme.mts b/src/version3/parameters/createIssueTypeScheme.mts new file mode 100644 index 0000000000..79cd33aab0 --- /dev/null +++ b/src/version3/parameters/createIssueTypeScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version3/parameters/createIssueTypeScheme.ts b/src/version3/parameters/createIssueTypeScheme.ts deleted file mode 100644 index 75bff61acd..0000000000 --- a/src/version3/parameters/createIssueTypeScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeSchemeDetails } from '../models'; - -export interface CreateIssueTypeScheme extends IssueTypeSchemeDetails {} diff --git a/src/version3/parameters/createIssueTypeScreenScheme.mts b/src/version3/parameters/createIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..65857ffb95 --- /dev/null +++ b/src/version3/parameters/createIssueTypeScreenScheme.mts @@ -0,0 +1,3 @@ +import { IssueTypeScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version3/parameters/createIssueTypeScreenScheme.ts b/src/version3/parameters/createIssueTypeScreenScheme.ts deleted file mode 100644 index fb016af54f..0000000000 --- a/src/version3/parameters/createIssueTypeScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueTypeScreenSchemeDetails } from '../models'; - -export interface CreateIssueTypeScreenScheme extends IssueTypeScreenSchemeDetails {} diff --git a/src/version3/parameters/createIssues.mts b/src/version3/parameters/createIssues.mts new file mode 100644 index 0000000000..556e0719f3 --- /dev/null +++ b/src/version3/parameters/createIssues.mts @@ -0,0 +1,3 @@ +import { IssuesUpdate } from '../models/index.mjs'; + +export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version3/parameters/createIssues.ts b/src/version3/parameters/createIssues.ts deleted file mode 100644 index 4c447caa8e..0000000000 --- a/src/version3/parameters/createIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssuesUpdate } from '../models'; - -export interface CreateIssues extends IssuesUpdate {} diff --git a/src/version3/parameters/createNotificationScheme.mts b/src/version3/parameters/createNotificationScheme.mts new file mode 100644 index 0000000000..adb278e8df --- /dev/null +++ b/src/version3/parameters/createNotificationScheme.mts @@ -0,0 +1,3 @@ +import { CreateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version3/parameters/createNotificationScheme.ts b/src/version3/parameters/createNotificationScheme.ts deleted file mode 100644 index 30f52272ed..0000000000 --- a/src/version3/parameters/createNotificationScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateNotificationSchemeDetails } from '../models'; - -export interface CreateNotificationScheme extends CreateNotificationSchemeDetails {} diff --git a/src/version3/parameters/createOrUpdateRemoteIssueLink.mts b/src/version3/parameters/createOrUpdateRemoteIssueLink.mts new file mode 100644 index 0000000000..db8e7d2037 --- /dev/null +++ b/src/version3/parameters/createOrUpdateRemoteIssueLink.mts @@ -0,0 +1,6 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/createOrUpdateRemoteIssueLink.ts b/src/version3/parameters/createOrUpdateRemoteIssueLink.ts deleted file mode 100644 index 9f59c96ca0..0000000000 --- a/src/version3/parameters/createOrUpdateRemoteIssueLink.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RemoteIssueLinkRequest } from '../models'; - -export interface CreateOrUpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/createPermissionGrant.mts b/src/version3/parameters/createPermissionGrant.mts new file mode 100644 index 0000000000..97c105cb64 --- /dev/null +++ b/src/version3/parameters/createPermissionGrant.mts @@ -0,0 +1,16 @@ +import { PermissionGrant } from '../models/index.mjs'; + +export interface CreatePermissionGrant extends PermissionGrant { + /** The ID of the permission scheme in which to create a new permission grant. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user + * who is granted the permission. `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. `field` Returns information about + * the custom field granted the permission. `all` Returns all expandable information. + */ + expand?: string; +} diff --git a/src/version3/parameters/createPermissionGrant.ts b/src/version3/parameters/createPermissionGrant.ts deleted file mode 100644 index 28de066567..0000000000 --- a/src/version3/parameters/createPermissionGrant.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PermissionGrant } from '../models'; - -export interface CreatePermissionGrant extends PermissionGrant { - /** The ID of the permission scheme in which to create a new permission grant. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `permissions` Returns all permission grants for each permission scheme. `user` Returns information about the user - * who is granted the permission. `group` Returns information about the group that is granted the permission. - * `projectRole` Returns information about the project role granted the permission. `field` Returns information about - * the custom field granted the permission. `all` Returns all expandable information. - */ - expand?: string; -} diff --git a/src/version3/parameters/createPermissionScheme.mts b/src/version3/parameters/createPermissionScheme.mts new file mode 100644 index 0000000000..493da6a325 --- /dev/null +++ b/src/version3/parameters/createPermissionScheme.mts @@ -0,0 +1,14 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface CreatePermissionScheme extends PermissionScheme { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `all` Returns all expandable information. `field` Returns information about the custom field granted the + * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all + * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the + * permission. `user` Returns information about the user who is granted the permission. + */ + expand?: string; +} diff --git a/src/version3/parameters/createPermissionScheme.ts b/src/version3/parameters/createPermissionScheme.ts deleted file mode 100644 index bb60ce0e35..0000000000 --- a/src/version3/parameters/createPermissionScheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { PermissionScheme } from '../models'; - -export interface CreatePermissionScheme extends PermissionScheme { - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version3/parameters/createPriority.mts b/src/version3/parameters/createPriority.mts new file mode 100644 index 0000000000..118720599f --- /dev/null +++ b/src/version3/parameters/createPriority.mts @@ -0,0 +1,3 @@ +import { CreatePriorityDetails } from '../models/index.mjs'; + +export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version3/parameters/createPriority.ts b/src/version3/parameters/createPriority.ts deleted file mode 100644 index a1dcef42b9..0000000000 --- a/src/version3/parameters/createPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreatePriorityDetails } from '../models'; - -export interface CreatePriority extends CreatePriorityDetails {} diff --git a/src/version3/parameters/createProject.mts b/src/version3/parameters/createProject.mts new file mode 100644 index 0000000000..d9a484ab8d --- /dev/null +++ b/src/version3/parameters/createProject.mts @@ -0,0 +1,3 @@ +import { CreateProjectDetails } from '../models/index.mjs'; + +export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version3/parameters/createProject.ts b/src/version3/parameters/createProject.ts deleted file mode 100644 index 05b0812087..0000000000 --- a/src/version3/parameters/createProject.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateProjectDetails } from '../models'; - -export interface CreateProject extends CreateProjectDetails {} diff --git a/src/version3/parameters/createProjectAvatar.ts b/src/version3/parameters/createProjectAvatar.mts similarity index 100% rename from src/version3/parameters/createProjectAvatar.ts rename to src/version3/parameters/createProjectAvatar.mts diff --git a/src/version3/parameters/createProjectCategory.mts b/src/version3/parameters/createProjectCategory.mts new file mode 100644 index 0000000000..4f9bf350f5 --- /dev/null +++ b/src/version3/parameters/createProjectCategory.mts @@ -0,0 +1,3 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version3/parameters/createProjectCategory.ts b/src/version3/parameters/createProjectCategory.ts deleted file mode 100644 index 5e45b24dbb..0000000000 --- a/src/version3/parameters/createProjectCategory.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ProjectCategory } from '../models'; - -export interface CreateProjectCategory extends ProjectCategory {} diff --git a/src/version3/parameters/createProjectRole.mts b/src/version3/parameters/createProjectRole.mts new file mode 100644 index 0000000000..96e800bad6 --- /dev/null +++ b/src/version3/parameters/createProjectRole.mts @@ -0,0 +1,3 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version3/parameters/createProjectRole.ts b/src/version3/parameters/createProjectRole.ts deleted file mode 100644 index 4e4ca4cdcf..0000000000 --- a/src/version3/parameters/createProjectRole.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateUpdateRoleRequest } from '../models'; - -export interface CreateProjectRole extends CreateUpdateRoleRequest {} diff --git a/src/version3/parameters/createResolution.mts b/src/version3/parameters/createResolution.mts new file mode 100644 index 0000000000..5027d7a387 --- /dev/null +++ b/src/version3/parameters/createResolution.mts @@ -0,0 +1,5 @@ +import { CreateResolutionDetails } from '../models/index.mjs'; + +export interface CreateResolution extends CreateResolutionDetails { + [key: string]: any; +} diff --git a/src/version3/parameters/createResolution.ts b/src/version3/parameters/createResolution.ts deleted file mode 100644 index 05bb71a11a..0000000000 --- a/src/version3/parameters/createResolution.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CreateResolutionDetails } from '../models'; - -export interface CreateResolution extends CreateResolutionDetails { - [key: string]: any; -} diff --git a/src/version3/parameters/createScreen.mts b/src/version3/parameters/createScreen.mts new file mode 100644 index 0000000000..eb6da4bf28 --- /dev/null +++ b/src/version3/parameters/createScreen.mts @@ -0,0 +1,3 @@ +import { ScreenDetails } from '../models/index.mjs'; + +export interface CreateScreen extends ScreenDetails {} diff --git a/src/version3/parameters/createScreen.ts b/src/version3/parameters/createScreen.ts deleted file mode 100644 index 0e4183a765..0000000000 --- a/src/version3/parameters/createScreen.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ScreenDetails } from '../models'; - -export interface CreateScreen extends ScreenDetails {} diff --git a/src/version3/parameters/createScreenScheme.mts b/src/version3/parameters/createScreenScheme.mts new file mode 100644 index 0000000000..8bf3d2df06 --- /dev/null +++ b/src/version3/parameters/createScreenScheme.mts @@ -0,0 +1,3 @@ +import { ScreenSchemeDetails } from '../models/index.mjs'; + +export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version3/parameters/createScreenScheme.ts b/src/version3/parameters/createScreenScheme.ts deleted file mode 100644 index e8c919d3c5..0000000000 --- a/src/version3/parameters/createScreenScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ScreenSchemeDetails } from '../models'; - -export interface CreateScreenScheme extends ScreenSchemeDetails {} diff --git a/src/version3/parameters/createStatuses.mts b/src/version3/parameters/createStatuses.mts new file mode 100644 index 0000000000..062949a399 --- /dev/null +++ b/src/version3/parameters/createStatuses.mts @@ -0,0 +1,3 @@ +import { StatusCreateRequest } from '../models/index.mjs'; + +export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version3/parameters/createStatuses.ts b/src/version3/parameters/createStatuses.ts deleted file mode 100644 index 52880e08ad..0000000000 --- a/src/version3/parameters/createStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StatusCreateRequest } from '../models'; - -export interface CreateStatuses extends StatusCreateRequest {} diff --git a/src/version3/parameters/createUiModification.mts b/src/version3/parameters/createUiModification.mts new file mode 100644 index 0000000000..410d9e3274 --- /dev/null +++ b/src/version3/parameters/createUiModification.mts @@ -0,0 +1,3 @@ +import { CreateUiModificationDetails } from '../models/index.mjs'; + +export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version3/parameters/createUiModification.ts b/src/version3/parameters/createUiModification.ts deleted file mode 100644 index 25d28d2738..0000000000 --- a/src/version3/parameters/createUiModification.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateUiModificationDetails } from '../models'; - -export interface CreateUiModification extends CreateUiModificationDetails {} diff --git a/src/version3/parameters/createUser.mts b/src/version3/parameters/createUser.mts new file mode 100644 index 0000000000..f76f95c893 --- /dev/null +++ b/src/version3/parameters/createUser.mts @@ -0,0 +1,3 @@ +import { NewUserDetails } from '../models/index.mjs'; + +export interface CreateUser extends NewUserDetails {} diff --git a/src/version3/parameters/createUser.ts b/src/version3/parameters/createUser.ts deleted file mode 100644 index 84adf035b6..0000000000 --- a/src/version3/parameters/createUser.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { NewUserDetails } from '../models'; - -export interface CreateUser extends NewUserDetails {} diff --git a/src/version3/parameters/createVersion.mts b/src/version3/parameters/createVersion.mts new file mode 100644 index 0000000000..44e2c9cbbf --- /dev/null +++ b/src/version3/parameters/createVersion.mts @@ -0,0 +1,3 @@ +import { Version } from '../models/index.mjs'; + +export interface CreateVersion extends Version {} diff --git a/src/version3/parameters/createVersion.ts b/src/version3/parameters/createVersion.ts deleted file mode 100644 index 2538fd232b..0000000000 --- a/src/version3/parameters/createVersion.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Version } from '../models'; - -export interface CreateVersion extends Version {} diff --git a/src/version3/parameters/createWorkflow.mts b/src/version3/parameters/createWorkflow.mts new file mode 100644 index 0000000000..e1be643967 --- /dev/null +++ b/src/version3/parameters/createWorkflow.mts @@ -0,0 +1,3 @@ +import { CreateWorkflowDetails } from '../models/index.mjs'; + +export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version3/parameters/createWorkflow.ts b/src/version3/parameters/createWorkflow.ts deleted file mode 100644 index dba90b0fc4..0000000000 --- a/src/version3/parameters/createWorkflow.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CreateWorkflowDetails } from '../models'; - -export interface CreateWorkflow extends CreateWorkflowDetails {} diff --git a/src/version3/parameters/createWorkflowScheme.mts b/src/version3/parameters/createWorkflowScheme.mts new file mode 100644 index 0000000000..432890465a --- /dev/null +++ b/src/version3/parameters/createWorkflowScheme.mts @@ -0,0 +1,3 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version3/parameters/createWorkflowScheme.ts b/src/version3/parameters/createWorkflowScheme.ts deleted file mode 100644 index c4f4ab9d76..0000000000 --- a/src/version3/parameters/createWorkflowScheme.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowScheme } from '../models'; - -export interface CreateWorkflowScheme extends WorkflowScheme {} diff --git a/src/version3/parameters/createWorkflowSchemeDraftFromParent.ts b/src/version3/parameters/createWorkflowSchemeDraftFromParent.mts similarity index 100% rename from src/version3/parameters/createWorkflowSchemeDraftFromParent.ts rename to src/version3/parameters/createWorkflowSchemeDraftFromParent.mts diff --git a/src/version3/parameters/createWorkflowTransitionProperty.mts b/src/version3/parameters/createWorkflowTransitionProperty.mts new file mode 100644 index 0000000000..3c700f25f1 --- /dev/null +++ b/src/version3/parameters/createWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version3/parameters/createWorkflowTransitionProperty.ts b/src/version3/parameters/createWorkflowTransitionProperty.ts deleted file mode 100644 index 8aeea6ad06..0000000000 --- a/src/version3/parameters/createWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { WorkflowTransitionProperty } from '../models'; - -export interface CreateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being added, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to _live_ for inactive workflows or _draft_ for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version3/parameters/deleteActor.ts b/src/version3/parameters/deleteActor.mts similarity index 100% rename from src/version3/parameters/deleteActor.ts rename to src/version3/parameters/deleteActor.mts diff --git a/src/version3/parameters/deleteAddonProperty.ts b/src/version3/parameters/deleteAddonProperty.mts similarity index 100% rename from src/version3/parameters/deleteAddonProperty.ts rename to src/version3/parameters/deleteAddonProperty.mts diff --git a/src/version3/parameters/deleteAndReplaceVersion.mts b/src/version3/parameters/deleteAndReplaceVersion.mts new file mode 100644 index 0000000000..f935515ba3 --- /dev/null +++ b/src/version3/parameters/deleteAndReplaceVersion.mts @@ -0,0 +1,6 @@ +import { DeleteAndReplaceVersion as DeleteAndReplaceVersionModel } from '../models/index.mjs'; + +export interface DeleteAndReplaceVersion extends DeleteAndReplaceVersionModel { + /** The ID of the version. */ + id: string; +} diff --git a/src/version3/parameters/deleteAndReplaceVersion.ts b/src/version3/parameters/deleteAndReplaceVersion.ts deleted file mode 100644 index a2a6132502..0000000000 --- a/src/version3/parameters/deleteAndReplaceVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DeleteAndReplaceVersion as DeleteAndReplaceVersionModel } from '../models'; - -export interface DeleteAndReplaceVersion extends DeleteAndReplaceVersionModel { - /** The ID of the version. */ - id: string; -} diff --git a/src/version3/parameters/deleteAppProperty.ts b/src/version3/parameters/deleteAppProperty.mts similarity index 100% rename from src/version3/parameters/deleteAppProperty.ts rename to src/version3/parameters/deleteAppProperty.mts diff --git a/src/version3/parameters/deleteAvatar.ts b/src/version3/parameters/deleteAvatar.mts similarity index 100% rename from src/version3/parameters/deleteAvatar.ts rename to src/version3/parameters/deleteAvatar.mts diff --git a/src/version3/parameters/deleteComment.ts b/src/version3/parameters/deleteComment.mts similarity index 100% rename from src/version3/parameters/deleteComment.ts rename to src/version3/parameters/deleteComment.mts diff --git a/src/version3/parameters/deleteCommentProperty.ts b/src/version3/parameters/deleteCommentProperty.mts similarity index 100% rename from src/version3/parameters/deleteCommentProperty.ts rename to src/version3/parameters/deleteCommentProperty.mts diff --git a/src/version3/parameters/deleteComponent.ts b/src/version3/parameters/deleteComponent.mts similarity index 100% rename from src/version3/parameters/deleteComponent.ts rename to src/version3/parameters/deleteComponent.mts diff --git a/src/version3/parameters/deleteCustomField.ts b/src/version3/parameters/deleteCustomField.mts similarity index 100% rename from src/version3/parameters/deleteCustomField.ts rename to src/version3/parameters/deleteCustomField.mts diff --git a/src/version3/parameters/deleteCustomFieldContext.ts b/src/version3/parameters/deleteCustomFieldContext.mts similarity index 100% rename from src/version3/parameters/deleteCustomFieldContext.ts rename to src/version3/parameters/deleteCustomFieldContext.mts diff --git a/src/version3/parameters/deleteCustomFieldOption.ts b/src/version3/parameters/deleteCustomFieldOption.mts similarity index 100% rename from src/version3/parameters/deleteCustomFieldOption.ts rename to src/version3/parameters/deleteCustomFieldOption.mts diff --git a/src/version3/parameters/deleteDashboard.ts b/src/version3/parameters/deleteDashboard.mts similarity index 100% rename from src/version3/parameters/deleteDashboard.ts rename to src/version3/parameters/deleteDashboard.mts diff --git a/src/version3/parameters/deleteDashboardItemProperty.ts b/src/version3/parameters/deleteDashboardItemProperty.mts similarity index 100% rename from src/version3/parameters/deleteDashboardItemProperty.ts rename to src/version3/parameters/deleteDashboardItemProperty.mts diff --git a/src/version3/parameters/deleteDefaultWorkflow.ts b/src/version3/parameters/deleteDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/deleteDefaultWorkflow.ts rename to src/version3/parameters/deleteDefaultWorkflow.mts diff --git a/src/version3/parameters/deleteDraftDefaultWorkflow.ts b/src/version3/parameters/deleteDraftDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/deleteDraftDefaultWorkflow.ts rename to src/version3/parameters/deleteDraftDefaultWorkflow.mts diff --git a/src/version3/parameters/deleteDraftWorkflowMapping.ts b/src/version3/parameters/deleteDraftWorkflowMapping.mts similarity index 100% rename from src/version3/parameters/deleteDraftWorkflowMapping.ts rename to src/version3/parameters/deleteDraftWorkflowMapping.mts diff --git a/src/version3/parameters/deleteFavouriteForFilter.ts b/src/version3/parameters/deleteFavouriteForFilter.mts similarity index 100% rename from src/version3/parameters/deleteFavouriteForFilter.ts rename to src/version3/parameters/deleteFavouriteForFilter.mts diff --git a/src/version3/parameters/deleteFieldConfiguration.ts b/src/version3/parameters/deleteFieldConfiguration.mts similarity index 100% rename from src/version3/parameters/deleteFieldConfiguration.ts rename to src/version3/parameters/deleteFieldConfiguration.mts diff --git a/src/version3/parameters/deleteFieldConfigurationScheme.ts b/src/version3/parameters/deleteFieldConfigurationScheme.mts similarity index 100% rename from src/version3/parameters/deleteFieldConfigurationScheme.ts rename to src/version3/parameters/deleteFieldConfigurationScheme.mts diff --git a/src/version3/parameters/deleteFilter.ts b/src/version3/parameters/deleteFilter.mts similarity index 100% rename from src/version3/parameters/deleteFilter.ts rename to src/version3/parameters/deleteFilter.mts diff --git a/src/version3/parameters/deleteInactiveWorkflow.ts b/src/version3/parameters/deleteInactiveWorkflow.mts similarity index 100% rename from src/version3/parameters/deleteInactiveWorkflow.ts rename to src/version3/parameters/deleteInactiveWorkflow.mts diff --git a/src/version3/parameters/deleteIssue.ts b/src/version3/parameters/deleteIssue.mts similarity index 100% rename from src/version3/parameters/deleteIssue.ts rename to src/version3/parameters/deleteIssue.mts diff --git a/src/version3/parameters/deleteIssueFieldOption.ts b/src/version3/parameters/deleteIssueFieldOption.mts similarity index 100% rename from src/version3/parameters/deleteIssueFieldOption.ts rename to src/version3/parameters/deleteIssueFieldOption.mts diff --git a/src/version3/parameters/deleteIssueLink.ts b/src/version3/parameters/deleteIssueLink.mts similarity index 100% rename from src/version3/parameters/deleteIssueLink.ts rename to src/version3/parameters/deleteIssueLink.mts diff --git a/src/version3/parameters/deleteIssueLinkType.ts b/src/version3/parameters/deleteIssueLinkType.mts similarity index 100% rename from src/version3/parameters/deleteIssueLinkType.ts rename to src/version3/parameters/deleteIssueLinkType.mts diff --git a/src/version3/parameters/deleteIssueProperty.ts b/src/version3/parameters/deleteIssueProperty.mts similarity index 100% rename from src/version3/parameters/deleteIssueProperty.ts rename to src/version3/parameters/deleteIssueProperty.mts diff --git a/src/version3/parameters/deleteIssueType.ts b/src/version3/parameters/deleteIssueType.mts similarity index 100% rename from src/version3/parameters/deleteIssueType.ts rename to src/version3/parameters/deleteIssueType.mts diff --git a/src/version3/parameters/deleteIssueTypeProperty.ts b/src/version3/parameters/deleteIssueTypeProperty.mts similarity index 100% rename from src/version3/parameters/deleteIssueTypeProperty.ts rename to src/version3/parameters/deleteIssueTypeProperty.mts diff --git a/src/version3/parameters/deleteIssueTypeScheme.ts b/src/version3/parameters/deleteIssueTypeScheme.mts similarity index 100% rename from src/version3/parameters/deleteIssueTypeScheme.ts rename to src/version3/parameters/deleteIssueTypeScheme.mts diff --git a/src/version3/parameters/deleteIssueTypeScreenScheme.ts b/src/version3/parameters/deleteIssueTypeScreenScheme.mts similarity index 100% rename from src/version3/parameters/deleteIssueTypeScreenScheme.ts rename to src/version3/parameters/deleteIssueTypeScreenScheme.mts diff --git a/src/version3/parameters/deleteNotificationScheme.ts b/src/version3/parameters/deleteNotificationScheme.mts similarity index 100% rename from src/version3/parameters/deleteNotificationScheme.ts rename to src/version3/parameters/deleteNotificationScheme.mts diff --git a/src/version3/parameters/deletePermissionScheme.ts b/src/version3/parameters/deletePermissionScheme.mts similarity index 100% rename from src/version3/parameters/deletePermissionScheme.ts rename to src/version3/parameters/deletePermissionScheme.mts diff --git a/src/version3/parameters/deletePermissionSchemeEntity.ts b/src/version3/parameters/deletePermissionSchemeEntity.mts similarity index 100% rename from src/version3/parameters/deletePermissionSchemeEntity.ts rename to src/version3/parameters/deletePermissionSchemeEntity.mts diff --git a/src/version3/parameters/deleteProject.ts b/src/version3/parameters/deleteProject.mts similarity index 100% rename from src/version3/parameters/deleteProject.ts rename to src/version3/parameters/deleteProject.mts diff --git a/src/version3/parameters/deleteProjectAsynchronously.ts b/src/version3/parameters/deleteProjectAsynchronously.mts similarity index 100% rename from src/version3/parameters/deleteProjectAsynchronously.ts rename to src/version3/parameters/deleteProjectAsynchronously.mts diff --git a/src/version3/parameters/deleteProjectAvatar.ts b/src/version3/parameters/deleteProjectAvatar.mts similarity index 100% rename from src/version3/parameters/deleteProjectAvatar.ts rename to src/version3/parameters/deleteProjectAvatar.mts diff --git a/src/version3/parameters/deleteProjectProperty.ts b/src/version3/parameters/deleteProjectProperty.mts similarity index 100% rename from src/version3/parameters/deleteProjectProperty.ts rename to src/version3/parameters/deleteProjectProperty.mts diff --git a/src/version3/parameters/deleteProjectRole.ts b/src/version3/parameters/deleteProjectRole.mts similarity index 100% rename from src/version3/parameters/deleteProjectRole.ts rename to src/version3/parameters/deleteProjectRole.mts diff --git a/src/version3/parameters/deleteProjectRoleActorsFromRole.ts b/src/version3/parameters/deleteProjectRoleActorsFromRole.mts similarity index 100% rename from src/version3/parameters/deleteProjectRoleActorsFromRole.ts rename to src/version3/parameters/deleteProjectRoleActorsFromRole.mts diff --git a/src/version3/parameters/deleteRemoteIssueLinkByGlobalId.ts b/src/version3/parameters/deleteRemoteIssueLinkByGlobalId.mts similarity index 100% rename from src/version3/parameters/deleteRemoteIssueLinkByGlobalId.ts rename to src/version3/parameters/deleteRemoteIssueLinkByGlobalId.mts diff --git a/src/version3/parameters/deleteRemoteIssueLinkById.ts b/src/version3/parameters/deleteRemoteIssueLinkById.mts similarity index 100% rename from src/version3/parameters/deleteRemoteIssueLinkById.ts rename to src/version3/parameters/deleteRemoteIssueLinkById.mts diff --git a/src/version3/parameters/deleteResolution.ts b/src/version3/parameters/deleteResolution.mts similarity index 100% rename from src/version3/parameters/deleteResolution.ts rename to src/version3/parameters/deleteResolution.mts diff --git a/src/version3/parameters/deleteScreen.ts b/src/version3/parameters/deleteScreen.mts similarity index 100% rename from src/version3/parameters/deleteScreen.ts rename to src/version3/parameters/deleteScreen.mts diff --git a/src/version3/parameters/deleteScreenScheme.ts b/src/version3/parameters/deleteScreenScheme.mts similarity index 100% rename from src/version3/parameters/deleteScreenScheme.ts rename to src/version3/parameters/deleteScreenScheme.mts diff --git a/src/version3/parameters/deleteScreenTab.ts b/src/version3/parameters/deleteScreenTab.mts similarity index 100% rename from src/version3/parameters/deleteScreenTab.ts rename to src/version3/parameters/deleteScreenTab.mts diff --git a/src/version3/parameters/deleteSecurityScheme.ts b/src/version3/parameters/deleteSecurityScheme.mts similarity index 100% rename from src/version3/parameters/deleteSecurityScheme.ts rename to src/version3/parameters/deleteSecurityScheme.mts diff --git a/src/version3/parameters/deleteSharePermission.ts b/src/version3/parameters/deleteSharePermission.mts similarity index 100% rename from src/version3/parameters/deleteSharePermission.ts rename to src/version3/parameters/deleteSharePermission.mts diff --git a/src/version3/parameters/deleteStatusesById.ts b/src/version3/parameters/deleteStatusesById.mts similarity index 100% rename from src/version3/parameters/deleteStatusesById.ts rename to src/version3/parameters/deleteStatusesById.mts diff --git a/src/version3/parameters/deleteUiModification.ts b/src/version3/parameters/deleteUiModification.mts similarity index 100% rename from src/version3/parameters/deleteUiModification.ts rename to src/version3/parameters/deleteUiModification.mts diff --git a/src/version3/parameters/deleteUserProperty.ts b/src/version3/parameters/deleteUserProperty.mts similarity index 100% rename from src/version3/parameters/deleteUserProperty.ts rename to src/version3/parameters/deleteUserProperty.mts diff --git a/src/version3/parameters/deleteWebhookById.mts b/src/version3/parameters/deleteWebhookById.mts new file mode 100644 index 0000000000..56e014fe88 --- /dev/null +++ b/src/version3/parameters/deleteWebhookById.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/deleteWebhookById.ts b/src/version3/parameters/deleteWebhookById.ts deleted file mode 100644 index ae1f449b4d..0000000000 --- a/src/version3/parameters/deleteWebhookById.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ContainerForWebhookIDs } from '../models'; - -export interface DeleteWebhookById extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/deleteWorkflowMapping.ts b/src/version3/parameters/deleteWorkflowMapping.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowMapping.ts rename to src/version3/parameters/deleteWorkflowMapping.mts diff --git a/src/version3/parameters/deleteWorkflowScheme.ts b/src/version3/parameters/deleteWorkflowScheme.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowScheme.ts rename to src/version3/parameters/deleteWorkflowScheme.mts diff --git a/src/version3/parameters/deleteWorkflowSchemeDraft.ts b/src/version3/parameters/deleteWorkflowSchemeDraft.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowSchemeDraft.ts rename to src/version3/parameters/deleteWorkflowSchemeDraft.mts diff --git a/src/version3/parameters/deleteWorkflowSchemeDraftIssueType.ts b/src/version3/parameters/deleteWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowSchemeDraftIssueType.ts rename to src/version3/parameters/deleteWorkflowSchemeDraftIssueType.mts diff --git a/src/version3/parameters/deleteWorkflowSchemeIssueType.ts b/src/version3/parameters/deleteWorkflowSchemeIssueType.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowSchemeIssueType.ts rename to src/version3/parameters/deleteWorkflowSchemeIssueType.mts diff --git a/src/version3/parameters/deleteWorkflowTransitionProperty.ts b/src/version3/parameters/deleteWorkflowTransitionProperty.mts similarity index 100% rename from src/version3/parameters/deleteWorkflowTransitionProperty.ts rename to src/version3/parameters/deleteWorkflowTransitionProperty.mts diff --git a/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts b/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 0000000000..39f535d51e --- /dev/null +++ b/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import type { WorkflowsWithTransitionRulesDetails } from '../models/index.mjs'; + +export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts b/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index bd76a37fb8..0000000000 --- a/src/version3/parameters/deleteWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowsWithTransitionRulesDetails } from '../models'; - -export interface DeleteWorkflowTransitionRuleConfigurations extends WorkflowsWithTransitionRulesDetails {} diff --git a/src/version3/parameters/deleteWorklog.ts b/src/version3/parameters/deleteWorklog.mts similarity index 100% rename from src/version3/parameters/deleteWorklog.ts rename to src/version3/parameters/deleteWorklog.mts diff --git a/src/version3/parameters/deleteWorklogProperty.ts b/src/version3/parameters/deleteWorklogProperty.mts similarity index 100% rename from src/version3/parameters/deleteWorklogProperty.ts rename to src/version3/parameters/deleteWorklogProperty.mts diff --git a/src/version3/parameters/doTransition.mts b/src/version3/parameters/doTransition.mts new file mode 100644 index 0000000000..4c396774d0 --- /dev/null +++ b/src/version3/parameters/doTransition.mts @@ -0,0 +1,6 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface DoTransition extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/doTransition.ts b/src/version3/parameters/doTransition.ts deleted file mode 100644 index 25c872b5da..0000000000 --- a/src/version3/parameters/doTransition.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueUpdateDetails } from '../models'; - -export interface DoTransition extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/editIssue.mts b/src/version3/parameters/editIssue.mts new file mode 100644 index 0000000000..ef0429137a --- /dev/null +++ b/src/version3/parameters/editIssue.mts @@ -0,0 +1,31 @@ +import { IssueUpdateDetails } from '../models/index.mjs'; + +export interface EditIssue extends IssueUpdateDetails { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, + * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission + * the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + 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). + */ + returnIssue?: boolean; + /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ + expand?: string; +} diff --git a/src/version3/parameters/editIssue.ts b/src/version3/parameters/editIssue.ts deleted file mode 100644 index 1be9cc59a8..0000000000 --- a/src/version3/parameters/editIssue.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IssueUpdateDetails } from '../models'; - -export interface EditIssue extends IssueUpdateDetails { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * Whether a notification email about the issue update is sent to all watchers. To disable the notification, - * administer Jira or administer project permissions are required. If the user doesn't have the necessary permission - * the request is ignored. - */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - 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). - */ - returnIssue?: boolean; - /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ - expand?: string; -} diff --git a/src/version3/parameters/evaluateJiraExpression.mts b/src/version3/parameters/evaluateJiraExpression.mts new file mode 100644 index 0000000000..a882cc23a0 --- /dev/null +++ b/src/version3/parameters/evaluateJiraExpression.mts @@ -0,0 +1,13 @@ +import { JiraExpressionEvalRequest } from '../models/index.mjs'; + +export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { + /** + * 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/evaluateJiraExpression.ts b/src/version3/parameters/evaluateJiraExpression.ts deleted file mode 100644 index db2c0c0e08..0000000000 --- a/src/version3/parameters/evaluateJiraExpression.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JiraExpressionEvalRequest } from '../models'; - -export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { - /** - * 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/expandAttachmentForHumans.ts b/src/version3/parameters/expandAttachmentForHumans.mts similarity index 100% rename from src/version3/parameters/expandAttachmentForHumans.ts rename to src/version3/parameters/expandAttachmentForHumans.mts diff --git a/src/version3/parameters/expandAttachmentForMachines.ts b/src/version3/parameters/expandAttachmentForMachines.mts similarity index 100% rename from src/version3/parameters/expandAttachmentForMachines.ts rename to src/version3/parameters/expandAttachmentForMachines.mts diff --git a/src/version3/parameters/exportArchivedIssues.mts b/src/version3/parameters/exportArchivedIssues.mts new file mode 100644 index 0000000000..819cb43437 --- /dev/null +++ b/src/version3/parameters/exportArchivedIssues.mts @@ -0,0 +1,14 @@ +import { DateRangeFilter } from '../models/index.mjs'; + +/** Details of a filter for exporting archived issues. */ +export interface ExportArchivedIssues { + /** List archived issues archived by a specified account ID. */ + archivedBy?: string[]; + archivedDateRange?: DateRangeFilter; + /** List archived issues with a specified issue type ID. */ + issueTypes?: string[]; + /** List archived issues with a specified project key. */ + projects?: string[]; + /** List archived issues where the reporter is a specified account ID. */ + reporters?: string[]; +} diff --git a/src/version3/parameters/exportArchivedIssues.ts b/src/version3/parameters/exportArchivedIssues.ts deleted file mode 100644 index 62a6f84f44..0000000000 --- a/src/version3/parameters/exportArchivedIssues.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { DateRangeFilter } from '../models'; - -/** Details of a filter for exporting archived issues. */ -export interface ExportArchivedIssues { - /** List archived issues archived by a specified account ID. */ - archivedBy?: string[]; - archivedDateRange?: DateRangeFilter; - /** List archived issues with a specified issue type ID. */ - issueTypes?: string[]; - /** List archived issues with a specified project key. */ - projects?: string[]; - /** List archived issues where the reporter is a specified account ID. */ - reporters?: string[]; -} diff --git a/src/version3/parameters/findAssignableUsers.ts b/src/version3/parameters/findAssignableUsers.mts similarity index 100% rename from src/version3/parameters/findAssignableUsers.ts rename to src/version3/parameters/findAssignableUsers.mts diff --git a/src/version3/parameters/findBulkAssignableUsers.ts b/src/version3/parameters/findBulkAssignableUsers.mts similarity index 100% rename from src/version3/parameters/findBulkAssignableUsers.ts rename to src/version3/parameters/findBulkAssignableUsers.mts diff --git a/src/version3/parameters/findGroups.ts b/src/version3/parameters/findGroups.mts similarity index 100% rename from src/version3/parameters/findGroups.ts rename to src/version3/parameters/findGroups.mts diff --git a/src/version3/parameters/findUserKeysByQuery.ts b/src/version3/parameters/findUserKeysByQuery.mts similarity index 100% rename from src/version3/parameters/findUserKeysByQuery.ts rename to src/version3/parameters/findUserKeysByQuery.mts diff --git a/src/version3/parameters/findUsers.ts b/src/version3/parameters/findUsers.mts similarity index 100% rename from src/version3/parameters/findUsers.ts rename to src/version3/parameters/findUsers.mts diff --git a/src/version3/parameters/findUsersAndGroups.ts b/src/version3/parameters/findUsersAndGroups.mts similarity index 100% rename from src/version3/parameters/findUsersAndGroups.ts rename to src/version3/parameters/findUsersAndGroups.mts diff --git a/src/version3/parameters/findUsersByQuery.ts b/src/version3/parameters/findUsersByQuery.mts similarity index 100% rename from src/version3/parameters/findUsersByQuery.ts rename to src/version3/parameters/findUsersByQuery.mts diff --git a/src/version3/parameters/findUsersForPicker.ts b/src/version3/parameters/findUsersForPicker.mts similarity index 100% rename from src/version3/parameters/findUsersForPicker.ts rename to src/version3/parameters/findUsersForPicker.mts diff --git a/src/version3/parameters/findUsersWithAllPermissions.ts b/src/version3/parameters/findUsersWithAllPermissions.mts similarity index 100% rename from src/version3/parameters/findUsersWithAllPermissions.ts rename to src/version3/parameters/findUsersWithAllPermissions.mts diff --git a/src/version3/parameters/findUsersWithBrowsePermission.ts b/src/version3/parameters/findUsersWithBrowsePermission.mts similarity index 100% rename from src/version3/parameters/findUsersWithBrowsePermission.ts rename to src/version3/parameters/findUsersWithBrowsePermission.mts diff --git a/src/version3/parameters/fullyUpdateProjectRole.mts b/src/version3/parameters/fullyUpdateProjectRole.mts new file mode 100644 index 0000000000..1d79e7c5f7 --- /dev/null +++ b/src/version3/parameters/fullyUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * 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. + */ + id: number; +} diff --git a/src/version3/parameters/fullyUpdateProjectRole.ts b/src/version3/parameters/fullyUpdateProjectRole.ts deleted file mode 100644 index b4deffeaf9..0000000000 --- a/src/version3/parameters/fullyUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CreateUpdateRoleRequest } from '../models'; - -export interface FullyUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * 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. - */ - id: number; -} diff --git a/src/version3/parameters/getAccessibleProjectTypeByKey.ts b/src/version3/parameters/getAccessibleProjectTypeByKey.mts similarity index 100% rename from src/version3/parameters/getAccessibleProjectTypeByKey.ts rename to src/version3/parameters/getAccessibleProjectTypeByKey.mts diff --git a/src/version3/parameters/getAddonProperties.ts b/src/version3/parameters/getAddonProperties.mts similarity index 100% rename from src/version3/parameters/getAddonProperties.ts rename to src/version3/parameters/getAddonProperties.mts diff --git a/src/version3/parameters/getAddonProperty.ts b/src/version3/parameters/getAddonProperty.mts similarity index 100% rename from src/version3/parameters/getAddonProperty.ts rename to src/version3/parameters/getAddonProperty.mts diff --git a/src/version3/parameters/getAllDashboards.ts b/src/version3/parameters/getAllDashboards.mts similarity index 100% rename from src/version3/parameters/getAllDashboards.ts rename to src/version3/parameters/getAllDashboards.mts diff --git a/src/version3/parameters/getAllFieldConfigurationSchemes.ts b/src/version3/parameters/getAllFieldConfigurationSchemes.mts similarity index 100% rename from src/version3/parameters/getAllFieldConfigurationSchemes.ts rename to src/version3/parameters/getAllFieldConfigurationSchemes.mts diff --git a/src/version3/parameters/getAllFieldConfigurations.ts b/src/version3/parameters/getAllFieldConfigurations.mts similarity index 100% rename from src/version3/parameters/getAllFieldConfigurations.ts rename to src/version3/parameters/getAllFieldConfigurations.mts diff --git a/src/version3/parameters/getAllGadgets.ts b/src/version3/parameters/getAllGadgets.mts similarity index 100% rename from src/version3/parameters/getAllGadgets.ts rename to src/version3/parameters/getAllGadgets.mts diff --git a/src/version3/parameters/getAllIssueFieldOptions.ts b/src/version3/parameters/getAllIssueFieldOptions.mts similarity index 100% rename from src/version3/parameters/getAllIssueFieldOptions.ts rename to src/version3/parameters/getAllIssueFieldOptions.mts diff --git a/src/version3/parameters/getAllIssueTypeSchemes.ts b/src/version3/parameters/getAllIssueTypeSchemes.mts similarity index 100% rename from src/version3/parameters/getAllIssueTypeSchemes.ts rename to src/version3/parameters/getAllIssueTypeSchemes.mts diff --git a/src/version3/parameters/getAllLabels.ts b/src/version3/parameters/getAllLabels.mts similarity index 100% rename from src/version3/parameters/getAllLabels.ts rename to src/version3/parameters/getAllLabels.mts diff --git a/src/version3/parameters/getAllPermissionSchemes.ts b/src/version3/parameters/getAllPermissionSchemes.mts similarity index 100% rename from src/version3/parameters/getAllPermissionSchemes.ts rename to src/version3/parameters/getAllPermissionSchemes.mts diff --git a/src/version3/parameters/getAllProjectAvatars.ts b/src/version3/parameters/getAllProjectAvatars.mts similarity index 100% rename from src/version3/parameters/getAllProjectAvatars.ts rename to src/version3/parameters/getAllProjectAvatars.mts diff --git a/src/version3/parameters/getAllScreenTabFields.ts b/src/version3/parameters/getAllScreenTabFields.mts similarity index 100% rename from src/version3/parameters/getAllScreenTabFields.ts rename to src/version3/parameters/getAllScreenTabFields.mts diff --git a/src/version3/parameters/getAllScreenTabs.ts b/src/version3/parameters/getAllScreenTabs.mts similarity index 100% rename from src/version3/parameters/getAllScreenTabs.ts rename to src/version3/parameters/getAllScreenTabs.mts diff --git a/src/version3/parameters/getAllStatuses.ts b/src/version3/parameters/getAllStatuses.mts similarity index 100% rename from src/version3/parameters/getAllStatuses.ts rename to src/version3/parameters/getAllStatuses.mts diff --git a/src/version3/parameters/getAllSystemAvatars.ts b/src/version3/parameters/getAllSystemAvatars.mts similarity index 100% rename from src/version3/parameters/getAllSystemAvatars.ts rename to src/version3/parameters/getAllSystemAvatars.mts diff --git a/src/version3/parameters/getAllUsers.ts b/src/version3/parameters/getAllUsers.mts similarity index 100% rename from src/version3/parameters/getAllUsers.ts rename to src/version3/parameters/getAllUsers.mts diff --git a/src/version3/parameters/getAllUsersDefault.ts b/src/version3/parameters/getAllUsersDefault.mts similarity index 100% rename from src/version3/parameters/getAllUsersDefault.ts rename to src/version3/parameters/getAllUsersDefault.mts diff --git a/src/version3/parameters/getAllWorkflowSchemes.ts b/src/version3/parameters/getAllWorkflowSchemes.mts similarity index 100% rename from src/version3/parameters/getAllWorkflowSchemes.ts rename to src/version3/parameters/getAllWorkflowSchemes.mts diff --git a/src/version3/parameters/getAlternativeIssueTypes.ts b/src/version3/parameters/getAlternativeIssueTypes.mts similarity index 100% rename from src/version3/parameters/getAlternativeIssueTypes.ts rename to src/version3/parameters/getAlternativeIssueTypes.mts diff --git a/src/version3/parameters/getApplicationProperty.ts b/src/version3/parameters/getApplicationProperty.mts similarity index 100% rename from src/version3/parameters/getApplicationProperty.ts rename to src/version3/parameters/getApplicationProperty.mts diff --git a/src/version3/parameters/getApplicationRole.ts b/src/version3/parameters/getApplicationRole.mts similarity index 100% rename from src/version3/parameters/getApplicationRole.ts rename to src/version3/parameters/getApplicationRole.mts diff --git a/src/version3/parameters/getAssignedPermissionScheme.ts b/src/version3/parameters/getAssignedPermissionScheme.mts similarity index 100% rename from src/version3/parameters/getAssignedPermissionScheme.ts rename to src/version3/parameters/getAssignedPermissionScheme.mts diff --git a/src/version3/parameters/getAttachment.ts b/src/version3/parameters/getAttachment.mts similarity index 100% rename from src/version3/parameters/getAttachment.ts rename to src/version3/parameters/getAttachment.mts diff --git a/src/version3/parameters/getAttachmentContent.ts b/src/version3/parameters/getAttachmentContent.mts similarity index 100% rename from src/version3/parameters/getAttachmentContent.ts rename to src/version3/parameters/getAttachmentContent.mts diff --git a/src/version3/parameters/getAttachmentThumbnail.ts b/src/version3/parameters/getAttachmentThumbnail.mts similarity index 100% rename from src/version3/parameters/getAttachmentThumbnail.ts rename to src/version3/parameters/getAttachmentThumbnail.mts diff --git a/src/version3/parameters/getAuditRecords.ts b/src/version3/parameters/getAuditRecords.mts similarity index 100% rename from src/version3/parameters/getAuditRecords.ts rename to src/version3/parameters/getAuditRecords.mts diff --git a/src/version3/parameters/getAutoCompletePost.mts b/src/version3/parameters/getAutoCompletePost.mts new file mode 100644 index 0000000000..c405f2bce4 --- /dev/null +++ b/src/version3/parameters/getAutoCompletePost.mts @@ -0,0 +1,3 @@ +import { SearchAutoCompleteFilter } from '../models/index.mjs'; + +export interface GetAutoCompletePost extends SearchAutoCompleteFilter {} diff --git a/src/version3/parameters/getAutoCompletePost.ts b/src/version3/parameters/getAutoCompletePost.ts deleted file mode 100644 index e3a74840ff..0000000000 --- a/src/version3/parameters/getAutoCompletePost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SearchAutoCompleteFilter } from '../models'; - -export interface GetAutoCompletePost extends SearchAutoCompleteFilter {} diff --git a/src/version3/parameters/getAvailableScreenFields.ts b/src/version3/parameters/getAvailableScreenFields.mts similarity index 100% rename from src/version3/parameters/getAvailableScreenFields.ts rename to src/version3/parameters/getAvailableScreenFields.mts diff --git a/src/version3/parameters/getAvatarImageByID.ts b/src/version3/parameters/getAvatarImageByID.mts similarity index 100% rename from src/version3/parameters/getAvatarImageByID.ts rename to src/version3/parameters/getAvatarImageByID.mts diff --git a/src/version3/parameters/getAvatarImageByOwner.ts b/src/version3/parameters/getAvatarImageByOwner.mts similarity index 100% rename from src/version3/parameters/getAvatarImageByOwner.ts rename to src/version3/parameters/getAvatarImageByOwner.mts diff --git a/src/version3/parameters/getAvatarImageByType.ts b/src/version3/parameters/getAvatarImageByType.mts similarity index 100% rename from src/version3/parameters/getAvatarImageByType.ts rename to src/version3/parameters/getAvatarImageByType.mts diff --git a/src/version3/parameters/getAvatars.ts b/src/version3/parameters/getAvatars.mts similarity index 100% rename from src/version3/parameters/getAvatars.ts rename to src/version3/parameters/getAvatars.mts diff --git a/src/version3/parameters/getBulkPermissions.mts b/src/version3/parameters/getBulkPermissions.mts new file mode 100644 index 0000000000..e8f2374195 --- /dev/null +++ b/src/version3/parameters/getBulkPermissions.mts @@ -0,0 +1,3 @@ +import { BulkPermissionsRequest } from '../models/index.mjs'; + +export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version3/parameters/getBulkPermissions.ts b/src/version3/parameters/getBulkPermissions.ts deleted file mode 100644 index ea93607d8e..0000000000 --- a/src/version3/parameters/getBulkPermissions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { BulkPermissionsRequest } from '../models'; - -export interface GetBulkPermissions extends BulkPermissionsRequest {} diff --git a/src/version3/parameters/getChangeLogs.ts b/src/version3/parameters/getChangeLogs.mts similarity index 100% rename from src/version3/parameters/getChangeLogs.ts rename to src/version3/parameters/getChangeLogs.mts diff --git a/src/version3/parameters/getChangeLogsByIds.mts b/src/version3/parameters/getChangeLogsByIds.mts new file mode 100644 index 0000000000..873e9d688e --- /dev/null +++ b/src/version3/parameters/getChangeLogsByIds.mts @@ -0,0 +1,6 @@ +import { IssueChangelogIds } from '../models/index.mjs'; + +export interface GetChangeLogsByIds extends IssueChangelogIds { + /** The ID or key of the issue. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/getChangeLogsByIds.ts b/src/version3/parameters/getChangeLogsByIds.ts deleted file mode 100644 index 447fc302f6..0000000000 --- a/src/version3/parameters/getChangeLogsByIds.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueChangelogIds } from '../models'; - -export interface GetChangeLogsByIds extends IssueChangelogIds { - /** The ID or key of the issue. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/getColumns.ts b/src/version3/parameters/getColumns.mts similarity index 100% rename from src/version3/parameters/getColumns.ts rename to src/version3/parameters/getColumns.mts diff --git a/src/version3/parameters/getComment.ts b/src/version3/parameters/getComment.mts similarity index 100% rename from src/version3/parameters/getComment.ts rename to src/version3/parameters/getComment.mts diff --git a/src/version3/parameters/getCommentProperty.ts b/src/version3/parameters/getCommentProperty.mts similarity index 100% rename from src/version3/parameters/getCommentProperty.ts rename to src/version3/parameters/getCommentProperty.mts diff --git a/src/version3/parameters/getCommentPropertyKeys.ts b/src/version3/parameters/getCommentPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getCommentPropertyKeys.ts rename to src/version3/parameters/getCommentPropertyKeys.mts diff --git a/src/version3/parameters/getComments.ts b/src/version3/parameters/getComments.mts similarity index 100% rename from src/version3/parameters/getComments.ts rename to src/version3/parameters/getComments.mts diff --git a/src/version3/parameters/getCommentsByIds.mts b/src/version3/parameters/getCommentsByIds.mts new file mode 100644 index 0000000000..1ebd9687c9 --- /dev/null +++ b/src/version3/parameters/getCommentsByIds.mts @@ -0,0 +1,12 @@ +import { IssueCommentListRequest } from '../models/index.mjs'; + +export interface GetCommentsByIds extends IssueCommentListRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `renderedBody` Returns the comment body rendered in HTML. + * - `properties` Returns the comment's properties. + */ + expand?: 'renderedBody' | 'properties' | string | string[]; +} diff --git a/src/version3/parameters/getCommentsByIds.ts b/src/version3/parameters/getCommentsByIds.ts deleted file mode 100644 index eb60bc65b0..0000000000 --- a/src/version3/parameters/getCommentsByIds.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { IssueCommentListRequest } from '../models'; - -export interface GetCommentsByIds extends IssueCommentListRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `renderedBody` Returns the comment body rendered in HTML. - * - `properties` Returns the comment's properties. - */ - expand?: 'renderedBody' | 'properties' | string | string[]; -} diff --git a/src/version3/parameters/getComponent.ts b/src/version3/parameters/getComponent.mts similarity index 100% rename from src/version3/parameters/getComponent.ts rename to src/version3/parameters/getComponent.mts diff --git a/src/version3/parameters/getComponentRelatedIssues.ts b/src/version3/parameters/getComponentRelatedIssues.mts similarity index 100% rename from src/version3/parameters/getComponentRelatedIssues.ts rename to src/version3/parameters/getComponentRelatedIssues.mts diff --git a/src/version3/parameters/getContextsForField.ts b/src/version3/parameters/getContextsForField.mts similarity index 100% rename from src/version3/parameters/getContextsForField.ts rename to src/version3/parameters/getContextsForField.mts diff --git a/src/version3/parameters/getCreateIssueMeta.ts b/src/version3/parameters/getCreateIssueMeta.mts similarity index 100% rename from src/version3/parameters/getCreateIssueMeta.ts rename to src/version3/parameters/getCreateIssueMeta.mts diff --git a/src/version3/parameters/getCurrentUser.ts b/src/version3/parameters/getCurrentUser.mts similarity index 100% rename from src/version3/parameters/getCurrentUser.ts rename to src/version3/parameters/getCurrentUser.mts diff --git a/src/version3/parameters/getCustomFieldConfiguration.ts b/src/version3/parameters/getCustomFieldConfiguration.mts similarity index 100% rename from src/version3/parameters/getCustomFieldConfiguration.ts rename to src/version3/parameters/getCustomFieldConfiguration.mts diff --git a/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts b/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts new file mode 100644 index 0000000000..7cd7300856 --- /dev/null +++ b/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.mts @@ -0,0 +1,10 @@ +import { ProjectIssueTypeMappings } from '../models/index.mjs'; + +export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { + /** The ID of the custom field. */ + fieldId: 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/getCustomFieldContextsForProjectsAndIssueTypes.ts b/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts deleted file mode 100644 index 66d6df991e..0000000000 --- a/src/version3/parameters/getCustomFieldContextsForProjectsAndIssueTypes.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ProjectIssueTypeMappings } from '../models'; - -export interface GetCustomFieldContextsForProjectsAndIssueTypes extends ProjectIssueTypeMappings { - /** The ID of the custom field. */ - fieldId: 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/getCustomFieldOption.ts b/src/version3/parameters/getCustomFieldOption.mts similarity index 100% rename from src/version3/parameters/getCustomFieldOption.ts rename to src/version3/parameters/getCustomFieldOption.mts diff --git a/src/version3/parameters/getDashboard.ts b/src/version3/parameters/getDashboard.mts similarity index 100% rename from src/version3/parameters/getDashboard.ts rename to src/version3/parameters/getDashboard.mts diff --git a/src/version3/parameters/getDashboardItemProperty.ts b/src/version3/parameters/getDashboardItemProperty.mts similarity index 100% rename from src/version3/parameters/getDashboardItemProperty.ts rename to src/version3/parameters/getDashboardItemProperty.mts diff --git a/src/version3/parameters/getDashboardItemPropertyKeys.ts b/src/version3/parameters/getDashboardItemPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getDashboardItemPropertyKeys.ts rename to src/version3/parameters/getDashboardItemPropertyKeys.mts diff --git a/src/version3/parameters/getDashboardsPaginated.ts b/src/version3/parameters/getDashboardsPaginated.mts similarity index 100% rename from src/version3/parameters/getDashboardsPaginated.ts rename to src/version3/parameters/getDashboardsPaginated.mts diff --git a/src/version3/parameters/getDefaultValues.ts b/src/version3/parameters/getDefaultValues.mts similarity index 100% rename from src/version3/parameters/getDefaultValues.ts rename to src/version3/parameters/getDefaultValues.mts diff --git a/src/version3/parameters/getDefaultWorkflow.ts b/src/version3/parameters/getDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/getDefaultWorkflow.ts rename to src/version3/parameters/getDefaultWorkflow.mts diff --git a/src/version3/parameters/getDraftDefaultWorkflow.ts b/src/version3/parameters/getDraftDefaultWorkflow.mts similarity index 100% rename from src/version3/parameters/getDraftDefaultWorkflow.ts rename to src/version3/parameters/getDraftDefaultWorkflow.mts diff --git a/src/version3/parameters/getDraftWorkflow.ts b/src/version3/parameters/getDraftWorkflow.mts similarity index 100% rename from src/version3/parameters/getDraftWorkflow.ts rename to src/version3/parameters/getDraftWorkflow.mts diff --git a/src/version3/parameters/getDynamicWebhooksForApp.ts b/src/version3/parameters/getDynamicWebhooksForApp.mts similarity index 100% rename from src/version3/parameters/getDynamicWebhooksForApp.ts rename to src/version3/parameters/getDynamicWebhooksForApp.mts diff --git a/src/version3/parameters/getEditIssueMeta.ts b/src/version3/parameters/getEditIssueMeta.mts similarity index 100% rename from src/version3/parameters/getEditIssueMeta.ts rename to src/version3/parameters/getEditIssueMeta.mts diff --git a/src/version3/parameters/getFailedWebhooks.ts b/src/version3/parameters/getFailedWebhooks.mts similarity index 100% rename from src/version3/parameters/getFailedWebhooks.ts rename to src/version3/parameters/getFailedWebhooks.mts diff --git a/src/version3/parameters/getFavouriteFilters.ts b/src/version3/parameters/getFavouriteFilters.mts similarity index 100% rename from src/version3/parameters/getFavouriteFilters.ts rename to src/version3/parameters/getFavouriteFilters.mts diff --git a/src/version3/parameters/getFeaturesForProject.ts b/src/version3/parameters/getFeaturesForProject.mts similarity index 100% rename from src/version3/parameters/getFeaturesForProject.ts rename to src/version3/parameters/getFeaturesForProject.mts diff --git a/src/version3/parameters/getFieldAutoCompleteForQueryString.ts b/src/version3/parameters/getFieldAutoCompleteForQueryString.mts similarity index 100% rename from src/version3/parameters/getFieldAutoCompleteForQueryString.ts rename to src/version3/parameters/getFieldAutoCompleteForQueryString.mts diff --git a/src/version3/parameters/getFieldConfigurationItems.ts b/src/version3/parameters/getFieldConfigurationItems.mts similarity index 100% rename from src/version3/parameters/getFieldConfigurationItems.ts rename to src/version3/parameters/getFieldConfigurationItems.mts diff --git a/src/version3/parameters/getFieldConfigurationSchemeMappings.ts b/src/version3/parameters/getFieldConfigurationSchemeMappings.mts similarity index 100% rename from src/version3/parameters/getFieldConfigurationSchemeMappings.ts rename to src/version3/parameters/getFieldConfigurationSchemeMappings.mts diff --git a/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.mts similarity index 100% rename from src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts rename to src/version3/parameters/getFieldConfigurationSchemeProjectMapping.mts diff --git a/src/version3/parameters/getFieldsPaginated.ts b/src/version3/parameters/getFieldsPaginated.mts similarity index 100% rename from src/version3/parameters/getFieldsPaginated.ts rename to src/version3/parameters/getFieldsPaginated.mts diff --git a/src/version3/parameters/getFilter.ts b/src/version3/parameters/getFilter.mts similarity index 100% rename from src/version3/parameters/getFilter.ts rename to src/version3/parameters/getFilter.mts diff --git a/src/version3/parameters/getFiltersPaginated.mts b/src/version3/parameters/getFiltersPaginated.mts new file mode 100644 index 0000000000..fd008ddc8a --- /dev/null +++ b/src/version3/parameters/getFiltersPaginated.mts @@ -0,0 +1,114 @@ +export interface GetFiltersPaginated { + /** String used to perform a case-insensitive partial match with `name`. */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with + * `owner`. + */ + accountId?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns + * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used + * with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This + * parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#ordering) the results by a field: + * + * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to + * display the description field is in use. + * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * - `is_favourite` Sorts by whether the filter is marked as a favorite. + * - `id` Sorts by filter ID. + * - `name` Sorts by filter name. + * - `owner` Sorts by the ID of the filter owner. + * - `is_shared` Sorts by whether the filter is shared. + */ + orderBy?: + | 'description' + | '-description' + | '+description' + | 'favourite_count' + | '-favourite_count' + | '+favourite_count' + | 'id' + | '-id' + | '+id' + | 'is_favourite' + | '-is_favourite' + | '+is_favourite' + | 'name' + | '-name' + | '+name' + | 'owner' + | '-owner' + | '+owner' + | 'is_shared' + | '-is_shared' + | '+is_shared' + | 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; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `description` Returns the description of the filter. + * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * - `jql` Returns the Jql query that the filter uses. + * - `owner` Returns the owner of the filter. + * - `searchUrl` Returns a URL to perform the filter's Jql query. + * - `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. + * - `subscriptions` Returns the users that are subscribed to the filter. + * - `viewUrl` Returns a URL to view the filter. + */ + expand?: + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + | ( + | 'description' + | 'favourite' + | 'favouritedCount' + | 'jql' + | 'owner' + | 'searchUrl' + | 'sharePermissions' + | 'editPermissions' + | 'isWritable' + | 'subscriptions' + | 'viewUrl' + )[] + | string + | string[]; + /** + * 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; +} diff --git a/src/version3/parameters/getFiltersPaginated.ts b/src/version3/parameters/getFiltersPaginated.ts deleted file mode 100644 index f60612cb52..0000000000 --- a/src/version3/parameters/getFiltersPaginated.ts +++ /dev/null @@ -1,114 +0,0 @@ -export interface GetFiltersPaginated { - /** String used to perform a case-insensitive partial match with `name`. */ - filterName?: string; - /** - * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with - * `owner`. - */ - accountId?: string; - /** - * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns - * filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used - * with the `groupId` parameter. - */ - groupname?: string; - /** - * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This - * parameter cannot be used with the `groupname` parameter. - */ - groupId?: string; - /** Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. */ - projectId?: number; - /** - * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, - * `id=10000&id=10001`. Do not exceed 200 filter IDs. - */ - id?: number[]; - /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#ordering) the results by a field: - * - * - `description` Sorts by filter description. Note that this sorting works independently of whether the expand to - * display the description field is in use. - * - `favourite_count` Sorts by the count of how many users have this filter as a favorite. - * - `is_favourite` Sorts by whether the filter is marked as a favorite. - * - `id` Sorts by filter ID. - * - `name` Sorts by filter name. - * - `owner` Sorts by the ID of the filter owner. - * - `is_shared` Sorts by whether the filter is shared. - */ - orderBy?: - | 'description' - | '-description' - | '+description' - | 'favourite_count' - | '-favourite_count' - | '+favourite_count' - | 'id' - | '-id' - | '+id' - | 'is_favourite' - | '-is_favourite' - | '+is_favourite' - | 'name' - | '-name' - | '+name' - | 'owner' - | '-owner' - | '+owner' - | 'is_shared' - | '-is_shared' - | '+is_shared' - | 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; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `description` Returns the description of the filter. - * - `favourite` Returns an indicator of whether the user has set the filter as a favorite. - * - `favouritedCount` Returns a count of how many users have set this filter as a favorite. - * - `jql` Returns the JQL query that the filter uses. - * - `owner` Returns the owner of the filter. - * - `searchUrl` Returns a URL to perform the filter's JQL query. - * - `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. - * - `subscriptions` Returns the users that are subscribed to the filter. - * - `viewUrl` Returns a URL to view the filter. - */ - expand?: - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - | ( - | 'description' - | 'favourite' - | 'favouritedCount' - | 'jql' - | 'owner' - | 'searchUrl' - | 'sharePermissions' - | 'editPermissions' - | 'isWritable' - | 'subscriptions' - | 'viewUrl' - )[] - | string - | string[]; - /** - * 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; -} diff --git a/src/version3/parameters/getHierarchy.ts b/src/version3/parameters/getHierarchy.mts similarity index 100% rename from src/version3/parameters/getHierarchy.ts rename to src/version3/parameters/getHierarchy.mts diff --git a/src/version3/parameters/getIdsOfWorklogsDeletedSince.ts b/src/version3/parameters/getIdsOfWorklogsDeletedSince.mts similarity index 100% rename from src/version3/parameters/getIdsOfWorklogsDeletedSince.ts rename to src/version3/parameters/getIdsOfWorklogsDeletedSince.mts diff --git a/src/version3/parameters/getIdsOfWorklogsModifiedSince.ts b/src/version3/parameters/getIdsOfWorklogsModifiedSince.mts similarity index 100% rename from src/version3/parameters/getIdsOfWorklogsModifiedSince.ts rename to src/version3/parameters/getIdsOfWorklogsModifiedSince.mts diff --git a/src/version3/parameters/getIsWatchingIssueBulk.mts b/src/version3/parameters/getIsWatchingIssueBulk.mts new file mode 100644 index 0000000000..3616bfd382 --- /dev/null +++ b/src/version3/parameters/getIsWatchingIssueBulk.mts @@ -0,0 +1,3 @@ +import { IssueList } from '../models/index.mjs'; + +export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version3/parameters/getIsWatchingIssueBulk.ts b/src/version3/parameters/getIsWatchingIssueBulk.ts deleted file mode 100644 index dfa25fdf72..0000000000 --- a/src/version3/parameters/getIsWatchingIssueBulk.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueList } from '../models'; - -export interface GetIsWatchingIssueBulk extends IssueList {} diff --git a/src/version3/parameters/getIssue.mts b/src/version3/parameters/getIssue.mts new file mode 100644 index 0000000000..7cbeb1415f --- /dev/null +++ b/src/version3/parameters/getIssue.mts @@ -0,0 +1,72 @@ +export interface GetIssue { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a + * subset of fields. Allowed values: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to exclude. + * + * Examples: + * + * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except + * description. `*navigable,-comment` Returns all navigable fields except comment. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + * + * Note: All fields are returned by default. This differs from [Search for issues using Jql + * (GET)](#api-rest-api-3-search-get) and [Search for issues using Jql (POST)](#api-rest-api-3-search-post) where the + * default is all navigable fields. + */ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been + * added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about the 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. + * - `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` Returns a JSON array for each version of a field's value, with the highest number + * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. + */ + expand?: + | 'renderedFields' + | 'name' + | 'schema' + | 'transitions' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ('renderedFields' | 'name' | 'schema' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] + | string + | string[]; + /** + * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + * + * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. + * + * Examples: + * + * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` + * and `prop2` properties. + * + * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. + */ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown + * under **Projects** in Jira. This also populates the [Jql issues search](#api-rest-api-3-search-get) `lastViewed` + * field. + */ + updateHistory?: boolean; +} diff --git a/src/version3/parameters/getIssue.ts b/src/version3/parameters/getIssue.ts deleted file mode 100644 index a85fabe0e4..0000000000 --- a/src/version3/parameters/getIssue.ts +++ /dev/null @@ -1,72 +0,0 @@ -export interface GetIssue { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** - * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a - * subset of fields. Allowed values: - * - * - `*all` Returns all fields. - * - `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to exclude. - * - * Examples: - * - * `summary,comment` Returns only the summary and comments fields. `-description` Returns all (default) fields except - * description. `*navigable,-comment` Returns all navigable fields except comment. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. - * - * Note: All fields are returned by default. This differs from [Search for issues using JQL - * (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the - * default is all navigable fields. - */ - fields?: string[]; - /** - * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been - * added by a connect app and a field's key may differ from its ID. - */ - fieldsByKeys?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about the 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. - * - `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` Returns a JSON array for each version of a field's value, with the highest number - * representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. - */ - expand?: - | 'renderedFields' - | 'name' - | 'schema' - | 'transitions' - | 'editmeta' - | 'changelog' - | 'versionedRepresentations' - | ('renderedFields' | 'name' | 'schema' | 'transitions' | 'editmeta' | 'changelog' | 'versionedRepresentations')[] - | string - | string[]; - /** - * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: - * - * `*all` Returns all issue properties. Any issue property key, prefixed with a minus to exclude. - * - * Examples: - * - * `*all` Returns all properties. `*all,-prop1` Returns all properties except `prop1`. `prop1,prop2` Returns `prop1` - * and `prop2` properties. - * - * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. - */ - properties?: string[]; - /** - * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown - * under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` - * field. - */ - updateHistory?: boolean; -} diff --git a/src/version3/parameters/getIssueFieldOption.ts b/src/version3/parameters/getIssueFieldOption.mts similarity index 100% rename from src/version3/parameters/getIssueFieldOption.ts rename to src/version3/parameters/getIssueFieldOption.mts diff --git a/src/version3/parameters/getIssueLink.ts b/src/version3/parameters/getIssueLink.mts similarity index 100% rename from src/version3/parameters/getIssueLink.ts rename to src/version3/parameters/getIssueLink.mts diff --git a/src/version3/parameters/getIssueLinkType.ts b/src/version3/parameters/getIssueLinkType.mts similarity index 100% rename from src/version3/parameters/getIssueLinkType.ts rename to src/version3/parameters/getIssueLinkType.mts diff --git a/src/version3/parameters/getIssuePickerResource.mts b/src/version3/parameters/getIssuePickerResource.mts new file mode 100644 index 0000000000..aed2154c1f --- /dev/null +++ b/src/version3/parameters/getIssuePickerResource.mts @@ -0,0 +1,23 @@ +export interface GetIssuePickerResource { + /** A string to match against text fields in the issue such as title, description, or comments. */ + query?: string; + /** + * A Jql query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be + * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform + * this query. + */ + currentIssueKey?: string; + /** The ID of a project that suggested issues must belong to. */ + currentProjectId?: string; + /** Indicate whether to include subtasks in the suggestions list. */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the + * query. + */ + showSubTaskParent?: boolean; +} diff --git a/src/version3/parameters/getIssuePickerResource.ts b/src/version3/parameters/getIssuePickerResource.ts deleted file mode 100644 index 762048d325..0000000000 --- a/src/version3/parameters/getIssuePickerResource.ts +++ /dev/null @@ -1,23 +0,0 @@ -export interface GetIssuePickerResource { - /** A string to match against text fields in the issue such as title, description, or comments. */ - query?: string; - /** - * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be - * used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. - */ - currentJQL?: string; - /** - * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform - * this query. - */ - currentIssueKey?: string; - /** The ID of a project that suggested issues must belong to. */ - currentProjectId?: string; - /** Indicate whether to include subtasks in the suggestions list. */ - showSubTasks?: boolean; - /** - * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the - * query. - */ - showSubTaskParent?: boolean; -} diff --git a/src/version3/parameters/getIssueProperty.ts b/src/version3/parameters/getIssueProperty.mts similarity index 100% rename from src/version3/parameters/getIssueProperty.ts rename to src/version3/parameters/getIssueProperty.mts diff --git a/src/version3/parameters/getIssuePropertyKeys.ts b/src/version3/parameters/getIssuePropertyKeys.mts similarity index 100% rename from src/version3/parameters/getIssuePropertyKeys.ts rename to src/version3/parameters/getIssuePropertyKeys.mts diff --git a/src/version3/parameters/getIssueSecurityLevel.ts b/src/version3/parameters/getIssueSecurityLevel.mts similarity index 100% rename from src/version3/parameters/getIssueSecurityLevel.ts rename to src/version3/parameters/getIssueSecurityLevel.mts diff --git a/src/version3/parameters/getIssueSecurityLevelMembers.ts b/src/version3/parameters/getIssueSecurityLevelMembers.mts similarity index 100% rename from src/version3/parameters/getIssueSecurityLevelMembers.ts rename to src/version3/parameters/getIssueSecurityLevelMembers.mts diff --git a/src/version3/parameters/getIssueSecurityScheme.ts b/src/version3/parameters/getIssueSecurityScheme.mts similarity index 100% rename from src/version3/parameters/getIssueSecurityScheme.ts rename to src/version3/parameters/getIssueSecurityScheme.mts diff --git a/src/version3/parameters/getIssueType.ts b/src/version3/parameters/getIssueType.mts similarity index 100% rename from src/version3/parameters/getIssueType.ts rename to src/version3/parameters/getIssueType.mts diff --git a/src/version3/parameters/getIssueTypeMappingsForContexts.ts b/src/version3/parameters/getIssueTypeMappingsForContexts.mts similarity index 100% rename from src/version3/parameters/getIssueTypeMappingsForContexts.ts rename to src/version3/parameters/getIssueTypeMappingsForContexts.mts diff --git a/src/version3/parameters/getIssueTypeProperty.ts b/src/version3/parameters/getIssueTypeProperty.mts similarity index 100% rename from src/version3/parameters/getIssueTypeProperty.ts rename to src/version3/parameters/getIssueTypeProperty.mts diff --git a/src/version3/parameters/getIssueTypePropertyKeys.ts b/src/version3/parameters/getIssueTypePropertyKeys.mts similarity index 100% rename from src/version3/parameters/getIssueTypePropertyKeys.ts rename to src/version3/parameters/getIssueTypePropertyKeys.mts diff --git a/src/version3/parameters/getIssueTypeSchemeForProjects.ts b/src/version3/parameters/getIssueTypeSchemeForProjects.mts similarity index 100% rename from src/version3/parameters/getIssueTypeSchemeForProjects.ts rename to src/version3/parameters/getIssueTypeSchemeForProjects.mts diff --git a/src/version3/parameters/getIssueTypeSchemesMapping.ts b/src/version3/parameters/getIssueTypeSchemesMapping.mts similarity index 100% rename from src/version3/parameters/getIssueTypeSchemesMapping.ts rename to src/version3/parameters/getIssueTypeSchemesMapping.mts diff --git a/src/version3/parameters/getIssueTypeScreenSchemeMappings.ts b/src/version3/parameters/getIssueTypeScreenSchemeMappings.mts similarity index 100% rename from src/version3/parameters/getIssueTypeScreenSchemeMappings.ts rename to src/version3/parameters/getIssueTypeScreenSchemeMappings.mts diff --git a/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.mts similarity index 100% rename from src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts rename to src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.mts diff --git a/src/version3/parameters/getIssueTypeScreenSchemes.ts b/src/version3/parameters/getIssueTypeScreenSchemes.mts similarity index 100% rename from src/version3/parameters/getIssueTypeScreenSchemes.ts rename to src/version3/parameters/getIssueTypeScreenSchemes.mts diff --git a/src/version3/parameters/getIssueTypesForProject.ts b/src/version3/parameters/getIssueTypesForProject.mts similarity index 100% rename from src/version3/parameters/getIssueTypesForProject.ts rename to src/version3/parameters/getIssueTypesForProject.mts diff --git a/src/version3/parameters/getIssueWatchers.ts b/src/version3/parameters/getIssueWatchers.mts similarity index 100% rename from src/version3/parameters/getIssueWatchers.ts rename to src/version3/parameters/getIssueWatchers.mts diff --git a/src/version3/parameters/getIssueWorklog.ts b/src/version3/parameters/getIssueWorklog.mts similarity index 100% rename from src/version3/parameters/getIssueWorklog.ts rename to src/version3/parameters/getIssueWorklog.mts diff --git a/src/version3/parameters/getMyFilters.ts b/src/version3/parameters/getMyFilters.mts similarity index 100% rename from src/version3/parameters/getMyFilters.ts rename to src/version3/parameters/getMyFilters.mts diff --git a/src/version3/parameters/getMyPermissions.ts b/src/version3/parameters/getMyPermissions.mts similarity index 100% rename from src/version3/parameters/getMyPermissions.ts rename to src/version3/parameters/getMyPermissions.mts diff --git a/src/version3/parameters/getNotificationScheme.ts b/src/version3/parameters/getNotificationScheme.mts similarity index 100% rename from src/version3/parameters/getNotificationScheme.ts rename to src/version3/parameters/getNotificationScheme.mts diff --git a/src/version3/parameters/getNotificationSchemeToProjectMappings.ts b/src/version3/parameters/getNotificationSchemeToProjectMappings.mts similarity index 100% rename from src/version3/parameters/getNotificationSchemeToProjectMappings.ts rename to src/version3/parameters/getNotificationSchemeToProjectMappings.mts diff --git a/src/version3/parameters/getNotificationSchemes.ts b/src/version3/parameters/getNotificationSchemes.mts similarity index 100% rename from src/version3/parameters/getNotificationSchemes.ts rename to src/version3/parameters/getNotificationSchemes.mts diff --git a/src/version3/parameters/getOptionsForContext.ts b/src/version3/parameters/getOptionsForContext.mts similarity index 100% rename from src/version3/parameters/getOptionsForContext.ts rename to src/version3/parameters/getOptionsForContext.mts diff --git a/src/version3/parameters/getPermissionScheme.ts b/src/version3/parameters/getPermissionScheme.mts similarity index 100% rename from src/version3/parameters/getPermissionScheme.ts rename to src/version3/parameters/getPermissionScheme.mts diff --git a/src/version3/parameters/getPermissionSchemeGrant.ts b/src/version3/parameters/getPermissionSchemeGrant.mts similarity index 100% rename from src/version3/parameters/getPermissionSchemeGrant.ts rename to src/version3/parameters/getPermissionSchemeGrant.mts diff --git a/src/version3/parameters/getPermissionSchemeGrants.ts b/src/version3/parameters/getPermissionSchemeGrants.mts similarity index 100% rename from src/version3/parameters/getPermissionSchemeGrants.ts rename to src/version3/parameters/getPermissionSchemeGrants.mts diff --git a/src/version3/parameters/getPermittedProjects.mts b/src/version3/parameters/getPermittedProjects.mts new file mode 100644 index 0000000000..8f40964759 --- /dev/null +++ b/src/version3/parameters/getPermittedProjects.mts @@ -0,0 +1,3 @@ +import { PermissionsKeys } from '../models/index.mjs'; + +export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version3/parameters/getPermittedProjects.ts b/src/version3/parameters/getPermittedProjects.ts deleted file mode 100644 index 828831afb8..0000000000 --- a/src/version3/parameters/getPermittedProjects.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { PermissionsKeys } from '../models'; - -export interface GetPermittedProjects extends PermissionsKeys {} diff --git a/src/version3/parameters/getPrecomputations.ts b/src/version3/parameters/getPrecomputations.mts similarity index 100% rename from src/version3/parameters/getPrecomputations.ts rename to src/version3/parameters/getPrecomputations.mts diff --git a/src/version3/parameters/getPreference.ts b/src/version3/parameters/getPreference.mts similarity index 100% rename from src/version3/parameters/getPreference.ts rename to src/version3/parameters/getPreference.mts diff --git a/src/version3/parameters/getPriority.ts b/src/version3/parameters/getPriority.mts similarity index 100% rename from src/version3/parameters/getPriority.ts rename to src/version3/parameters/getPriority.mts diff --git a/src/version3/parameters/getProject.ts b/src/version3/parameters/getProject.mts similarity index 100% rename from src/version3/parameters/getProject.ts rename to src/version3/parameters/getProject.mts diff --git a/src/version3/parameters/getProjectCategoryById.ts b/src/version3/parameters/getProjectCategoryById.mts similarity index 100% rename from src/version3/parameters/getProjectCategoryById.ts rename to src/version3/parameters/getProjectCategoryById.mts diff --git a/src/version3/parameters/getProjectComponents.ts b/src/version3/parameters/getProjectComponents.mts similarity index 100% rename from src/version3/parameters/getProjectComponents.ts rename to src/version3/parameters/getProjectComponents.mts diff --git a/src/version3/parameters/getProjectComponentsPaginated.ts b/src/version3/parameters/getProjectComponentsPaginated.mts similarity index 100% rename from src/version3/parameters/getProjectComponentsPaginated.ts rename to src/version3/parameters/getProjectComponentsPaginated.mts diff --git a/src/version3/parameters/getProjectContextMapping.ts b/src/version3/parameters/getProjectContextMapping.mts similarity index 100% rename from src/version3/parameters/getProjectContextMapping.ts rename to src/version3/parameters/getProjectContextMapping.mts diff --git a/src/version3/parameters/getProjectEmail.ts b/src/version3/parameters/getProjectEmail.mts similarity index 100% rename from src/version3/parameters/getProjectEmail.ts rename to src/version3/parameters/getProjectEmail.mts diff --git a/src/version3/parameters/getProjectIssueSecurityScheme.ts b/src/version3/parameters/getProjectIssueSecurityScheme.mts similarity index 100% rename from src/version3/parameters/getProjectIssueSecurityScheme.ts rename to src/version3/parameters/getProjectIssueSecurityScheme.mts diff --git a/src/version3/parameters/getProjectProperty.ts b/src/version3/parameters/getProjectProperty.mts similarity index 100% rename from src/version3/parameters/getProjectProperty.ts rename to src/version3/parameters/getProjectProperty.mts diff --git a/src/version3/parameters/getProjectPropertyKeys.ts b/src/version3/parameters/getProjectPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getProjectPropertyKeys.ts rename to src/version3/parameters/getProjectPropertyKeys.mts diff --git a/src/version3/parameters/getProjectRole.ts b/src/version3/parameters/getProjectRole.mts similarity index 100% rename from src/version3/parameters/getProjectRole.ts rename to src/version3/parameters/getProjectRole.mts diff --git a/src/version3/parameters/getProjectRoleActorsForRole.ts b/src/version3/parameters/getProjectRoleActorsForRole.mts similarity index 100% rename from src/version3/parameters/getProjectRoleActorsForRole.ts rename to src/version3/parameters/getProjectRoleActorsForRole.mts diff --git a/src/version3/parameters/getProjectRoleById.ts b/src/version3/parameters/getProjectRoleById.mts similarity index 100% rename from src/version3/parameters/getProjectRoleById.ts rename to src/version3/parameters/getProjectRoleById.mts diff --git a/src/version3/parameters/getProjectRoleDetails.ts b/src/version3/parameters/getProjectRoleDetails.mts similarity index 100% rename from src/version3/parameters/getProjectRoleDetails.ts rename to src/version3/parameters/getProjectRoleDetails.mts diff --git a/src/version3/parameters/getProjectRoles.ts b/src/version3/parameters/getProjectRoles.mts similarity index 100% rename from src/version3/parameters/getProjectRoles.ts rename to src/version3/parameters/getProjectRoles.mts diff --git a/src/version3/parameters/getProjectTypeByKey.ts b/src/version3/parameters/getProjectTypeByKey.mts similarity index 100% rename from src/version3/parameters/getProjectTypeByKey.ts rename to src/version3/parameters/getProjectTypeByKey.mts diff --git a/src/version3/parameters/getProjectVersions.ts b/src/version3/parameters/getProjectVersions.mts similarity index 100% rename from src/version3/parameters/getProjectVersions.ts rename to src/version3/parameters/getProjectVersions.mts diff --git a/src/version3/parameters/getProjectVersionsPaginated.ts b/src/version3/parameters/getProjectVersionsPaginated.mts similarity index 100% rename from src/version3/parameters/getProjectVersionsPaginated.ts rename to src/version3/parameters/getProjectVersionsPaginated.mts diff --git a/src/version3/parameters/getProjectsForIssueTypeScreenScheme.ts b/src/version3/parameters/getProjectsForIssueTypeScreenScheme.mts similarity index 100% rename from src/version3/parameters/getProjectsForIssueTypeScreenScheme.ts rename to src/version3/parameters/getProjectsForIssueTypeScreenScheme.mts diff --git a/src/version3/parameters/getRecent.ts b/src/version3/parameters/getRecent.mts similarity index 100% rename from src/version3/parameters/getRecent.ts rename to src/version3/parameters/getRecent.mts diff --git a/src/version3/parameters/getRemoteIssueLinkById.ts b/src/version3/parameters/getRemoteIssueLinkById.mts similarity index 100% rename from src/version3/parameters/getRemoteIssueLinkById.ts rename to src/version3/parameters/getRemoteIssueLinkById.mts diff --git a/src/version3/parameters/getRemoteIssueLinks.ts b/src/version3/parameters/getRemoteIssueLinks.mts similarity index 100% rename from src/version3/parameters/getRemoteIssueLinks.ts rename to src/version3/parameters/getRemoteIssueLinks.mts diff --git a/src/version3/parameters/getScreenSchemes.ts b/src/version3/parameters/getScreenSchemes.mts similarity index 100% rename from src/version3/parameters/getScreenSchemes.ts rename to src/version3/parameters/getScreenSchemes.mts diff --git a/src/version3/parameters/getScreens.ts b/src/version3/parameters/getScreens.mts similarity index 100% rename from src/version3/parameters/getScreens.ts rename to src/version3/parameters/getScreens.mts diff --git a/src/version3/parameters/getScreensForField.ts b/src/version3/parameters/getScreensForField.mts similarity index 100% rename from src/version3/parameters/getScreensForField.ts rename to src/version3/parameters/getScreensForField.mts diff --git a/src/version3/parameters/getSecurityLevelMembers.ts b/src/version3/parameters/getSecurityLevelMembers.mts similarity index 100% rename from src/version3/parameters/getSecurityLevelMembers.ts rename to src/version3/parameters/getSecurityLevelMembers.mts diff --git a/src/version3/parameters/getSecurityLevels.ts b/src/version3/parameters/getSecurityLevels.mts similarity index 100% rename from src/version3/parameters/getSecurityLevels.ts rename to src/version3/parameters/getSecurityLevels.mts diff --git a/src/version3/parameters/getSecurityLevelsForProject.ts b/src/version3/parameters/getSecurityLevelsForProject.mts similarity index 100% rename from src/version3/parameters/getSecurityLevelsForProject.ts rename to src/version3/parameters/getSecurityLevelsForProject.mts diff --git a/src/version3/parameters/getSelectableIssueFieldOptions.ts b/src/version3/parameters/getSelectableIssueFieldOptions.mts similarity index 100% rename from src/version3/parameters/getSelectableIssueFieldOptions.ts rename to src/version3/parameters/getSelectableIssueFieldOptions.mts diff --git a/src/version3/parameters/getSharePermission.ts b/src/version3/parameters/getSharePermission.mts similarity index 100% rename from src/version3/parameters/getSharePermission.ts rename to src/version3/parameters/getSharePermission.mts diff --git a/src/version3/parameters/getSharePermissions.ts b/src/version3/parameters/getSharePermissions.mts similarity index 100% rename from src/version3/parameters/getSharePermissions.ts rename to src/version3/parameters/getSharePermissions.mts diff --git a/src/version3/parameters/getStatus.ts b/src/version3/parameters/getStatus.mts similarity index 100% rename from src/version3/parameters/getStatus.ts rename to src/version3/parameters/getStatus.mts diff --git a/src/version3/parameters/getStatusCategory.ts b/src/version3/parameters/getStatusCategory.mts similarity index 100% rename from src/version3/parameters/getStatusCategory.ts rename to src/version3/parameters/getStatusCategory.mts diff --git a/src/version3/parameters/getStatusesById.ts b/src/version3/parameters/getStatusesById.mts similarity index 100% rename from src/version3/parameters/getStatusesById.ts rename to src/version3/parameters/getStatusesById.mts diff --git a/src/version3/parameters/getTask.ts b/src/version3/parameters/getTask.mts similarity index 100% rename from src/version3/parameters/getTask.ts rename to src/version3/parameters/getTask.mts diff --git a/src/version3/parameters/getTransitions.ts b/src/version3/parameters/getTransitions.mts similarity index 100% rename from src/version3/parameters/getTransitions.ts rename to src/version3/parameters/getTransitions.mts diff --git a/src/version3/parameters/getTrashedFieldsPaginated.ts b/src/version3/parameters/getTrashedFieldsPaginated.mts similarity index 100% rename from src/version3/parameters/getTrashedFieldsPaginated.ts rename to src/version3/parameters/getTrashedFieldsPaginated.mts diff --git a/src/version3/parameters/getUiModifications.ts b/src/version3/parameters/getUiModifications.mts similarity index 100% rename from src/version3/parameters/getUiModifications.ts rename to src/version3/parameters/getUiModifications.mts diff --git a/src/version3/parameters/getUser.ts b/src/version3/parameters/getUser.mts similarity index 100% rename from src/version3/parameters/getUser.ts rename to src/version3/parameters/getUser.mts diff --git a/src/version3/parameters/getUserDefaultColumns.ts b/src/version3/parameters/getUserDefaultColumns.mts similarity index 100% rename from src/version3/parameters/getUserDefaultColumns.ts rename to src/version3/parameters/getUserDefaultColumns.mts diff --git a/src/version3/parameters/getUserEmail.ts b/src/version3/parameters/getUserEmail.mts similarity index 100% rename from src/version3/parameters/getUserEmail.ts rename to src/version3/parameters/getUserEmail.mts diff --git a/src/version3/parameters/getUserEmailBulk.ts b/src/version3/parameters/getUserEmailBulk.mts similarity index 100% rename from src/version3/parameters/getUserEmailBulk.ts rename to src/version3/parameters/getUserEmailBulk.mts diff --git a/src/version3/parameters/getUserGroups.ts b/src/version3/parameters/getUserGroups.mts similarity index 100% rename from src/version3/parameters/getUserGroups.ts rename to src/version3/parameters/getUserGroups.mts diff --git a/src/version3/parameters/getUserProperty.ts b/src/version3/parameters/getUserProperty.mts similarity index 100% rename from src/version3/parameters/getUserProperty.ts rename to src/version3/parameters/getUserProperty.mts diff --git a/src/version3/parameters/getUserPropertyKeys.ts b/src/version3/parameters/getUserPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getUserPropertyKeys.ts rename to src/version3/parameters/getUserPropertyKeys.mts diff --git a/src/version3/parameters/getUsersFromGroup.ts b/src/version3/parameters/getUsersFromGroup.mts similarity index 100% rename from src/version3/parameters/getUsersFromGroup.ts rename to src/version3/parameters/getUsersFromGroup.mts diff --git a/src/version3/parameters/getValidProjectKey.ts b/src/version3/parameters/getValidProjectKey.mts similarity index 100% rename from src/version3/parameters/getValidProjectKey.ts rename to src/version3/parameters/getValidProjectKey.mts diff --git a/src/version3/parameters/getValidProjectName.ts b/src/version3/parameters/getValidProjectName.mts similarity index 100% rename from src/version3/parameters/getValidProjectName.ts rename to src/version3/parameters/getValidProjectName.mts diff --git a/src/version3/parameters/getVersion.ts b/src/version3/parameters/getVersion.mts similarity index 100% rename from src/version3/parameters/getVersion.ts rename to src/version3/parameters/getVersion.mts diff --git a/src/version3/parameters/getVersionRelatedIssues.ts b/src/version3/parameters/getVersionRelatedIssues.mts similarity index 100% rename from src/version3/parameters/getVersionRelatedIssues.ts rename to src/version3/parameters/getVersionRelatedIssues.mts diff --git a/src/version3/parameters/getVersionUnresolvedIssues.ts b/src/version3/parameters/getVersionUnresolvedIssues.mts similarity index 100% rename from src/version3/parameters/getVersionUnresolvedIssues.ts rename to src/version3/parameters/getVersionUnresolvedIssues.mts diff --git a/src/version3/parameters/getVisibleIssueFieldOptions.ts b/src/version3/parameters/getVisibleIssueFieldOptions.mts similarity index 100% rename from src/version3/parameters/getVisibleIssueFieldOptions.ts rename to src/version3/parameters/getVisibleIssueFieldOptions.mts diff --git a/src/version3/parameters/getVotes.ts b/src/version3/parameters/getVotes.mts similarity index 100% rename from src/version3/parameters/getVotes.ts rename to src/version3/parameters/getVotes.mts diff --git a/src/version3/parameters/getWorkflow.ts b/src/version3/parameters/getWorkflow.mts similarity index 100% rename from src/version3/parameters/getWorkflow.ts rename to src/version3/parameters/getWorkflow.mts diff --git a/src/version3/parameters/getWorkflowScheme.ts b/src/version3/parameters/getWorkflowScheme.mts similarity index 100% rename from src/version3/parameters/getWorkflowScheme.ts rename to src/version3/parameters/getWorkflowScheme.mts diff --git a/src/version3/parameters/getWorkflowSchemeDraft.ts b/src/version3/parameters/getWorkflowSchemeDraft.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeDraft.ts rename to src/version3/parameters/getWorkflowSchemeDraft.mts diff --git a/src/version3/parameters/getWorkflowSchemeDraftIssueType.ts b/src/version3/parameters/getWorkflowSchemeDraftIssueType.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeDraftIssueType.ts rename to src/version3/parameters/getWorkflowSchemeDraftIssueType.mts diff --git a/src/version3/parameters/getWorkflowSchemeIssueType.ts b/src/version3/parameters/getWorkflowSchemeIssueType.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeIssueType.ts rename to src/version3/parameters/getWorkflowSchemeIssueType.mts diff --git a/src/version3/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version3/parameters/getWorkflowSchemeProjectAssociations.mts similarity index 100% rename from src/version3/parameters/getWorkflowSchemeProjectAssociations.ts rename to src/version3/parameters/getWorkflowSchemeProjectAssociations.mts diff --git a/src/version3/parameters/getWorkflowTransitionProperties.ts b/src/version3/parameters/getWorkflowTransitionProperties.mts similarity index 100% rename from src/version3/parameters/getWorkflowTransitionProperties.ts rename to src/version3/parameters/getWorkflowTransitionProperties.mts diff --git a/src/version3/parameters/getWorkflowTransitionRuleConfigurations.ts b/src/version3/parameters/getWorkflowTransitionRuleConfigurations.mts similarity index 100% rename from src/version3/parameters/getWorkflowTransitionRuleConfigurations.ts rename to src/version3/parameters/getWorkflowTransitionRuleConfigurations.mts diff --git a/src/version3/parameters/getWorkflowsPaginated.ts b/src/version3/parameters/getWorkflowsPaginated.mts similarity index 100% rename from src/version3/parameters/getWorkflowsPaginated.ts rename to src/version3/parameters/getWorkflowsPaginated.mts diff --git a/src/version3/parameters/getWorklog.ts b/src/version3/parameters/getWorklog.mts similarity index 100% rename from src/version3/parameters/getWorklog.ts rename to src/version3/parameters/getWorklog.mts diff --git a/src/version3/parameters/getWorklogProperty.ts b/src/version3/parameters/getWorklogProperty.mts similarity index 100% rename from src/version3/parameters/getWorklogProperty.ts rename to src/version3/parameters/getWorklogProperty.mts diff --git a/src/version3/parameters/getWorklogPropertyKeys.ts b/src/version3/parameters/getWorklogPropertyKeys.mts similarity index 100% rename from src/version3/parameters/getWorklogPropertyKeys.ts rename to src/version3/parameters/getWorklogPropertyKeys.mts diff --git a/src/version3/parameters/getWorklogsForIds.mts b/src/version3/parameters/getWorklogsForIds.mts new file mode 100644 index 0000000000..a2f3108fb5 --- /dev/null +++ b/src/version3/parameters/getWorklogsForIds.mts @@ -0,0 +1,10 @@ +import { WorklogIdsRequest } from '../models/index.mjs'; + +export interface GetWorklogsForIds extends WorklogIdsRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each + * worklog. + */ + expand?: string; +} diff --git a/src/version3/parameters/getWorklogsForIds.ts b/src/version3/parameters/getWorklogsForIds.ts deleted file mode 100644 index 6f49af8dbf..0000000000 --- a/src/version3/parameters/getWorklogsForIds.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { WorklogIdsRequest } from '../models'; - -export interface GetWorklogsForIds extends WorklogIdsRequest { - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties` that returns the properties of each - * worklog. - */ - expand?: string; -} diff --git a/src/version3/parameters/index.mts b/src/version3/parameters/index.mts new file mode 100644 index 0000000000..bbc8fa911c --- /dev/null +++ b/src/version3/parameters/index.mts @@ -0,0 +1,462 @@ +export * from './addActorUsers.mjs'; +export * from './addAttachment.mjs'; +export * from './addComment.mjs'; +export * from './addFieldToDefaultScreen.mjs'; +export * from './addGadget.mjs'; +export * from './addIssueTypesToContext.mjs'; +export * from './addIssueTypesToIssueTypeScheme.mjs'; +export * from './addProjectRoleActorsToRole.mjs'; +export * from './addScreenTab.mjs'; +export * from './addScreenTabField.mjs'; +export * from './addSecurityLevel.mjs'; +export * from './addSecurityLevelMembers.mjs'; +export * from './addSharePermission.mjs'; +export * from './addUserToGroup.mjs'; +export * from './addVote.mjs'; +export * from './addWatcher.mjs'; +export * from './addWorklog.mjs'; +export * from './analyseExpression.mjs'; +export * from './appendMappingsForIssueTypeScreenScheme.mjs'; +export * from './archiveIssues.mjs'; +export * from './archiveIssuesAsync.mjs'; +export * from './archiveProject.mjs'; +export * from './assignFieldConfigurationSchemeToProject.mjs'; +export * from './assignIssue.mjs'; +export * from './assignIssueTypeSchemeToProject.mjs'; +export * from './assignIssueTypeScreenSchemeToProject.mjs'; +export * from './assignPermissionScheme.mjs'; +export * from './assignProjectsToCustomFieldContext.mjs'; +export * from './assignSchemeToProject.mjs'; +export * from './associateSchemesToProjects.mjs'; +export * from './bulkDeleteIssueProperty.mjs'; +export * from './bulkEditDashboards.mjs'; +export * from './bulkGetGroups.mjs'; +export * from './bulkGetUsers.mjs'; +export * from './bulkGetUsersMigration.mjs'; +export * from './bulkSetIssuePropertiesByIssue.mjs'; +export * from './bulkSetIssueProperty.mjs'; +export * from './bulkSetIssuesProperties.mjs'; +export * from './cancelTask.mjs'; +export * from './changeFilterOwner.mjs'; +export * from './copyDashboard.mjs'; +export * from './createComponent.mjs'; +export * from './createCustomField.mjs'; +export * from './createCustomFieldContext.mjs'; +export * from './createCustomFieldOption.mjs'; +export * from './createDashboard.mjs'; +export * from './createFieldConfiguration.mjs'; +export * from './createFieldConfigurationScheme.mjs'; +export * from './createFilter.mjs'; +export * from './createGroup.mjs'; +export * from './createIssue.mjs'; +export * from './createIssueFieldOption.mjs'; +export * from './createIssueLinkType.mjs'; +export * from './createIssues.mjs'; +export * from './createIssueSecurityScheme.mjs'; +export * from './createIssueType.mjs'; +export * from './createIssueTypeAvatar.mjs'; +export * from './createIssueTypeScheme.mjs'; +export * from './createIssueTypeScreenScheme.mjs'; +export * from './createNotificationScheme.mjs'; +export * from './createOrUpdateRemoteIssueLink.mjs'; +export * from './createPermissionGrant.mjs'; +export * from './createPermissionScheme.mjs'; +export * from './createPriority.mjs'; +export * from './createProject.mjs'; +export * from './createProjectAvatar.mjs'; +export * from './createProjectCategory.mjs'; +export * from './createProjectRole.mjs'; +export * from './createResolution.mjs'; +export * from './createScreen.mjs'; +export * from './createScreenScheme.mjs'; +export * from './createStatuses.mjs'; +export * from './createUiModification.mjs'; +export * from './createUser.mjs'; +export * from './createVersion.mjs'; +export * from './createWorkflow.mjs'; +export * from './createWorkflowScheme.mjs'; +export * from './createWorkflowSchemeDraftFromParent.mjs'; +export * from './createWorkflowTransitionProperty.mjs'; +export * from './deleteActor.mjs'; +export * from './deleteAddonProperty.mjs'; +export * from './deleteAndReplaceVersion.mjs'; +export * from './deleteAppProperty.mjs'; +export * from './deleteAvatar.mjs'; +export * from './deleteComment.mjs'; +export * from './deleteCommentProperty.mjs'; +export * from './deleteComponent.mjs'; +export * from './deleteCustomField.mjs'; +export * from './deleteCustomFieldContext.mjs'; +export * from './deleteCustomFieldOption.mjs'; +export * from './deleteDashboard.mjs'; +export * from './deleteDashboardItemProperty.mjs'; +export * from './deleteDefaultWorkflow.mjs'; +export * from './deleteDraftDefaultWorkflow.mjs'; +export * from './deleteDraftWorkflowMapping.mjs'; +export * from './deleteFavouriteForFilter.mjs'; +export * from './deleteFieldConfiguration.mjs'; +export * from './deleteFieldConfigurationScheme.mjs'; +export * from './deleteFilter.mjs'; +export * from './deleteInactiveWorkflow.mjs'; +export * from './deleteIssue.mjs'; +export * from './deleteIssueFieldOption.mjs'; +export * from './deleteIssueLink.mjs'; +export * from './deleteIssueLinkType.mjs'; +export * from './deleteIssueProperty.mjs'; +export * from './deleteIssueType.mjs'; +export * from './deleteIssueTypeProperty.mjs'; +export * from './deleteIssueTypeScheme.mjs'; +export * from './deleteIssueTypeScreenScheme.mjs'; +export * from './deleteNotificationScheme.mjs'; +export * from './deletePermissionScheme.mjs'; +export * from './deletePermissionSchemeEntity.mjs'; +export * from './deleteProject.mjs'; +export * from './deleteProjectAsynchronously.mjs'; +export * from './deleteProjectAvatar.mjs'; +export * from './deleteProjectProperty.mjs'; +export * from './deleteProjectRole.mjs'; +export * from './deleteProjectRoleActorsFromRole.mjs'; +export * from './deleteRemoteIssueLinkByGlobalId.mjs'; +export * from './deleteRemoteIssueLinkById.mjs'; +export * from './deleteResolution.mjs'; +export * from './deleteScreen.mjs'; +export * from './deleteScreenScheme.mjs'; +export * from './deleteScreenTab.mjs'; +export * from './deleteSecurityScheme.mjs'; +export * from './deleteSharePermission.mjs'; +export * from './deleteStatusesById.mjs'; +export * from './deleteUiModification.mjs'; +export * from './deleteUserProperty.mjs'; +export * from './deleteWebhookById.mjs'; +export * from './deleteWorkflowMapping.mjs'; +export * from './deleteWorkflowScheme.mjs'; +export * from './deleteWorkflowSchemeDraft.mjs'; +export * from './deleteWorkflowSchemeDraftIssueType.mjs'; +export * from './deleteWorkflowSchemeIssueType.mjs'; +export * from './deleteWorkflowTransitionProperty.mjs'; +export * from './deleteWorkflowTransitionRuleConfigurations.mjs'; +export * from './deleteWorklog.mjs'; +export * from './deleteWorklogProperty.mjs'; +export * from './doTransition.mjs'; +export * from './editIssue.mjs'; +export * from './evaluateJiraExpression.mjs'; +export * from './expandAttachmentForHumans.mjs'; +export * from './expandAttachmentForMachines.mjs'; +export * from './exportArchivedIssues.mjs'; +export * from './findAssignableUsers.mjs'; +export * from './findBulkAssignableUsers.mjs'; +export * from './findGroups.mjs'; +export * from './findUserKeysByQuery.mjs'; +export * from './findUsers.mjs'; +export * from './findUsersAndGroups.mjs'; +export * from './findUsersByQuery.mjs'; +export * from './findUsersForPicker.mjs'; +export * from './findUsersWithAllPermissions.mjs'; +export * from './findUsersWithBrowsePermission.mjs'; +export * from './fullyUpdateProjectRole.mjs'; +export * from './getAccessibleProjectTypeByKey.mjs'; +export * from './getAddonProperties.mjs'; +export * from './getAddonProperty.mjs'; +export * from './getAllDashboards.mjs'; +export * from './getAllFieldConfigurations.mjs'; +export * from './getAllFieldConfigurationSchemes.mjs'; +export * from './getAllGadgets.mjs'; +export * from './getAllIssueFieldOptions.mjs'; +export * from './getAllIssueTypeSchemes.mjs'; +export * from './getAllLabels.mjs'; +export * from './getAllPermissionSchemes.mjs'; +export * from './getAllProjectAvatars.mjs'; +export * from './getAllScreenTabFields.mjs'; +export * from './getAllScreenTabs.mjs'; +export * from './getAllStatuses.mjs'; +export * from './getAllSystemAvatars.mjs'; +export * from './getAllUsers.mjs'; +export * from './getAllUsersDefault.mjs'; +export * from './getAllWorkflowSchemes.mjs'; +export * from './getAlternativeIssueTypes.mjs'; +export * from './getApplicationProperty.mjs'; +export * from './getApplicationRole.mjs'; +export * from './getAssignedPermissionScheme.mjs'; +export * from './getAttachment.mjs'; +export * from './getAttachmentContent.mjs'; +export * from './getAttachmentThumbnail.mjs'; +export * from './getAuditRecords.mjs'; +export * from './getAutoCompletePost.mjs'; +export * from './getAvailableScreenFields.mjs'; +export * from './getAvatarImageByID.mjs'; +export * from './getAvatarImageByOwner.mjs'; +export * from './getAvatarImageByType.mjs'; +export * from './getAvatars.mjs'; +export * from './getBulkPermissions.mjs'; +export * from './getChangeLogs.mjs'; +export * from './getChangeLogsByIds.mjs'; +export * from './getColumns.mjs'; +export * from './getComment.mjs'; +export * from './getCommentProperty.mjs'; +export * from './getCommentPropertyKeys.mjs'; +export * from './getComments.mjs'; +export * from './getCommentsByIds.mjs'; +export * from './getComponent.mjs'; +export * from './getComponentRelatedIssues.mjs'; +export * from './getContextsForField.mjs'; +export * from './getCreateIssueMeta.mjs'; +export * from './getCurrentUser.mjs'; +export * from './getCustomFieldConfiguration.mjs'; +export * from './getCustomFieldContextsForProjectsAndIssueTypes.mjs'; +export * from './getCustomFieldOption.mjs'; +export * from './getDashboard.mjs'; +export * from './getDashboardItemProperty.mjs'; +export * from './getDashboardItemPropertyKeys.mjs'; +export * from './getDashboardsPaginated.mjs'; +export * from './getDefaultValues.mjs'; +export * from './getDefaultWorkflow.mjs'; +export * from './getDraftDefaultWorkflow.mjs'; +export * from './getDraftWorkflow.mjs'; +export * from './getDynamicWebhooksForApp.mjs'; +export * from './getEditIssueMeta.mjs'; +export * from './getFailedWebhooks.mjs'; +export * from './getFavouriteFilters.mjs'; +export * from './getFeaturesForProject.mjs'; +export * from './getFieldAutoCompleteForQueryString.mjs'; +export * from './getFieldConfigurationItems.mjs'; +export * from './getFieldConfigurationSchemeMappings.mjs'; +export * from './getFieldConfigurationSchemeProjectMapping.mjs'; +export * from './getFieldsPaginated.mjs'; +export * from './getFilter.mjs'; +export * from './getFiltersPaginated.mjs'; +export * from './getHierarchy.mjs'; +export * from './getIdsOfWorklogsDeletedSince.mjs'; +export * from './getIdsOfWorklogsModifiedSince.mjs'; +export * from './getIssue.mjs'; +export * from './getIssueFieldOption.mjs'; +export * from './getIssueLink.mjs'; +export * from './getIssueLinkType.mjs'; +export * from './getIssuePickerResource.mjs'; +export * from './getIssueProperty.mjs'; +export * from './getIssuePropertyKeys.mjs'; +export * from './getIssueSecurityLevel.mjs'; +export * from './getIssueSecurityLevelMembers.mjs'; +export * from './getIssueSecurityScheme.mjs'; +export * from './getIssueType.mjs'; +export * from './getIssueTypeMappingsForContexts.mjs'; +export * from './getIssueTypeProperty.mjs'; +export * from './getIssueTypePropertyKeys.mjs'; +export * from './getIssueTypeSchemeForProjects.mjs'; +export * from './getIssueTypeSchemesMapping.mjs'; +export * from './getIssueTypeScreenSchemeMappings.mjs'; +export * from './getIssueTypeScreenSchemeProjectAssociations.mjs'; +export * from './getIssueTypeScreenSchemes.mjs'; +export * from './getIssueTypesForProject.mjs'; +export * from './getIssueWatchers.mjs'; +export * from './getIssueWorklog.mjs'; +export * from './getIsWatchingIssueBulk.mjs'; +export * from './getMyFilters.mjs'; +export * from './getMyPermissions.mjs'; +export * from './getNotificationScheme.mjs'; +export * from './getNotificationSchemes.mjs'; +export * from './getNotificationSchemeToProjectMappings.mjs'; +export * from './getOptionsForContext.mjs'; +export * from './getPermissionScheme.mjs'; +export * from './getPermissionSchemeGrant.mjs'; +export * from './getPermissionSchemeGrants.mjs'; +export * from './getPermittedProjects.mjs'; +export * from './getPrecomputations.mjs'; +export * from './getPreference.mjs'; +export * from './getPriority.mjs'; +export * from './getProject.mjs'; +export * from './getProjectCategoryById.mjs'; +export * from './getProjectComponents.mjs'; +export * from './getProjectComponentsPaginated.mjs'; +export * from './getProjectContextMapping.mjs'; +export * from './getProjectEmail.mjs'; +export * from './getProjectIssueSecurityScheme.mjs'; +export * from './getProjectProperty.mjs'; +export * from './getProjectPropertyKeys.mjs'; +export * from './getProjectRole.mjs'; +export * from './getProjectRoleActorsForRole.mjs'; +export * from './getProjectRoleById.mjs'; +export * from './getProjectRoleDetails.mjs'; +export * from './getProjectRoles.mjs'; +export * from './getProjectsForIssueTypeScreenScheme.mjs'; +export * from './getProjectTypeByKey.mjs'; +export * from './getProjectVersions.mjs'; +export * from './getProjectVersionsPaginated.mjs'; +export * from './getRecent.mjs'; +export * from './getRemoteIssueLinkById.mjs'; +export * from './getRemoteIssueLinks.mjs'; +export * from './getScreens.mjs'; +export * from './getScreenSchemes.mjs'; +export * from './getScreensForField.mjs'; +export * from './getSecurityLevelMembers.mjs'; +export * from './getSecurityLevels.mjs'; +export * from './getSecurityLevelsForProject.mjs'; +export * from './getSelectableIssueFieldOptions.mjs'; +export * from './getSharePermission.mjs'; +export * from './getSharePermissions.mjs'; +export * from './getStatus.mjs'; +export * from './getStatusCategory.mjs'; +export * from './getStatusesById.mjs'; +export * from './getTask.mjs'; +export * from './getTransitions.mjs'; +export * from './getTrashedFieldsPaginated.mjs'; +export * from './getUiModifications.mjs'; +export * from './getUser.mjs'; +export * from './getUserDefaultColumns.mjs'; +export * from './getUserEmail.mjs'; +export * from './getUserEmailBulk.mjs'; +export * from './getUserGroups.mjs'; +export * from './getUserProperty.mjs'; +export * from './getUserPropertyKeys.mjs'; +export * from './getUsersFromGroup.mjs'; +export * from './getValidProjectKey.mjs'; +export * from './getValidProjectName.mjs'; +export * from './getVersion.mjs'; +export * from './getVersionRelatedIssues.mjs'; +export * from './getVersionUnresolvedIssues.mjs'; +export * from './getVisibleIssueFieldOptions.mjs'; +export * from './getVotes.mjs'; +export * from './getWorkflow.mjs'; +export * from './getWorkflowScheme.mjs'; +export * from './getWorkflowSchemeDraft.mjs'; +export * from './getWorkflowSchemeDraftIssueType.mjs'; +export * from './getWorkflowSchemeIssueType.mjs'; +export * from './getWorkflowSchemeProjectAssociations.mjs'; +export * from './getWorkflowsPaginated.mjs'; +export * from './getWorkflowTransitionProperties.mjs'; +export * from './getWorkflowTransitionRuleConfigurations.mjs'; +export * from './getWorklog.mjs'; +export * from './getWorklogProperty.mjs'; +export * from './getWorklogPropertyKeys.mjs'; +export * from './getWorklogsForIds.mjs'; +export * from './linkIssues.mjs'; +export * from './matchIssues.mjs'; +export * from './mergeVersions.mjs'; +export * from './migrateQueries.mjs'; +export * from './movePriorities.mjs'; +export * from './moveResolutions.mjs'; +export * from './moveScreenTab.mjs'; +export * from './moveScreenTabField.mjs'; +export * from './moveVersion.mjs'; +export * from './notify.mjs'; +export * from './parseJqlQueries.mjs'; +export * from './partialUpdateProjectRole.mjs'; +export * from './publishDraftWorkflowScheme.mjs'; +export * from './putAddonProperty.mjs'; +export * from './putAppProperty.mjs'; +export * from './refreshWebhooks.mjs'; +export * from './registerDynamicWebhooks.mjs'; +export * from './registerModules.mjs'; +export * from './removeAttachment.mjs'; +export * from './removeCustomFieldContextFromProjects.mjs'; +export * from './removeGadget.mjs'; +export * from './removeGroup.mjs'; +export * from './removeIssueTypeFromIssueTypeScheme.mjs'; +export * from './removeIssueTypesFromContext.mjs'; +export * from './removeIssueTypesFromGlobalFieldConfigurationScheme.mjs'; +export * from './removeLevel.mjs'; +export * from './removeMappingsFromIssueTypeScreenScheme.mjs'; +export * from './removeMemberFromSecurityLevel.mjs'; +export * from './removeModules.mjs'; +export * from './removeNotificationFromNotificationScheme.mjs'; +export * from './removePreference.mjs'; +export * from './removeProjectCategory.mjs'; +export * from './removeScreenTabField.mjs'; +export * from './removeUser.mjs'; +export * from './removeUserFromGroup.mjs'; +export * from './removeVote.mjs'; +export * from './removeWatcher.mjs'; +export * from './renameScreenTab.mjs'; +export * from './reorderCustomFieldOptions.mjs'; +export * from './reorderIssueTypesInIssueTypeScheme.mjs'; +export * from './replaceIssueFieldOption.mjs'; +export * from './resetColumns.mjs'; +export * from './resetUserColumns.mjs'; +export * from './restore.mjs'; +export * from './restoreCustomField.mjs'; +export * from './sanitiseJqlQueries.mjs'; +export * from './search.mjs'; +export * from './searchForIssuesUsingJql.mjs'; +export * from './searchForIssuesUsingJqlPost.mjs'; +export * from './searchPriorities.mjs'; +export * from './searchProjects.mjs'; +export * from './searchProjectsUsingSecuritySchemes.mjs'; +export * from './searchResolutions.mjs'; +export * from './searchSecuritySchemes.mjs'; +export * from './selectTimeTrackingImplementation.mjs'; +export * from './setActors.mjs'; +export * from './setApplicationProperty.mjs'; +export * from './setBanner.mjs'; +export * from './setColumns.mjs'; +export * from './setCommentProperty.mjs'; +export * from './setDashboardItemProperty.mjs'; +export * from './setDefaultLevels.mjs'; +export * from './setDefaultPriority.mjs'; +export * from './setDefaultResolution.mjs'; +export * from './setDefaultShareScope.mjs'; +export * from './setDefaultValues.mjs'; +export * from './setFavouriteForFilter.mjs'; +export * from './setFieldConfigurationSchemeMapping.mjs'; +export * from './setIssueProperty.mjs'; +export * from './setIssueTypeProperty.mjs'; +export * from './setPreference.mjs'; +export * from './setProjectProperty.mjs'; +export * from './setSharedTimeTrackingConfiguration.mjs'; +export * from './setUserColumns.mjs'; +export * from './setUserProperty.mjs'; +export * from './setWorkflowSchemeDraftIssueType.mjs'; +export * from './setWorkflowSchemeIssueType.mjs'; +export * from './setWorklogProperty.mjs'; +export * from './storeAvatar.mjs'; +export * from './toggleFeatureForProject.mjs'; +export * from './trashCustomField.mjs'; +export * from './unarchiveIssues.mjs'; +export * from './updateComment.mjs'; +export * from './updateComponent.mjs'; +export * from './updateCustomField.mjs'; +export * from './updateCustomFieldConfiguration.mjs'; +export * from './updateCustomFieldContext.mjs'; +export * from './updateCustomFieldOption.mjs'; +export * from './updateCustomFieldValue.mjs'; +export * from './updateDashboard.mjs'; +export * from './updateDefaultScreenScheme.mjs'; +export * from './updateDefaultWorkflow.mjs'; +export * from './updateDraftDefaultWorkflow.mjs'; +export * from './updateDraftWorkflowMapping.mjs'; +export * from './updateEntityPropertiesValue.mjs'; +export * from './updateFieldConfiguration.mjs'; +export * from './updateFieldConfigurationItems.mjs'; +export * from './updateFieldConfigurationScheme.mjs'; +export * from './updateFilter.mjs'; +export * from './updateGadget.mjs'; +export * from './updateIssueFieldOption.mjs'; +export * from './updateIssueFields.mjs'; +export * from './updateIssueLinkType.mjs'; +export * from './updateIssueSecurityScheme.mjs'; +export * from './updateIssueType.mjs'; +export * from './updateIssueTypeScheme.mjs'; +export * from './updateIssueTypeScreenScheme.mjs'; +export * from './updateMultipleCustomFieldValues.mjs'; +export * from './updateNotificationScheme.mjs'; +export * from './updatePermissionScheme.mjs'; +export * from './updatePrecomputations.mjs'; +export * from './updatePriority.mjs'; +export * from './updateProject.mjs'; +export * from './updateProjectAvatar.mjs'; +export * from './updateProjectCategory.mjs'; +export * from './updateProjectEmail.mjs'; +export * from './updateRemoteIssueLink.mjs'; +export * from './updateResolution.mjs'; +export * from './updateScreen.mjs'; +export * from './updateScreenScheme.mjs'; +export * from './updateSecurityLevel.mjs'; +export * from './updateStatuses.mjs'; +export * from './updateUiModification.mjs'; +export * from './updateVersion.mjs'; +export * from './updateWorkflowMapping.mjs'; +export * from './updateWorkflowScheme.mjs'; +export * from './updateWorkflowSchemeDraft.mjs'; +export * from './updateWorkflowTransitionProperty.mjs'; +export * from './updateWorkflowTransitionRuleConfigurations.mjs'; +export * from './updateWorklog.mjs'; +export * from './validateProjectKey.mjs'; +export * from './workflowRuleSearch.mjs'; diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts deleted file mode 100644 index 862d5d6655..0000000000 --- a/src/version3/parameters/index.ts +++ /dev/null @@ -1,462 +0,0 @@ -export * from './addActorUsers'; -export * from './addAttachment'; -export * from './addComment'; -export * from './addFieldToDefaultScreen'; -export * from './addGadget'; -export * from './addIssueTypesToContext'; -export * from './addIssueTypesToIssueTypeScheme'; -export * from './addProjectRoleActorsToRole'; -export * from './addScreenTab'; -export * from './addScreenTabField'; -export * from './addSecurityLevel'; -export * from './addSecurityLevelMembers'; -export * from './addSharePermission'; -export * from './addUserToGroup'; -export * from './addVote'; -export * from './addWatcher'; -export * from './addWorklog'; -export * from './analyseExpression'; -export * from './appendMappingsForIssueTypeScreenScheme'; -export * from './archiveIssues'; -export * from './archiveIssuesAsync'; -export * from './archiveProject'; -export * from './assignFieldConfigurationSchemeToProject'; -export * from './assignIssue'; -export * from './assignIssueTypeSchemeToProject'; -export * from './assignIssueTypeScreenSchemeToProject'; -export * from './assignPermissionScheme'; -export * from './assignProjectsToCustomFieldContext'; -export * from './assignSchemeToProject'; -export * from './associateSchemesToProjects'; -export * from './bulkDeleteIssueProperty'; -export * from './bulkEditDashboards'; -export * from './bulkGetGroups'; -export * from './bulkGetUsers'; -export * from './bulkGetUsersMigration'; -export * from './bulkSetIssuePropertiesByIssue'; -export * from './bulkSetIssueProperty'; -export * from './bulkSetIssuesProperties'; -export * from './cancelTask'; -export * from './changeFilterOwner'; -export * from './copyDashboard'; -export * from './createComponent'; -export * from './createCustomField'; -export * from './createCustomFieldContext'; -export * from './createCustomFieldOption'; -export * from './createDashboard'; -export * from './createFieldConfiguration'; -export * from './createFieldConfigurationScheme'; -export * from './createFilter'; -export * from './createGroup'; -export * from './createIssue'; -export * from './createIssueFieldOption'; -export * from './createIssueLinkType'; -export * from './createIssues'; -export * from './createIssueSecurityScheme'; -export * from './createIssueType'; -export * from './createIssueTypeAvatar'; -export * from './createIssueTypeScheme'; -export * from './createIssueTypeScreenScheme'; -export * from './createNotificationScheme'; -export * from './createOrUpdateRemoteIssueLink'; -export * from './createPermissionGrant'; -export * from './createPermissionScheme'; -export * from './createPriority'; -export * from './createProject'; -export * from './createProjectAvatar'; -export * from './createProjectCategory'; -export * from './createProjectRole'; -export * from './createResolution'; -export * from './createScreen'; -export * from './createScreenScheme'; -export * from './createStatuses'; -export * from './createUiModification'; -export * from './createUser'; -export * from './createVersion'; -export * from './createWorkflow'; -export * from './createWorkflowScheme'; -export * from './createWorkflowSchemeDraftFromParent'; -export * from './createWorkflowTransitionProperty'; -export * from './deleteActor'; -export * from './deleteAddonProperty'; -export * from './deleteAndReplaceVersion'; -export * from './deleteAppProperty'; -export * from './deleteAvatar'; -export * from './deleteComment'; -export * from './deleteCommentProperty'; -export * from './deleteComponent'; -export * from './deleteCustomField'; -export * from './deleteCustomFieldContext'; -export * from './deleteCustomFieldOption'; -export * from './deleteDashboard'; -export * from './deleteDashboardItemProperty'; -export * from './deleteDefaultWorkflow'; -export * from './deleteDraftDefaultWorkflow'; -export * from './deleteDraftWorkflowMapping'; -export * from './deleteFavouriteForFilter'; -export * from './deleteFieldConfiguration'; -export * from './deleteFieldConfigurationScheme'; -export * from './deleteFilter'; -export * from './deleteInactiveWorkflow'; -export * from './deleteIssue'; -export * from './deleteIssueFieldOption'; -export * from './deleteIssueLink'; -export * from './deleteIssueLinkType'; -export * from './deleteIssueProperty'; -export * from './deleteIssueType'; -export * from './deleteIssueTypeProperty'; -export * from './deleteIssueTypeScheme'; -export * from './deleteIssueTypeScreenScheme'; -export * from './deleteNotificationScheme'; -export * from './deletePermissionScheme'; -export * from './deletePermissionSchemeEntity'; -export * from './deleteProject'; -export * from './deleteProjectAsynchronously'; -export * from './deleteProjectAvatar'; -export * from './deleteProjectProperty'; -export * from './deleteProjectRole'; -export * from './deleteProjectRoleActorsFromRole'; -export * from './deleteRemoteIssueLinkByGlobalId'; -export * from './deleteRemoteIssueLinkById'; -export * from './deleteResolution'; -export * from './deleteScreen'; -export * from './deleteScreenScheme'; -export * from './deleteScreenTab'; -export * from './deleteSecurityScheme'; -export * from './deleteSharePermission'; -export * from './deleteStatusesById'; -export * from './deleteUiModification'; -export * from './deleteUserProperty'; -export * from './deleteWebhookById'; -export * from './deleteWorkflowMapping'; -export * from './deleteWorkflowScheme'; -export * from './deleteWorkflowSchemeDraft'; -export * from './deleteWorkflowSchemeDraftIssueType'; -export * from './deleteWorkflowSchemeIssueType'; -export * from './deleteWorkflowTransitionProperty'; -export * from './deleteWorkflowTransitionRuleConfigurations'; -export * from './deleteWorklog'; -export * from './deleteWorklogProperty'; -export * from './doTransition'; -export * from './editIssue'; -export * from './evaluateJiraExpression'; -export * from './expandAttachmentForHumans'; -export * from './expandAttachmentForMachines'; -export * from './exportArchivedIssues'; -export * from './findAssignableUsers'; -export * from './findBulkAssignableUsers'; -export * from './findGroups'; -export * from './findUserKeysByQuery'; -export * from './findUsers'; -export * from './findUsersAndGroups'; -export * from './findUsersByQuery'; -export * from './findUsersForPicker'; -export * from './findUsersWithAllPermissions'; -export * from './findUsersWithBrowsePermission'; -export * from './fullyUpdateProjectRole'; -export * from './getAccessibleProjectTypeByKey'; -export * from './getAddonProperties'; -export * from './getAddonProperty'; -export * from './getAllDashboards'; -export * from './getAllFieldConfigurations'; -export * from './getAllFieldConfigurationSchemes'; -export * from './getAllGadgets'; -export * from './getAllIssueFieldOptions'; -export * from './getAllIssueTypeSchemes'; -export * from './getAllLabels'; -export * from './getAllPermissionSchemes'; -export * from './getAllProjectAvatars'; -export * from './getAllScreenTabFields'; -export * from './getAllScreenTabs'; -export * from './getAllStatuses'; -export * from './getAllSystemAvatars'; -export * from './getAllUsers'; -export * from './getAllUsersDefault'; -export * from './getAllWorkflowSchemes'; -export * from './getAlternativeIssueTypes'; -export * from './getApplicationProperty'; -export * from './getApplicationRole'; -export * from './getAssignedPermissionScheme'; -export * from './getAttachment'; -export * from './getAttachmentContent'; -export * from './getAttachmentThumbnail'; -export * from './getAuditRecords'; -export * from './getAutoCompletePost'; -export * from './getAvailableScreenFields'; -export * from './getAvatarImageByID'; -export * from './getAvatarImageByOwner'; -export * from './getAvatarImageByType'; -export * from './getAvatars'; -export * from './getBulkPermissions'; -export * from './getChangeLogs'; -export * from './getChangeLogsByIds'; -export * from './getColumns'; -export * from './getComment'; -export * from './getCommentProperty'; -export * from './getCommentPropertyKeys'; -export * from './getComments'; -export * from './getCommentsByIds'; -export * from './getComponent'; -export * from './getComponentRelatedIssues'; -export * from './getContextsForField'; -export * from './getCreateIssueMeta'; -export * from './getCurrentUser'; -export * from './getCustomFieldConfiguration'; -export * from './getCustomFieldContextsForProjectsAndIssueTypes'; -export * from './getCustomFieldOption'; -export * from './getDashboard'; -export * from './getDashboardItemProperty'; -export * from './getDashboardItemPropertyKeys'; -export * from './getDashboardsPaginated'; -export * from './getDefaultValues'; -export * from './getDefaultWorkflow'; -export * from './getDraftDefaultWorkflow'; -export * from './getDraftWorkflow'; -export * from './getDynamicWebhooksForApp'; -export * from './getEditIssueMeta'; -export * from './getFailedWebhooks'; -export * from './getFavouriteFilters'; -export * from './getFeaturesForProject'; -export * from './getFieldAutoCompleteForQueryString'; -export * from './getFieldConfigurationItems'; -export * from './getFieldConfigurationSchemeMappings'; -export * from './getFieldConfigurationSchemeProjectMapping'; -export * from './getFieldsPaginated'; -export * from './getFilter'; -export * from './getFiltersPaginated'; -export * from './getHierarchy'; -export * from './getIdsOfWorklogsDeletedSince'; -export * from './getIdsOfWorklogsModifiedSince'; -export * from './getIssue'; -export * from './getIssueFieldOption'; -export * from './getIssueLink'; -export * from './getIssueLinkType'; -export * from './getIssuePickerResource'; -export * from './getIssueProperty'; -export * from './getIssuePropertyKeys'; -export * from './getIssueSecurityLevel'; -export * from './getIssueSecurityLevelMembers'; -export * from './getIssueSecurityScheme'; -export * from './getIssueType'; -export * from './getIssueTypeMappingsForContexts'; -export * from './getIssueTypeProperty'; -export * from './getIssueTypePropertyKeys'; -export * from './getIssueTypeSchemeForProjects'; -export * from './getIssueTypeSchemesMapping'; -export * from './getIssueTypeScreenSchemeMappings'; -export * from './getIssueTypeScreenSchemeProjectAssociations'; -export * from './getIssueTypeScreenSchemes'; -export * from './getIssueTypesForProject'; -export * from './getIssueWatchers'; -export * from './getIssueWorklog'; -export * from './getIsWatchingIssueBulk'; -export * from './getMyFilters'; -export * from './getMyPermissions'; -export * from './getNotificationScheme'; -export * from './getNotificationSchemes'; -export * from './getNotificationSchemeToProjectMappings'; -export * from './getOptionsForContext'; -export * from './getPermissionScheme'; -export * from './getPermissionSchemeGrant'; -export * from './getPermissionSchemeGrants'; -export * from './getPermittedProjects'; -export * from './getPrecomputations'; -export * from './getPreference'; -export * from './getPriority'; -export * from './getProject'; -export * from './getProjectCategoryById'; -export * from './getProjectComponents'; -export * from './getProjectComponentsPaginated'; -export * from './getProjectContextMapping'; -export * from './getProjectEmail'; -export * from './getProjectIssueSecurityScheme'; -export * from './getProjectProperty'; -export * from './getProjectPropertyKeys'; -export * from './getProjectRole'; -export * from './getProjectRoleActorsForRole'; -export * from './getProjectRoleById'; -export * from './getProjectRoleDetails'; -export * from './getProjectRoles'; -export * from './getProjectsForIssueTypeScreenScheme'; -export * from './getProjectTypeByKey'; -export * from './getProjectVersions'; -export * from './getProjectVersionsPaginated'; -export * from './getRecent'; -export * from './getRemoteIssueLinkById'; -export * from './getRemoteIssueLinks'; -export * from './getScreens'; -export * from './getScreenSchemes'; -export * from './getScreensForField'; -export * from './getSecurityLevelMembers'; -export * from './getSecurityLevels'; -export * from './getSecurityLevelsForProject'; -export * from './getSelectableIssueFieldOptions'; -export * from './getSharePermission'; -export * from './getSharePermissions'; -export * from './getStatus'; -export * from './getStatusCategory'; -export * from './getStatusesById'; -export * from './getTask'; -export * from './getTransitions'; -export * from './getTrashedFieldsPaginated'; -export * from './getUiModifications'; -export * from './getUser'; -export * from './getUserDefaultColumns'; -export * from './getUserEmail'; -export * from './getUserEmailBulk'; -export * from './getUserGroups'; -export * from './getUserProperty'; -export * from './getUserPropertyKeys'; -export * from './getUsersFromGroup'; -export * from './getValidProjectKey'; -export * from './getValidProjectName'; -export * from './getVersion'; -export * from './getVersionRelatedIssues'; -export * from './getVersionUnresolvedIssues'; -export * from './getVisibleIssueFieldOptions'; -export * from './getVotes'; -export * from './getWorkflow'; -export * from './getWorkflowScheme'; -export * from './getWorkflowSchemeDraft'; -export * from './getWorkflowSchemeDraftIssueType'; -export * from './getWorkflowSchemeIssueType'; -export * from './getWorkflowSchemeProjectAssociations'; -export * from './getWorkflowsPaginated'; -export * from './getWorkflowTransitionProperties'; -export * from './getWorkflowTransitionRuleConfigurations'; -export * from './getWorklog'; -export * from './getWorklogProperty'; -export * from './getWorklogPropertyKeys'; -export * from './getWorklogsForIds'; -export * from './linkIssues'; -export * from './matchIssues'; -export * from './mergeVersions'; -export * from './migrateQueries'; -export * from './movePriorities'; -export * from './moveResolutions'; -export * from './moveScreenTab'; -export * from './moveScreenTabField'; -export * from './moveVersion'; -export * from './notify'; -export * from './parseJqlQueries'; -export * from './partialUpdateProjectRole'; -export * from './publishDraftWorkflowScheme'; -export * from './putAddonProperty'; -export * from './putAppProperty'; -export * from './refreshWebhooks'; -export * from './registerDynamicWebhooks'; -export * from './registerModules'; -export * from './removeAttachment'; -export * from './removeCustomFieldContextFromProjects'; -export * from './removeGadget'; -export * from './removeGroup'; -export * from './removeIssueTypeFromIssueTypeScheme'; -export * from './removeIssueTypesFromContext'; -export * from './removeIssueTypesFromGlobalFieldConfigurationScheme'; -export * from './removeLevel'; -export * from './removeMappingsFromIssueTypeScreenScheme'; -export * from './removeMemberFromSecurityLevel'; -export * from './removeModules'; -export * from './removeNotificationFromNotificationScheme'; -export * from './removePreference'; -export * from './removeProjectCategory'; -export * from './removeScreenTabField'; -export * from './removeUser'; -export * from './removeUserFromGroup'; -export * from './removeVote'; -export * from './removeWatcher'; -export * from './renameScreenTab'; -export * from './reorderCustomFieldOptions'; -export * from './reorderIssueTypesInIssueTypeScheme'; -export * from './replaceIssueFieldOption'; -export * from './resetColumns'; -export * from './resetUserColumns'; -export * from './restore'; -export * from './restoreCustomField'; -export * from './sanitiseJqlQueries'; -export * from './search'; -export * from './searchForIssuesUsingJql'; -export * from './searchForIssuesUsingJqlPost'; -export * from './searchPriorities'; -export * from './searchProjects'; -export * from './searchProjectsUsingSecuritySchemes'; -export * from './searchResolutions'; -export * from './searchSecuritySchemes'; -export * from './selectTimeTrackingImplementation'; -export * from './setActors'; -export * from './setApplicationProperty'; -export * from './setBanner'; -export * from './setColumns'; -export * from './setCommentProperty'; -export * from './setDashboardItemProperty'; -export * from './setDefaultLevels'; -export * from './setDefaultPriority'; -export * from './setDefaultResolution'; -export * from './setDefaultShareScope'; -export * from './setDefaultValues'; -export * from './setFavouriteForFilter'; -export * from './setFieldConfigurationSchemeMapping'; -export * from './setIssueProperty'; -export * from './setIssueTypeProperty'; -export * from './setPreference'; -export * from './setProjectProperty'; -export * from './setSharedTimeTrackingConfiguration'; -export * from './setUserColumns'; -export * from './setUserProperty'; -export * from './setWorkflowSchemeDraftIssueType'; -export * from './setWorkflowSchemeIssueType'; -export * from './setWorklogProperty'; -export * from './storeAvatar'; -export * from './toggleFeatureForProject'; -export * from './trashCustomField'; -export * from './unarchiveIssues'; -export * from './updateComment'; -export * from './updateComponent'; -export * from './updateCustomField'; -export * from './updateCustomFieldConfiguration'; -export * from './updateCustomFieldContext'; -export * from './updateCustomFieldOption'; -export * from './updateCustomFieldValue'; -export * from './updateDashboard'; -export * from './updateDefaultScreenScheme'; -export * from './updateDefaultWorkflow'; -export * from './updateDraftDefaultWorkflow'; -export * from './updateDraftWorkflowMapping'; -export * from './updateEntityPropertiesValue'; -export * from './updateFieldConfiguration'; -export * from './updateFieldConfigurationItems'; -export * from './updateFieldConfigurationScheme'; -export * from './updateFilter'; -export * from './updateGadget'; -export * from './updateIssueFieldOption'; -export * from './updateIssueFields'; -export * from './updateIssueLinkType'; -export * from './updateIssueSecurityScheme'; -export * from './updateIssueType'; -export * from './updateIssueTypeScheme'; -export * from './updateIssueTypeScreenScheme'; -export * from './updateMultipleCustomFieldValues'; -export * from './updateNotificationScheme'; -export * from './updatePermissionScheme'; -export * from './updatePrecomputations'; -export * from './updatePriority'; -export * from './updateProject'; -export * from './updateProjectAvatar'; -export * from './updateProjectCategory'; -export * from './updateProjectEmail'; -export * from './updateRemoteIssueLink'; -export * from './updateResolution'; -export * from './updateScreen'; -export * from './updateScreenScheme'; -export * from './updateSecurityLevel'; -export * from './updateStatuses'; -export * from './updateUiModification'; -export * from './updateVersion'; -export * from './updateWorkflowMapping'; -export * from './updateWorkflowScheme'; -export * from './updateWorkflowSchemeDraft'; -export * from './updateWorkflowTransitionProperty'; -export * from './updateWorkflowTransitionRuleConfigurations'; -export * from './updateWorklog'; -export * from './validateProjectKey'; -export * from './workflowRuleSearch'; diff --git a/src/version3/parameters/linkIssues.mts b/src/version3/parameters/linkIssues.mts new file mode 100644 index 0000000000..5b913d2465 --- /dev/null +++ b/src/version3/parameters/linkIssues.mts @@ -0,0 +1,3 @@ +import { LinkIssueRequestJson } from '../models/index.mjs'; + +export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version3/parameters/linkIssues.ts b/src/version3/parameters/linkIssues.ts deleted file mode 100644 index 97b98bdab9..0000000000 --- a/src/version3/parameters/linkIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { LinkIssueRequestJson } from '../models'; - -export interface LinkIssues extends LinkIssueRequestJson {} diff --git a/src/version3/parameters/matchIssues.mts b/src/version3/parameters/matchIssues.mts new file mode 100644 index 0000000000..10f28eb7ef --- /dev/null +++ b/src/version3/parameters/matchIssues.mts @@ -0,0 +1,3 @@ +import { IssuesAndJQLQueries } from '../models/index.mjs'; + +export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version3/parameters/matchIssues.ts b/src/version3/parameters/matchIssues.ts deleted file mode 100644 index d8f0f3cc07..0000000000 --- a/src/version3/parameters/matchIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssuesAndJQLQueries } from '../models'; - -export interface MatchIssues extends IssuesAndJQLQueries {} diff --git a/src/version3/parameters/mergeVersions.ts b/src/version3/parameters/mergeVersions.mts similarity index 100% rename from src/version3/parameters/mergeVersions.ts rename to src/version3/parameters/mergeVersions.mts diff --git a/src/version3/parameters/migrateQueries.mts b/src/version3/parameters/migrateQueries.mts new file mode 100644 index 0000000000..6a6dd34d72 --- /dev/null +++ b/src/version3/parameters/migrateQueries.mts @@ -0,0 +1,3 @@ +import { JQLPersonalDataMigrationRequest } from '../models/index.mjs'; + +export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version3/parameters/migrateQueries.ts b/src/version3/parameters/migrateQueries.ts deleted file mode 100644 index c6c7aac9ce..0000000000 --- a/src/version3/parameters/migrateQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JQLPersonalDataMigrationRequest } from '../models'; - -export interface MigrateQueries extends JQLPersonalDataMigrationRequest {} diff --git a/src/version3/parameters/movePriorities.mts b/src/version3/parameters/movePriorities.mts new file mode 100644 index 0000000000..f9e8521f84 --- /dev/null +++ b/src/version3/parameters/movePriorities.mts @@ -0,0 +1,3 @@ +import { ReorderIssuePriorities } from '../models/index.mjs'; + +export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version3/parameters/movePriorities.ts b/src/version3/parameters/movePriorities.ts deleted file mode 100644 index 34061dae91..0000000000 --- a/src/version3/parameters/movePriorities.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ReorderIssuePriorities } from '../models'; - -export interface MovePriorities extends ReorderIssuePriorities {} diff --git a/src/version3/parameters/moveResolutions.mts b/src/version3/parameters/moveResolutions.mts new file mode 100644 index 0000000000..0e1d9a829d --- /dev/null +++ b/src/version3/parameters/moveResolutions.mts @@ -0,0 +1,3 @@ +import { ReorderIssueResolutionsRequest } from '../models/index.mjs'; + +export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version3/parameters/moveResolutions.ts b/src/version3/parameters/moveResolutions.ts deleted file mode 100644 index 9935490feb..0000000000 --- a/src/version3/parameters/moveResolutions.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ReorderIssueResolutionsRequest } from '../models'; - -export interface MoveResolutions extends ReorderIssueResolutionsRequest {} diff --git a/src/version3/parameters/moveScreenTab.ts b/src/version3/parameters/moveScreenTab.mts similarity index 100% rename from src/version3/parameters/moveScreenTab.ts rename to src/version3/parameters/moveScreenTab.mts diff --git a/src/version3/parameters/moveScreenTabField.mts b/src/version3/parameters/moveScreenTabField.mts new file mode 100644 index 0000000000..0ed677e4e5 --- /dev/null +++ b/src/version3/parameters/moveScreenTabField.mts @@ -0,0 +1,10 @@ +import { MoveField } from '../models/index.mjs'; + +export interface MoveScreenTabField extends MoveField { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; + /** The ID of the field. */ + id: string; +} diff --git a/src/version3/parameters/moveScreenTabField.ts b/src/version3/parameters/moveScreenTabField.ts deleted file mode 100644 index 7ef37bff6a..0000000000 --- a/src/version3/parameters/moveScreenTabField.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { MoveField } from '../models'; - -export interface MoveScreenTabField extends MoveField { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; - /** The ID of the field. */ - id: string; -} diff --git a/src/version3/parameters/moveVersion.mts b/src/version3/parameters/moveVersion.mts new file mode 100644 index 0000000000..406cf9055f --- /dev/null +++ b/src/version3/parameters/moveVersion.mts @@ -0,0 +1,6 @@ +import { VersionMove } from '../models/index.mjs'; + +export interface MoveVersion extends VersionMove { + /** The ID of the version to be moved. */ + id: string; +} diff --git a/src/version3/parameters/moveVersion.ts b/src/version3/parameters/moveVersion.ts deleted file mode 100644 index bba5c554ad..0000000000 --- a/src/version3/parameters/moveVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { VersionMove } from '../models'; - -export interface MoveVersion extends VersionMove { - /** The ID of the version to be moved. */ - id: string; -} diff --git a/src/version3/parameters/notify.mts b/src/version3/parameters/notify.mts new file mode 100644 index 0000000000..1485a42062 --- /dev/null +++ b/src/version3/parameters/notify.mts @@ -0,0 +1,6 @@ +import { Notification } from '../models/index.mjs'; + +export interface Notify extends Notification { + /** ID or key of the issue that the notification is sent for. */ + issueIdOrKey: string; +} diff --git a/src/version3/parameters/notify.ts b/src/version3/parameters/notify.ts deleted file mode 100644 index a14c2dc095..0000000000 --- a/src/version3/parameters/notify.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Notification } from '../models'; - -export interface Notify extends Notification { - /** ID or key of the issue that the notification is sent for. */ - issueIdOrKey: string; -} diff --git a/src/version3/parameters/parseJqlQueries.mts b/src/version3/parameters/parseJqlQueries.mts new file mode 100644 index 0000000000..5f8584cb29 --- /dev/null +++ b/src/version3/parameters/parseJqlQueries.mts @@ -0,0 +1,13 @@ +import { JqlQueriesToParse } from '../models/index.mjs'; + +export interface ParseJqlQueries extends JqlQueriesToParse { + /** + * How to validate the Jql query and treat the validation results. Validation options include: + * + * - `strict` Returns all errors. If validation fails, the query structure is not returned. + * - `warn` Returns all errors. If validation fails but the Jql query is correctly formed, the query structure is + * returned. + * - `none` No validation is performed. If Jql query is correctly formed, the query structure is returned. + */ + validation?: 'strict' | 'warn' | 'none' | string; +} diff --git a/src/version3/parameters/parseJqlQueries.ts b/src/version3/parameters/parseJqlQueries.ts deleted file mode 100644 index 13445147e3..0000000000 --- a/src/version3/parameters/parseJqlQueries.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { JqlQueriesToParse } from '../models'; - -export interface ParseJqlQueries extends JqlQueriesToParse { - /** - * How to validate the JQL query and treat the validation results. Validation options include: - * - * - `strict` Returns all errors. If validation fails, the query structure is not returned. - * - `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is - * returned. - * - `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. - */ - validation?: 'strict' | 'warn' | 'none' | string; -} diff --git a/src/version3/parameters/partialUpdateProjectRole.mts b/src/version3/parameters/partialUpdateProjectRole.mts new file mode 100644 index 0000000000..abe1dbc8dd --- /dev/null +++ b/src/version3/parameters/partialUpdateProjectRole.mts @@ -0,0 +1,9 @@ +import { CreateUpdateRoleRequest } from '../models/index.mjs'; + +export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { + /** + * 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. + */ + id: number; +} diff --git a/src/version3/parameters/partialUpdateProjectRole.ts b/src/version3/parameters/partialUpdateProjectRole.ts deleted file mode 100644 index 5682d3276f..0000000000 --- a/src/version3/parameters/partialUpdateProjectRole.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CreateUpdateRoleRequest } from '../models'; - -export interface PartialUpdateProjectRole extends CreateUpdateRoleRequest { - /** - * 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. - */ - id: number; -} diff --git a/src/version3/parameters/publishDraftWorkflowScheme.mts b/src/version3/parameters/publishDraftWorkflowScheme.mts new file mode 100644 index 0000000000..4befa82a0c --- /dev/null +++ b/src/version3/parameters/publishDraftWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { StatusMapping } from '../models/index.mjs'; + +export interface PublishDraftWorkflowScheme { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** Whether the request only performs a validation. */ + validateOnly?: boolean; + statusMappings?: StatusMapping[]; +} diff --git a/src/version3/parameters/publishDraftWorkflowScheme.ts b/src/version3/parameters/publishDraftWorkflowScheme.ts deleted file mode 100644 index 683095758e..0000000000 --- a/src/version3/parameters/publishDraftWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { StatusMapping } from '../models'; - -export interface PublishDraftWorkflowScheme { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** Whether the request only performs a validation. */ - validateOnly?: boolean; - statusMappings?: StatusMapping[]; -} diff --git a/src/version3/parameters/putAddonProperty.ts b/src/version3/parameters/putAddonProperty.mts similarity index 100% rename from src/version3/parameters/putAddonProperty.ts rename to src/version3/parameters/putAddonProperty.mts diff --git a/src/version3/parameters/putAppProperty.ts b/src/version3/parameters/putAppProperty.mts similarity index 100% rename from src/version3/parameters/putAppProperty.ts rename to src/version3/parameters/putAppProperty.mts diff --git a/src/version3/parameters/refreshWebhooks.mts b/src/version3/parameters/refreshWebhooks.mts new file mode 100644 index 0000000000..33d4bceaa1 --- /dev/null +++ b/src/version3/parameters/refreshWebhooks.mts @@ -0,0 +1,3 @@ +import { ContainerForWebhookIDs } from '../models/index.mjs'; + +export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/refreshWebhooks.ts b/src/version3/parameters/refreshWebhooks.ts deleted file mode 100644 index b1b130af0d..0000000000 --- a/src/version3/parameters/refreshWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ContainerForWebhookIDs } from '../models'; - -export interface RefreshWebhooks extends ContainerForWebhookIDs {} diff --git a/src/version3/parameters/registerDynamicWebhooks.mts b/src/version3/parameters/registerDynamicWebhooks.mts new file mode 100644 index 0000000000..b88825dc52 --- /dev/null +++ b/src/version3/parameters/registerDynamicWebhooks.mts @@ -0,0 +1,3 @@ +import { WebhookRegistrationDetails } from '../models/index.mjs'; + +export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version3/parameters/registerDynamicWebhooks.ts b/src/version3/parameters/registerDynamicWebhooks.ts deleted file mode 100644 index 3cf5329e12..0000000000 --- a/src/version3/parameters/registerDynamicWebhooks.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WebhookRegistrationDetails } from '../models'; - -export interface RegisterDynamicWebhooks extends WebhookRegistrationDetails {} diff --git a/src/version3/parameters/registerModules.mts b/src/version3/parameters/registerModules.mts new file mode 100644 index 0000000000..3d88a2183b --- /dev/null +++ b/src/version3/parameters/registerModules.mts @@ -0,0 +1,3 @@ +import { ConnectModules } from '../models/index.mjs'; + +export interface RegisterModules extends ConnectModules {} diff --git a/src/version3/parameters/registerModules.ts b/src/version3/parameters/registerModules.ts deleted file mode 100644 index 6ae8188408..0000000000 --- a/src/version3/parameters/registerModules.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ConnectModules } from '../models'; - -export interface RegisterModules extends ConnectModules {} diff --git a/src/version3/parameters/removeAttachment.ts b/src/version3/parameters/removeAttachment.mts similarity index 100% rename from src/version3/parameters/removeAttachment.ts rename to src/version3/parameters/removeAttachment.mts diff --git a/src/version3/parameters/removeCustomFieldContextFromProjects.mts b/src/version3/parameters/removeCustomFieldContextFromProjects.mts new file mode 100644 index 0000000000..b1c3958a0c --- /dev/null +++ b/src/version3/parameters/removeCustomFieldContextFromProjects.mts @@ -0,0 +1,8 @@ +import { ProjectIds } from '../models/index.mjs'; + +export interface RemoveCustomFieldContextFromProjects extends ProjectIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/removeCustomFieldContextFromProjects.ts b/src/version3/parameters/removeCustomFieldContextFromProjects.ts deleted file mode 100644 index 73b0cf9ba4..0000000000 --- a/src/version3/parameters/removeCustomFieldContextFromProjects.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectIds } from '../models'; - -export interface RemoveCustomFieldContextFromProjects extends ProjectIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/removeGadget.ts b/src/version3/parameters/removeGadget.mts similarity index 100% rename from src/version3/parameters/removeGadget.ts rename to src/version3/parameters/removeGadget.mts diff --git a/src/version3/parameters/removeGroup.ts b/src/version3/parameters/removeGroup.mts similarity index 100% rename from src/version3/parameters/removeGroup.ts rename to src/version3/parameters/removeGroup.mts diff --git a/src/version3/parameters/removeIssueTypeFromIssueTypeScheme.ts b/src/version3/parameters/removeIssueTypeFromIssueTypeScheme.mts similarity index 100% rename from src/version3/parameters/removeIssueTypeFromIssueTypeScheme.ts rename to src/version3/parameters/removeIssueTypeFromIssueTypeScheme.mts diff --git a/src/version3/parameters/removeIssueTypesFromContext.mts b/src/version3/parameters/removeIssueTypesFromContext.mts new file mode 100644 index 0000000000..cc50dcd40f --- /dev/null +++ b/src/version3/parameters/removeIssueTypesFromContext.mts @@ -0,0 +1,8 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromContext extends IssueTypeIds { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/removeIssueTypesFromContext.ts b/src/version3/parameters/removeIssueTypesFromContext.ts deleted file mode 100644 index f8e821cc15..0000000000 --- a/src/version3/parameters/removeIssueTypesFromContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface RemoveIssueTypesFromContext extends IssueTypeIds { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts b/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts new file mode 100644 index 0000000000..f78e9be219 --- /dev/null +++ b/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIdsToRemove } from '../models/index.mjs'; + +export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts b/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts deleted file mode 100644 index fc0fc1cdd0..0000000000 --- a/src/version3/parameters/removeIssueTypesFromGlobalFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeIdsToRemove } from '../models'; - -export interface RemoveIssueTypesFromGlobalFieldConfigurationScheme extends IssueTypeIdsToRemove { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version3/parameters/removeLevel.ts b/src/version3/parameters/removeLevel.mts similarity index 100% rename from src/version3/parameters/removeLevel.ts rename to src/version3/parameters/removeLevel.mts diff --git a/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts b/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..117d550ce6 --- /dev/null +++ b/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeIds } from '../models/index.mjs'; + +export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts b/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts deleted file mode 100644 index bcf8aa10d1..0000000000 --- a/src/version3/parameters/removeMappingsFromIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeIds } from '../models'; - -export interface RemoveMappingsFromIssueTypeScreenScheme extends IssueTypeIds { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version3/parameters/removeMemberFromSecurityLevel.ts b/src/version3/parameters/removeMemberFromSecurityLevel.mts similarity index 100% rename from src/version3/parameters/removeMemberFromSecurityLevel.ts rename to src/version3/parameters/removeMemberFromSecurityLevel.mts diff --git a/src/version3/parameters/removeModules.ts b/src/version3/parameters/removeModules.mts similarity index 100% rename from src/version3/parameters/removeModules.ts rename to src/version3/parameters/removeModules.mts diff --git a/src/version3/parameters/removeNotificationFromNotificationScheme.ts b/src/version3/parameters/removeNotificationFromNotificationScheme.mts similarity index 100% rename from src/version3/parameters/removeNotificationFromNotificationScheme.ts rename to src/version3/parameters/removeNotificationFromNotificationScheme.mts diff --git a/src/version3/parameters/removePreference.ts b/src/version3/parameters/removePreference.mts similarity index 100% rename from src/version3/parameters/removePreference.ts rename to src/version3/parameters/removePreference.mts diff --git a/src/version3/parameters/removeProjectCategory.ts b/src/version3/parameters/removeProjectCategory.mts similarity index 100% rename from src/version3/parameters/removeProjectCategory.ts rename to src/version3/parameters/removeProjectCategory.mts diff --git a/src/version3/parameters/removeScreenTabField.ts b/src/version3/parameters/removeScreenTabField.mts similarity index 100% rename from src/version3/parameters/removeScreenTabField.ts rename to src/version3/parameters/removeScreenTabField.mts diff --git a/src/version3/parameters/removeUser.ts b/src/version3/parameters/removeUser.mts similarity index 100% rename from src/version3/parameters/removeUser.ts rename to src/version3/parameters/removeUser.mts diff --git a/src/version3/parameters/removeUserFromGroup.ts b/src/version3/parameters/removeUserFromGroup.mts similarity index 100% rename from src/version3/parameters/removeUserFromGroup.ts rename to src/version3/parameters/removeUserFromGroup.mts diff --git a/src/version3/parameters/removeVote.ts b/src/version3/parameters/removeVote.mts similarity index 100% rename from src/version3/parameters/removeVote.ts rename to src/version3/parameters/removeVote.mts diff --git a/src/version3/parameters/removeWatcher.ts b/src/version3/parameters/removeWatcher.mts similarity index 100% rename from src/version3/parameters/removeWatcher.ts rename to src/version3/parameters/removeWatcher.mts diff --git a/src/version3/parameters/renameScreenTab.mts b/src/version3/parameters/renameScreenTab.mts new file mode 100644 index 0000000000..593fc37053 --- /dev/null +++ b/src/version3/parameters/renameScreenTab.mts @@ -0,0 +1,8 @@ +import { ScreenableTab } from '../models/index.mjs'; + +export interface RenameScreenTab extends ScreenableTab { + /** The ID of the screen. */ + screenId: number; + /** The ID of the screen tab. */ + tabId: number; +} diff --git a/src/version3/parameters/renameScreenTab.ts b/src/version3/parameters/renameScreenTab.ts deleted file mode 100644 index e9323d559c..0000000000 --- a/src/version3/parameters/renameScreenTab.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ScreenableTab } from '../models'; - -export interface RenameScreenTab extends ScreenableTab { - /** The ID of the screen. */ - screenId: number; - /** The ID of the screen tab. */ - tabId: number; -} diff --git a/src/version3/parameters/reorderCustomFieldOptions.mts b/src/version3/parameters/reorderCustomFieldOptions.mts new file mode 100644 index 0000000000..9d2f7ff590 --- /dev/null +++ b/src/version3/parameters/reorderCustomFieldOptions.mts @@ -0,0 +1,8 @@ +import { OrderOfCustomFieldOptions } from '../models/index.mjs'; + +export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/reorderCustomFieldOptions.ts b/src/version3/parameters/reorderCustomFieldOptions.ts deleted file mode 100644 index 4e96129be5..0000000000 --- a/src/version3/parameters/reorderCustomFieldOptions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { OrderOfCustomFieldOptions } from '../models'; - -export interface ReorderCustomFieldOptions extends OrderOfCustomFieldOptions { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts b/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts new file mode 100644 index 0000000000..d9f4c60612 --- /dev/null +++ b/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { OrderOfIssueTypes } from '../models/index.mjs'; + +export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts b/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts deleted file mode 100644 index 86bfa584e5..0000000000 --- a/src/version3/parameters/reorderIssueTypesInIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { OrderOfIssueTypes } from '../models'; - -export interface ReorderIssueTypesInIssueTypeScheme extends OrderOfIssueTypes { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version3/parameters/replaceIssueFieldOption.mts b/src/version3/parameters/replaceIssueFieldOption.mts new file mode 100644 index 0000000000..629f7301ee --- /dev/null +++ b/src/version3/parameters/replaceIssueFieldOption.mts @@ -0,0 +1,28 @@ +export interface ReplaceIssueFieldOption { + /** 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; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app + * users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app + * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be deselected. */ + optionId: number; +} diff --git a/src/version3/parameters/replaceIssueFieldOption.ts b/src/version3/parameters/replaceIssueFieldOption.ts deleted file mode 100644 index fd536f3d28..0000000000 --- a/src/version3/parameters/replaceIssueFieldOption.ts +++ /dev/null @@ -1,28 +0,0 @@ -export interface ReplaceIssueFieldOption { - /** 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; - /** - * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app - * users with admin permission. - */ - overrideScreenSecurity?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app - * users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be deselected. */ - optionId: number; -} diff --git a/src/version3/parameters/resetColumns.ts b/src/version3/parameters/resetColumns.mts similarity index 100% rename from src/version3/parameters/resetColumns.ts rename to src/version3/parameters/resetColumns.mts diff --git a/src/version3/parameters/resetUserColumns.ts b/src/version3/parameters/resetUserColumns.mts similarity index 100% rename from src/version3/parameters/resetUserColumns.ts rename to src/version3/parameters/resetUserColumns.mts diff --git a/src/version3/parameters/restore.ts b/src/version3/parameters/restore.mts similarity index 100% rename from src/version3/parameters/restore.ts rename to src/version3/parameters/restore.mts diff --git a/src/version3/parameters/restoreCustomField.ts b/src/version3/parameters/restoreCustomField.mts similarity index 100% rename from src/version3/parameters/restoreCustomField.ts rename to src/version3/parameters/restoreCustomField.mts diff --git a/src/version3/parameters/sanitiseJqlQueries.mts b/src/version3/parameters/sanitiseJqlQueries.mts new file mode 100644 index 0000000000..d9517074f2 --- /dev/null +++ b/src/version3/parameters/sanitiseJqlQueries.mts @@ -0,0 +1,3 @@ +import { JqlQueriesToSanitize } from '../models/index.mjs'; + +export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version3/parameters/sanitiseJqlQueries.ts b/src/version3/parameters/sanitiseJqlQueries.ts deleted file mode 100644 index e37ef32274..0000000000 --- a/src/version3/parameters/sanitiseJqlQueries.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JqlQueriesToSanitize } from '../models'; - -export interface SanitiseJqlQueries extends JqlQueriesToSanitize {} diff --git a/src/version3/parameters/search.ts b/src/version3/parameters/search.mts similarity index 100% rename from src/version3/parameters/search.ts rename to src/version3/parameters/search.mts diff --git a/src/version3/parameters/searchForIssuesUsingJql.mts b/src/version3/parameters/searchForIssuesUsingJql.mts new file mode 100644 index 0000000000..710c5227e9 --- /dev/null +++ b/src/version3/parameters/searchForIssuesUsingJql.mts @@ -0,0 +1,66 @@ +export interface SearchForIssuesUsingJql { + /** + * The [Jql](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + * + * If no Jql expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms + * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, + * partial matches of the email address will not find the user. An exact match is required. + */ + jql?: 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. To manage page size, Jira 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. + */ + maxResults?: number; + /** + * Determines how to validate the Jql query and treat the validation results. Supported values are: + * + * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for + * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. + * + * Note: If the Jql is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: 'strict' | 'warn' | 'none' | 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. + * + * 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. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + * + * 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?: string[]; + /** + * 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. + */ + expand?: 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, + * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** Reference fields by their key (rather than ID). */ + fieldsByKeys?: boolean; +} diff --git a/src/version3/parameters/searchForIssuesUsingJql.ts b/src/version3/parameters/searchForIssuesUsingJql.ts deleted file mode 100644 index c47b71a6c1..0000000000 --- a/src/version3/parameters/searchForIssuesUsingJql.ts +++ /dev/null @@ -1,66 +0,0 @@ -export interface SearchForIssuesUsingJql { - /** - * The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: - * - * If no JQL expression is provided, all issues are returned. `username` and `userkey` cannot be used as search terms - * due to privacy reasons. Use `accountId` instead. If a user has hidden their email address in their user profile, - * partial matches of the email address will not find the user. An exact match is required. - */ - jql?: 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. To manage page size, Jira 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. - */ - maxResults?: number; - /** - * Determines how to validate the JQL query and treat the validation results. Supported values are: - * - * - `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). - * - `warn` Returns all errors as warnings. `none` No validation is performed. `true` _Deprecated_ A legacy synonym for - * - `strict`. `false` _Deprecated_ A legacy synonym for `warn`. - * - * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. - */ - validateQuery?: 'strict' | 'warn' | 'none' | 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. - * - * 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. - * - * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. - * - * 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?: string[]; - /** - * 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. - */ - expand?: 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, - * `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. - */ - properties?: string[]; - /** Reference fields by their key (rather than ID). */ - fieldsByKeys?: boolean; -} diff --git a/src/version3/parameters/searchForIssuesUsingJqlPost.mts b/src/version3/parameters/searchForIssuesUsingJqlPost.mts new file mode 100644 index 0000000000..d087fe6389 --- /dev/null +++ b/src/version3/parameters/searchForIssuesUsingJqlPost.mts @@ -0,0 +1,3 @@ +import { SearchRequest } from '../models/index.mjs'; + +export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version3/parameters/searchForIssuesUsingJqlPost.ts b/src/version3/parameters/searchForIssuesUsingJqlPost.ts deleted file mode 100644 index 0ffdf3cd98..0000000000 --- a/src/version3/parameters/searchForIssuesUsingJqlPost.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SearchRequest } from '../models'; - -export interface SearchForIssuesUsingJqlPost extends SearchRequest {} diff --git a/src/version3/parameters/searchPriorities.ts b/src/version3/parameters/searchPriorities.mts similarity index 100% rename from src/version3/parameters/searchPriorities.ts rename to src/version3/parameters/searchPriorities.mts diff --git a/src/version3/parameters/searchProjects.ts b/src/version3/parameters/searchProjects.mts similarity index 100% rename from src/version3/parameters/searchProjects.ts rename to src/version3/parameters/searchProjects.mts diff --git a/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version3/parameters/searchProjectsUsingSecuritySchemes.mts similarity index 100% rename from src/version3/parameters/searchProjectsUsingSecuritySchemes.ts rename to src/version3/parameters/searchProjectsUsingSecuritySchemes.mts diff --git a/src/version3/parameters/searchResolutions.ts b/src/version3/parameters/searchResolutions.mts similarity index 100% rename from src/version3/parameters/searchResolutions.ts rename to src/version3/parameters/searchResolutions.mts diff --git a/src/version3/parameters/searchSecuritySchemes.ts b/src/version3/parameters/searchSecuritySchemes.mts similarity index 100% rename from src/version3/parameters/searchSecuritySchemes.ts rename to src/version3/parameters/searchSecuritySchemes.mts diff --git a/src/version3/parameters/selectTimeTrackingImplementation.mts b/src/version3/parameters/selectTimeTrackingImplementation.mts new file mode 100644 index 0000000000..bc2fb949f5 --- /dev/null +++ b/src/version3/parameters/selectTimeTrackingImplementation.mts @@ -0,0 +1,3 @@ +import { TimeTrackingProvider } from '../models/index.mjs'; + +export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version3/parameters/selectTimeTrackingImplementation.ts b/src/version3/parameters/selectTimeTrackingImplementation.ts deleted file mode 100644 index 59c88b5c88..0000000000 --- a/src/version3/parameters/selectTimeTrackingImplementation.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TimeTrackingProvider } from '../models'; - -export interface SelectTimeTrackingImplementation extends TimeTrackingProvider {} diff --git a/src/version3/parameters/setActors.mts b/src/version3/parameters/setActors.mts new file mode 100644 index 0000000000..77a54cf56a --- /dev/null +++ b/src/version3/parameters/setActors.mts @@ -0,0 +1,11 @@ +import { ProjectRoleActorsUpdate } from '../models/index.mjs'; + +export interface SetActors extends ProjectRoleActorsUpdate { + /** The project ID or project key (case sensitive). */ + projectIdOrKey: string; + /** + * 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. + */ + id: number; +} diff --git a/src/version3/parameters/setActors.ts b/src/version3/parameters/setActors.ts deleted file mode 100644 index 07bf498caf..0000000000 --- a/src/version3/parameters/setActors.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ProjectRoleActorsUpdate } from '../models'; - -export interface SetActors extends ProjectRoleActorsUpdate { - /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; - /** - * 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. - */ - id: number; -} diff --git a/src/version3/parameters/setApplicationProperty.mts b/src/version3/parameters/setApplicationProperty.mts new file mode 100644 index 0000000000..a729fce3b4 --- /dev/null +++ b/src/version3/parameters/setApplicationProperty.mts @@ -0,0 +1,14 @@ +import { SimpleApplicationProperty } from '../models/index.mjs'; + +export interface SetApplicationProperty extends SimpleApplicationProperty { + /** The key of the application property to update. */ + id: string; + + body?: { + /** The ID of the application property. */ + id?: string; + + /** The new value. */ + value?: string; + }; +} diff --git a/src/version3/parameters/setApplicationProperty.ts b/src/version3/parameters/setApplicationProperty.ts deleted file mode 100644 index d10031a5c0..0000000000 --- a/src/version3/parameters/setApplicationProperty.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { SimpleApplicationProperty } from '../models'; - -export interface SetApplicationProperty extends SimpleApplicationProperty { - /** The key of the application property to update. */ - id: string; - - body?: { - /** The ID of the application property. */ - id?: string; - - /** The new value. */ - value?: string; - }; -} diff --git a/src/version3/parameters/setBanner.mts b/src/version3/parameters/setBanner.mts new file mode 100644 index 0000000000..29ff18a397 --- /dev/null +++ b/src/version3/parameters/setBanner.mts @@ -0,0 +1,3 @@ +import { AnnouncementBannerConfigurationUpdate } from '../models/index.mjs'; + +export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version3/parameters/setBanner.ts b/src/version3/parameters/setBanner.ts deleted file mode 100644 index 7cb120c52a..0000000000 --- a/src/version3/parameters/setBanner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { AnnouncementBannerConfigurationUpdate } from '../models'; - -export interface SetBanner extends AnnouncementBannerConfigurationUpdate {} diff --git a/src/version3/parameters/setColumns.ts b/src/version3/parameters/setColumns.mts similarity index 100% rename from src/version3/parameters/setColumns.ts rename to src/version3/parameters/setColumns.mts diff --git a/src/version3/parameters/setCommentProperty.ts b/src/version3/parameters/setCommentProperty.mts similarity index 100% rename from src/version3/parameters/setCommentProperty.ts rename to src/version3/parameters/setCommentProperty.mts diff --git a/src/version3/parameters/setDashboardItemProperty.ts b/src/version3/parameters/setDashboardItemProperty.mts similarity index 100% rename from src/version3/parameters/setDashboardItemProperty.ts rename to src/version3/parameters/setDashboardItemProperty.mts diff --git a/src/version3/parameters/setDefaultLevels.mts b/src/version3/parameters/setDefaultLevels.mts new file mode 100644 index 0000000000..34c8ce77b0 --- /dev/null +++ b/src/version3/parameters/setDefaultLevels.mts @@ -0,0 +1,3 @@ +import { SetDefaultLevelsRequest } from '../models/index.mjs'; + +export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version3/parameters/setDefaultLevels.ts b/src/version3/parameters/setDefaultLevels.ts deleted file mode 100644 index 5162dac472..0000000000 --- a/src/version3/parameters/setDefaultLevels.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SetDefaultLevelsRequest } from '../models'; - -export interface SetDefaultLevels extends SetDefaultLevelsRequest {} diff --git a/src/version3/parameters/setDefaultPriority.mts b/src/version3/parameters/setDefaultPriority.mts new file mode 100644 index 0000000000..c21ba5cc6b --- /dev/null +++ b/src/version3/parameters/setDefaultPriority.mts @@ -0,0 +1,3 @@ +import { SetDefaultPriorityRequest } from '../models/index.mjs'; + +export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version3/parameters/setDefaultPriority.ts b/src/version3/parameters/setDefaultPriority.ts deleted file mode 100644 index d93aa5f6fc..0000000000 --- a/src/version3/parameters/setDefaultPriority.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SetDefaultPriorityRequest } from '../models'; - -export interface SetDefaultPriority extends SetDefaultPriorityRequest {} diff --git a/src/version3/parameters/setDefaultResolution.mts b/src/version3/parameters/setDefaultResolution.mts new file mode 100644 index 0000000000..7231abde60 --- /dev/null +++ b/src/version3/parameters/setDefaultResolution.mts @@ -0,0 +1,3 @@ +import { SetDefaultResolutionRequest } from '../models/index.mjs'; + +export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version3/parameters/setDefaultResolution.ts b/src/version3/parameters/setDefaultResolution.ts deleted file mode 100644 index bbf4f9259a..0000000000 --- a/src/version3/parameters/setDefaultResolution.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { SetDefaultResolutionRequest } from '../models'; - -export interface SetDefaultResolution extends SetDefaultResolutionRequest {} diff --git a/src/version3/parameters/setDefaultShareScope.mts b/src/version3/parameters/setDefaultShareScope.mts new file mode 100644 index 0000000000..f915d2df56 --- /dev/null +++ b/src/version3/parameters/setDefaultShareScope.mts @@ -0,0 +1,3 @@ +import { DefaultShareScope } from '../models/index.mjs'; + +export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version3/parameters/setDefaultShareScope.ts b/src/version3/parameters/setDefaultShareScope.ts deleted file mode 100644 index e7cb2056fb..0000000000 --- a/src/version3/parameters/setDefaultShareScope.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DefaultShareScope } from '../models'; - -export interface SetDefaultShareScope extends DefaultShareScope {} diff --git a/src/version3/parameters/setDefaultValues.mts b/src/version3/parameters/setDefaultValues.mts new file mode 100644 index 0000000000..9359c4d779 --- /dev/null +++ b/src/version3/parameters/setDefaultValues.mts @@ -0,0 +1,6 @@ +import { CustomFieldContextDefaultValueUpdate } from '../models/index.mjs'; + +export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version3/parameters/setDefaultValues.ts b/src/version3/parameters/setDefaultValues.ts deleted file mode 100644 index 146ee52b27..0000000000 --- a/src/version3/parameters/setDefaultValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomFieldContextDefaultValueUpdate } from '../models'; - -export interface SetDefaultValues extends CustomFieldContextDefaultValueUpdate { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version3/parameters/setFavouriteForFilter.ts b/src/version3/parameters/setFavouriteForFilter.mts similarity index 100% rename from src/version3/parameters/setFavouriteForFilter.ts rename to src/version3/parameters/setFavouriteForFilter.mts diff --git a/src/version3/parameters/setFieldConfigurationSchemeMapping.mts b/src/version3/parameters/setFieldConfigurationSchemeMapping.mts new file mode 100644 index 0000000000..a782ef41dd --- /dev/null +++ b/src/version3/parameters/setFieldConfigurationSchemeMapping.mts @@ -0,0 +1,6 @@ +import { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models/index.mjs'; + +export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version3/parameters/setFieldConfigurationSchemeMapping.ts b/src/version3/parameters/setFieldConfigurationSchemeMapping.ts deleted file mode 100644 index bcb01324a7..0000000000 --- a/src/version3/parameters/setFieldConfigurationSchemeMapping.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { AssociateFieldConfigurationsWithIssueTypesRequest } from '../models'; - -export interface SetFieldConfigurationSchemeMapping extends AssociateFieldConfigurationsWithIssueTypesRequest { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version3/parameters/setIssueProperty.ts b/src/version3/parameters/setIssueProperty.mts similarity index 100% rename from src/version3/parameters/setIssueProperty.ts rename to src/version3/parameters/setIssueProperty.mts diff --git a/src/version3/parameters/setIssueTypeProperty.ts b/src/version3/parameters/setIssueTypeProperty.mts similarity index 100% rename from src/version3/parameters/setIssueTypeProperty.ts rename to src/version3/parameters/setIssueTypeProperty.mts diff --git a/src/version3/parameters/setPreference.ts b/src/version3/parameters/setPreference.mts similarity index 100% rename from src/version3/parameters/setPreference.ts rename to src/version3/parameters/setPreference.mts diff --git a/src/version3/parameters/setProjectProperty.ts b/src/version3/parameters/setProjectProperty.mts similarity index 100% rename from src/version3/parameters/setProjectProperty.ts rename to src/version3/parameters/setProjectProperty.mts diff --git a/src/version3/parameters/setSharedTimeTrackingConfiguration.mts b/src/version3/parameters/setSharedTimeTrackingConfiguration.mts new file mode 100644 index 0000000000..e97c080ff1 --- /dev/null +++ b/src/version3/parameters/setSharedTimeTrackingConfiguration.mts @@ -0,0 +1,3 @@ +import { TimeTrackingConfiguration } from '../models/index.mjs'; + +export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version3/parameters/setSharedTimeTrackingConfiguration.ts b/src/version3/parameters/setSharedTimeTrackingConfiguration.ts deleted file mode 100644 index 042570cb83..0000000000 --- a/src/version3/parameters/setSharedTimeTrackingConfiguration.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { TimeTrackingConfiguration } from '../models'; - -export interface SetSharedTimeTrackingConfiguration extends TimeTrackingConfiguration {} diff --git a/src/version3/parameters/setUserColumns.ts b/src/version3/parameters/setUserColumns.mts similarity index 100% rename from src/version3/parameters/setUserColumns.ts rename to src/version3/parameters/setUserColumns.mts diff --git a/src/version3/parameters/setUserProperty.ts b/src/version3/parameters/setUserProperty.mts similarity index 100% rename from src/version3/parameters/setUserProperty.ts rename to src/version3/parameters/setUserProperty.mts diff --git a/src/version3/parameters/setWorkflowSchemeDraftIssueType.mts b/src/version3/parameters/setWorkflowSchemeDraftIssueType.mts new file mode 100644 index 0000000000..c67e2d47e5 --- /dev/null +++ b/src/version3/parameters/setWorkflowSchemeDraftIssueType.mts @@ -0,0 +1,24 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details?: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + + /** The name of the workflow. */ + workflow?: string; + + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version3/parameters/setWorkflowSchemeDraftIssueType.ts b/src/version3/parameters/setWorkflowSchemeDraftIssueType.ts deleted file mode 100644 index 0c0eed3dde..0000000000 --- a/src/version3/parameters/setWorkflowSchemeDraftIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IssueTypeWorkflowMapping } from '../models'; - -export interface SetWorkflowSchemeDraftIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details?: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version3/parameters/setWorkflowSchemeIssueType.mts b/src/version3/parameters/setWorkflowSchemeIssueType.mts new file mode 100644 index 0000000000..213e194ca2 --- /dev/null +++ b/src/version3/parameters/setWorkflowSchemeIssueType.mts @@ -0,0 +1,24 @@ +import { IssueTypeWorkflowMapping } from '../models/index.mjs'; + +export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The ID of the issue type. */ + issueType: string; + + /** Details about the mapping between an issue type and a workflow. */ + details?: { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + + /** The name of the workflow. */ + workflow?: string; + + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the + * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types + * mapping. + */ + updateDraftIfNeeded?: boolean; + }; +} diff --git a/src/version3/parameters/setWorkflowSchemeIssueType.ts b/src/version3/parameters/setWorkflowSchemeIssueType.ts deleted file mode 100644 index 3195286a36..0000000000 --- a/src/version3/parameters/setWorkflowSchemeIssueType.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { IssueTypeWorkflowMapping } from '../models'; - -export interface SetWorkflowSchemeIssueType extends IssueTypeWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The ID of the issue type. */ - issueType: string; - - /** Details about the mapping between an issue type and a workflow. */ - details?: { - /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ - issueType?: string; - - /** The name of the workflow. */ - workflow?: string; - - /** - * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the - * workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types - * mapping. - */ - updateDraftIfNeeded?: boolean; - }; -} diff --git a/src/version3/parameters/setWorklogProperty.ts b/src/version3/parameters/setWorklogProperty.mts similarity index 100% rename from src/version3/parameters/setWorklogProperty.ts rename to src/version3/parameters/setWorklogProperty.mts diff --git a/src/version3/parameters/storeAvatar.ts b/src/version3/parameters/storeAvatar.mts similarity index 100% rename from src/version3/parameters/storeAvatar.ts rename to src/version3/parameters/storeAvatar.mts diff --git a/src/version3/parameters/toggleFeatureForProject.mts b/src/version3/parameters/toggleFeatureForProject.mts new file mode 100644 index 0000000000..3bcd5cfab8 --- /dev/null +++ b/src/version3/parameters/toggleFeatureForProject.mts @@ -0,0 +1,8 @@ +import { ProjectFeatureToggleRequest } from '../models/index.mjs'; + +export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; + /** The key of the feature. */ + featureKey: string; +} diff --git a/src/version3/parameters/toggleFeatureForProject.ts b/src/version3/parameters/toggleFeatureForProject.ts deleted file mode 100644 index c5a8fde0f7..0000000000 --- a/src/version3/parameters/toggleFeatureForProject.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ProjectFeatureToggleRequest } from '../models'; - -export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; - /** The key of the feature. */ - featureKey: string; -} diff --git a/src/version3/parameters/trashCustomField.ts b/src/version3/parameters/trashCustomField.mts similarity index 100% rename from src/version3/parameters/trashCustomField.ts rename to src/version3/parameters/trashCustomField.mts diff --git a/src/version3/parameters/unarchiveIssues.mts b/src/version3/parameters/unarchiveIssues.mts new file mode 100644 index 0000000000..d923e8b504 --- /dev/null +++ b/src/version3/parameters/unarchiveIssues.mts @@ -0,0 +1,3 @@ +import { IssueArchivalSyncRequest } from '../models/index.mjs'; + +export interface UnarchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/unarchiveIssues.ts b/src/version3/parameters/unarchiveIssues.ts deleted file mode 100644 index 4ed49161de..0000000000 --- a/src/version3/parameters/unarchiveIssues.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { IssueArchivalSyncRequest } from '../models'; - -export interface UnarchiveIssues extends IssueArchivalSyncRequest {} diff --git a/src/version3/parameters/updateComment.mts b/src/version3/parameters/updateComment.mts new file mode 100644 index 0000000000..05c869e605 --- /dev/null +++ b/src/version3/parameters/updateComment.mts @@ -0,0 +1,22 @@ +import { Comment } from '../models/index.mjs'; + +export interface UpdateComment extends Comment { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the comment. */ + id: string; + /** Whether users are notified when a comment is updated. */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with + * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on + * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body + * rendered in HTML. + */ + expand?: 'renderedBody' | ['renderedBody'] | string | string[]; +} diff --git a/src/version3/parameters/updateComment.ts b/src/version3/parameters/updateComment.ts deleted file mode 100644 index 3fe24754b9..0000000000 --- a/src/version3/parameters/updateComment.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Comment } from '../models'; - -export interface UpdateComment extends Comment { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the comment. */ - id: string; - /** Whether users are notified when a comment is updated. */ - notifyUsers?: boolean; - /** - * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with - * the _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on - * behalf of users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideEditableFlag?: boolean; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body - * rendered in HTML. - */ - expand?: 'renderedBody' | ['renderedBody'] | string | string[]; -} diff --git a/src/version3/parameters/updateComponent.mts b/src/version3/parameters/updateComponent.mts new file mode 100644 index 0000000000..83eaa7ed4a --- /dev/null +++ b/src/version3/parameters/updateComponent.mts @@ -0,0 +1,6 @@ +import { ProjectComponent } from '../models/index.mjs'; + +export interface UpdateComponent extends ProjectComponent { + /** The ID of the component. */ + id: string; +} diff --git a/src/version3/parameters/updateComponent.ts b/src/version3/parameters/updateComponent.ts deleted file mode 100644 index 8104c2388e..0000000000 --- a/src/version3/parameters/updateComponent.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ProjectComponent } from '../models'; - -export interface UpdateComponent extends ProjectComponent { - /** The ID of the component. */ - id: string; -} diff --git a/src/version3/parameters/updateCustomField.mts b/src/version3/parameters/updateCustomField.mts new file mode 100644 index 0000000000..92185635db --- /dev/null +++ b/src/version3/parameters/updateCustomField.mts @@ -0,0 +1,6 @@ +import { UpdateCustomFieldDetails } from '../models/index.mjs'; + +export interface UpdateCustomField extends UpdateCustomFieldDetails { + /** The ID of the custom field. */ + fieldId: string; +} diff --git a/src/version3/parameters/updateCustomField.ts b/src/version3/parameters/updateCustomField.ts deleted file mode 100644 index 465a16891d..0000000000 --- a/src/version3/parameters/updateCustomField.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateCustomFieldDetails } from '../models'; - -export interface UpdateCustomField extends UpdateCustomFieldDetails { - /** The ID of the custom field. */ - fieldId: string; -} diff --git a/src/version3/parameters/updateCustomFieldConfiguration.mts b/src/version3/parameters/updateCustomFieldConfiguration.mts new file mode 100644 index 0000000000..01de512fb9 --- /dev/null +++ b/src/version3/parameters/updateCustomFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { CustomFieldConfigurations } from '../models/index.mjs'; + +export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { + /** The ID or key of the custom field, for example `customfield_10000`. */ + fieldIdOrKey: string; +} diff --git a/src/version3/parameters/updateCustomFieldConfiguration.ts b/src/version3/parameters/updateCustomFieldConfiguration.ts deleted file mode 100644 index e35b4fe9d3..0000000000 --- a/src/version3/parameters/updateCustomFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CustomFieldConfigurations } from '../models'; - -export interface UpdateCustomFieldConfiguration extends CustomFieldConfigurations { - /** The ID or key of the custom field, for example `customfield_10000`. */ - fieldIdOrKey: string; -} diff --git a/src/version3/parameters/updateCustomFieldContext.mts b/src/version3/parameters/updateCustomFieldContext.mts new file mode 100644 index 0000000000..bf7f31a74b --- /dev/null +++ b/src/version3/parameters/updateCustomFieldContext.mts @@ -0,0 +1,8 @@ +import { CustomFieldContextUpdateDetails } from '../models/index.mjs'; + +export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/updateCustomFieldContext.ts b/src/version3/parameters/updateCustomFieldContext.ts deleted file mode 100644 index ec46c0f786..0000000000 --- a/src/version3/parameters/updateCustomFieldContext.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CustomFieldContextUpdateDetails } from '../models'; - -export interface UpdateCustomFieldContext extends CustomFieldContextUpdateDetails { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/updateCustomFieldOption.mts b/src/version3/parameters/updateCustomFieldOption.mts new file mode 100644 index 0000000000..65cf799f03 --- /dev/null +++ b/src/version3/parameters/updateCustomFieldOption.mts @@ -0,0 +1,8 @@ +import { BulkCustomFieldOptionUpdateRequest } from '../models/index.mjs'; + +export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/updateCustomFieldOption.ts b/src/version3/parameters/updateCustomFieldOption.ts deleted file mode 100644 index 04ad2a93ce..0000000000 --- a/src/version3/parameters/updateCustomFieldOption.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { BulkCustomFieldOptionUpdateRequest } from '../models'; - -export interface UpdateCustomFieldOption extends BulkCustomFieldOptionUpdateRequest { - /** The ID of the custom field. */ - fieldId: string; - /** The ID of the context. */ - contextId: number; -} diff --git a/src/version3/parameters/updateCustomFieldValue.mts b/src/version3/parameters/updateCustomFieldValue.mts new file mode 100644 index 0000000000..faf2c08893 --- /dev/null +++ b/src/version3/parameters/updateCustomFieldValue.mts @@ -0,0 +1,8 @@ +import { CustomFieldValueUpdateRequest } from '../models/index.mjs'; + +export interface UpdateCustomFieldValue extends CustomFieldValueUpdateRequest { + /** The ID or key of the custom field. For example, `customfield_10010`. */ + fieldIdOrKey: string; + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version3/parameters/updateCustomFieldValue.ts b/src/version3/parameters/updateCustomFieldValue.ts deleted file mode 100644 index 4d4a92289e..0000000000 --- a/src/version3/parameters/updateCustomFieldValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CustomFieldValueUpdateRequest } from '../models'; - -export interface UpdateCustomFieldValue extends CustomFieldValueUpdateRequest { - /** The ID or key of the custom field. For example, `customfield_10010`. */ - fieldIdOrKey: string; - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version3/parameters/updateDashboard.mts b/src/version3/parameters/updateDashboard.mts new file mode 100644 index 0000000000..e180543c87 --- /dev/null +++ b/src/version3/parameters/updateDashboard.mts @@ -0,0 +1,6 @@ +import { DashboardDetails } from '../models/index.mjs'; + +export interface UpdateDashboard extends DashboardDetails { + /** The ID of the dashboard to update. */ + id: string; +} diff --git a/src/version3/parameters/updateDashboard.ts b/src/version3/parameters/updateDashboard.ts deleted file mode 100644 index 3b01c0c2d9..0000000000 --- a/src/version3/parameters/updateDashboard.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DashboardDetails } from '../models'; - -export interface UpdateDashboard extends DashboardDetails { - /** The ID of the dashboard to update. */ - id: string; -} diff --git a/src/version3/parameters/updateDefaultScreenScheme.ts b/src/version3/parameters/updateDefaultScreenScheme.mts similarity index 100% rename from src/version3/parameters/updateDefaultScreenScheme.ts rename to src/version3/parameters/updateDefaultScreenScheme.mts diff --git a/src/version3/parameters/updateDefaultWorkflow.mts b/src/version3/parameters/updateDefaultWorkflow.mts new file mode 100644 index 0000000000..26baa37fe5 --- /dev/null +++ b/src/version3/parameters/updateDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme. */ + id: number; +} diff --git a/src/version3/parameters/updateDefaultWorkflow.ts b/src/version3/parameters/updateDefaultWorkflow.ts deleted file mode 100644 index e621a6b8d8..0000000000 --- a/src/version3/parameters/updateDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultWorkflow } from '../models'; - -export interface UpdateDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme. */ - id: number; -} diff --git a/src/version3/parameters/updateDraftDefaultWorkflow.mts b/src/version3/parameters/updateDraftDefaultWorkflow.mts new file mode 100644 index 0000000000..7ea28013a2 --- /dev/null +++ b/src/version3/parameters/updateDraftDefaultWorkflow.mts @@ -0,0 +1,6 @@ +import { DefaultWorkflow } from '../models/index.mjs'; + +export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; +} diff --git a/src/version3/parameters/updateDraftDefaultWorkflow.ts b/src/version3/parameters/updateDraftDefaultWorkflow.ts deleted file mode 100644 index d46d69a910..0000000000 --- a/src/version3/parameters/updateDraftDefaultWorkflow.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { DefaultWorkflow } from '../models'; - -export interface UpdateDraftDefaultWorkflow extends DefaultWorkflow { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; -} diff --git a/src/version3/parameters/updateDraftWorkflowMapping.mts b/src/version3/parameters/updateDraftWorkflowMapping.mts new file mode 100644 index 0000000000..43a88b8ce4 --- /dev/null +++ b/src/version3/parameters/updateDraftWorkflowMapping.mts @@ -0,0 +1,8 @@ +import { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme that the draft belongs to. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version3/parameters/updateDraftWorkflowMapping.ts b/src/version3/parameters/updateDraftWorkflowMapping.ts deleted file mode 100644 index fc3b798a72..0000000000 --- a/src/version3/parameters/updateDraftWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypesWorkflowMapping } from '../models'; - -export interface UpdateDraftWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme that the draft belongs to. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version3/parameters/updateEntityPropertiesValue.mts b/src/version3/parameters/updateEntityPropertiesValue.mts new file mode 100644 index 0000000000..286fe02fa5 --- /dev/null +++ b/src/version3/parameters/updateEntityPropertiesValue.mts @@ -0,0 +1,22 @@ +import { EntityPropertyDetails } from '../models/index.mjs'; + +export interface UpdateEntityPropertiesValue { + /** The app migration transfer ID. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; + /** The type indicating the object that contains the entity properties. */ + entityType: + | 'IssueProperty' + | 'CommentProperty' + | 'DashboardItemProperty' + | 'IssueTypeProperty' + | 'ProjectProperty' + | 'UserProperty' + | 'WorklogProperty' + | 'BoardProperty' + | 'SprintProperty' + | string; + + entities?: Array; +} diff --git a/src/version3/parameters/updateEntityPropertiesValue.ts b/src/version3/parameters/updateEntityPropertiesValue.ts deleted file mode 100644 index a77752c863..0000000000 --- a/src/version3/parameters/updateEntityPropertiesValue.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { EntityPropertyDetails } from '../models'; - -export interface UpdateEntityPropertiesValue { - /** The app migration transfer ID. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; - /** The type indicating the object that contains the entity properties. */ - entityType: - | 'IssueProperty' - | 'CommentProperty' - | 'DashboardItemProperty' - | 'IssueTypeProperty' - | 'ProjectProperty' - | 'UserProperty' - | 'WorklogProperty' - | 'BoardProperty' - | 'SprintProperty' - | string; - - entities?: Array; -} diff --git a/src/version3/parameters/updateFieldConfiguration.mts b/src/version3/parameters/updateFieldConfiguration.mts new file mode 100644 index 0000000000..6c0eebad89 --- /dev/null +++ b/src/version3/parameters/updateFieldConfiguration.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfiguration extends FieldConfigurationDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version3/parameters/updateFieldConfiguration.ts b/src/version3/parameters/updateFieldConfiguration.ts deleted file mode 100644 index bf2ff15f57..0000000000 --- a/src/version3/parameters/updateFieldConfiguration.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FieldConfigurationDetails } from '../models'; - -export interface UpdateFieldConfiguration extends FieldConfigurationDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version3/parameters/updateFieldConfigurationItems.mts b/src/version3/parameters/updateFieldConfigurationItems.mts new file mode 100644 index 0000000000..da43ec28ad --- /dev/null +++ b/src/version3/parameters/updateFieldConfigurationItems.mts @@ -0,0 +1,6 @@ +import { FieldConfigurationItemsDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { + /** The ID of the field configuration. */ + id: number; +} diff --git a/src/version3/parameters/updateFieldConfigurationItems.ts b/src/version3/parameters/updateFieldConfigurationItems.ts deleted file mode 100644 index f630610c79..0000000000 --- a/src/version3/parameters/updateFieldConfigurationItems.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FieldConfigurationItemsDetails } from '../models'; - -export interface UpdateFieldConfigurationItems extends FieldConfigurationItemsDetails { - /** The ID of the field configuration. */ - id: number; -} diff --git a/src/version3/parameters/updateFieldConfigurationScheme.mts b/src/version3/parameters/updateFieldConfigurationScheme.mts new file mode 100644 index 0000000000..da4f130a39 --- /dev/null +++ b/src/version3/parameters/updateFieldConfigurationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateFieldConfigurationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { + /** The ID of the field configuration scheme. */ + id: number; +} diff --git a/src/version3/parameters/updateFieldConfigurationScheme.ts b/src/version3/parameters/updateFieldConfigurationScheme.ts deleted file mode 100644 index 2cf81d6e6c..0000000000 --- a/src/version3/parameters/updateFieldConfigurationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateFieldConfigurationSchemeDetails } from '../models'; - -export interface UpdateFieldConfigurationScheme extends UpdateFieldConfigurationSchemeDetails { - /** The ID of the field configuration scheme. */ - id: number; -} diff --git a/src/version3/parameters/updateFilter.mts b/src/version3/parameters/updateFilter.mts new file mode 100644 index 0000000000..7328d8aa17 --- /dev/null +++ b/src/version3/parameters/updateFilter.mts @@ -0,0 +1,26 @@ +import { Filter } from '../models/index.mjs'; + +export interface UpdateFilter extends Omit { + /** The ID of the filter to update. */ + id: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that + * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it + * doesn't list any users. The list of users returned is limited to 1000, to access additional users append + * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use + * `?expand=sharedUsers[1001:2000]`. + * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the + * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is + * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For + * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: 'sharedUsers' | 'subscriptions' | ('sharedUsers' | 'subscriptions')[] | string | string[]; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. + * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; +} diff --git a/src/version3/parameters/updateFilter.ts b/src/version3/parameters/updateFilter.ts deleted file mode 100644 index e6d7e6384c..0000000000 --- a/src/version3/parameters/updateFilter.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Filter } from '../models'; - -export interface UpdateFilter extends Omit { - /** The ID of the filter to update. */ - id: number; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about filter in the response. This parameter accepts a comma-separated list. Expand options include: - * - * - `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that - * the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it - * doesn't list any users. The list of users returned is limited to 1000, to access additional users append - * `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use - * `?expand=sharedUsers[1001:2000]`. - * - `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the - * `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is - * limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For - * example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. - */ - expand?: 'sharedUsers' | 'subscriptions' | ('sharedUsers' | 'subscriptions')[] | string | string[]; - /** - * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. - * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - overrideSharePermissions?: boolean; -} diff --git a/src/version3/parameters/updateGadget.mts b/src/version3/parameters/updateGadget.mts new file mode 100644 index 0000000000..f6b2c56f8e --- /dev/null +++ b/src/version3/parameters/updateGadget.mts @@ -0,0 +1,8 @@ +import { DashboardGadgetUpdateRequest } from '../models/index.mjs'; + +export interface UpdateGadget extends DashboardGadgetUpdateRequest { + /** The ID of the dashboard. */ + dashboardId: number; + /** The ID of the gadget. */ + gadgetId: number; +} diff --git a/src/version3/parameters/updateGadget.ts b/src/version3/parameters/updateGadget.ts deleted file mode 100644 index 85df7bdfcf..0000000000 --- a/src/version3/parameters/updateGadget.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { DashboardGadgetUpdateRequest } from '../models'; - -export interface UpdateGadget extends DashboardGadgetUpdateRequest { - /** The ID of the dashboard. */ - dashboardId: number; - /** The ID of the gadget. */ - gadgetId: number; -} diff --git a/src/version3/parameters/updateIssueFieldOption.mts b/src/version3/parameters/updateIssueFieldOption.mts new file mode 100644 index 0000000000..e1ff1f2762 --- /dev/null +++ b/src/version3/parameters/updateIssueFieldOption.mts @@ -0,0 +1,16 @@ +import { IssueFieldOption } from '../models/index.mjs'; + +export interface UpdateIssueFieldOption extends IssueFieldOption { + /** + * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, + * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: + * + * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the + * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin + * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For + * example, `"key": "teams-add-on__team-issue-field"` + */ + fieldKey: string; + /** The ID of the option to be updated. */ + optionId: number; +} diff --git a/src/version3/parameters/updateIssueFieldOption.ts b/src/version3/parameters/updateIssueFieldOption.ts deleted file mode 100644 index 54ee478cf0..0000000000 --- a/src/version3/parameters/updateIssueFieldOption.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IssueFieldOption } from '../models'; - -export interface UpdateIssueFieldOption extends IssueFieldOption { - /** - * The field key is specified in the following format: **$(app-key)__$(field-key)**. For example, - * _example-add-on__example-issue-field_. To determine the `fieldKey` value, do one of the following: - * - * Open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the - * `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin - * Manager. run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For - * example, `"key": "teams-add-on__team-issue-field"` - */ - fieldKey: string; - /** The ID of the option to be updated. */ - optionId: number; -} diff --git a/src/version3/parameters/updateIssueFields.mts b/src/version3/parameters/updateIssueFields.mts new file mode 100644 index 0000000000..2928b6b9ba --- /dev/null +++ b/src/version3/parameters/updateIssueFields.mts @@ -0,0 +1,8 @@ +import { ConnectCustomFieldValues } from '../models/index.mjs'; + +export interface UpdateIssueFields extends ConnectCustomFieldValues { + /** The ID of the transfer. */ + transferId: string; + /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ + accountId: string; +} diff --git a/src/version3/parameters/updateIssueFields.ts b/src/version3/parameters/updateIssueFields.ts deleted file mode 100644 index 94f32c8e2d..0000000000 --- a/src/version3/parameters/updateIssueFields.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ConnectCustomFieldValues } from '../models'; - -export interface UpdateIssueFields extends ConnectCustomFieldValues { - /** The ID of the transfer. */ - transferId: string; - /** The Atlassian account ID of the impersonated user. This user must be a member of the site admin group. */ - accountId: string; -} diff --git a/src/version3/parameters/updateIssueLinkType.mts b/src/version3/parameters/updateIssueLinkType.mts new file mode 100644 index 0000000000..2dcdc0b236 --- /dev/null +++ b/src/version3/parameters/updateIssueLinkType.mts @@ -0,0 +1,6 @@ +import { IssueLinkType } from '../models/index.mjs'; + +export interface UpdateIssueLinkType extends IssueLinkType { + /** The ID of the issue link type. */ + issueLinkTypeId: string; +} diff --git a/src/version3/parameters/updateIssueLinkType.ts b/src/version3/parameters/updateIssueLinkType.ts deleted file mode 100644 index be02787442..0000000000 --- a/src/version3/parameters/updateIssueLinkType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueLinkType } from '../models'; - -export interface UpdateIssueLinkType extends IssueLinkType { - /** The ID of the issue link type. */ - issueLinkTypeId: string; -} diff --git a/src/version3/parameters/updateIssueSecurityScheme.mts b/src/version3/parameters/updateIssueSecurityScheme.mts new file mode 100644 index 0000000000..d7a3840987 --- /dev/null +++ b/src/version3/parameters/updateIssueSecurityScheme.mts @@ -0,0 +1,6 @@ +import { UpdateIssueSecuritySchemeRequest } from '../models/index.mjs'; + +export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { + /** The ID of the issue security scheme. */ + id: string; +} diff --git a/src/version3/parameters/updateIssueSecurityScheme.ts b/src/version3/parameters/updateIssueSecurityScheme.ts deleted file mode 100644 index a8487768b9..0000000000 --- a/src/version3/parameters/updateIssueSecurityScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateIssueSecuritySchemeRequest } from '../models'; - -export interface UpdateIssueSecurityScheme extends UpdateIssueSecuritySchemeRequest { - /** The ID of the issue security scheme. */ - id: string; -} diff --git a/src/version3/parameters/updateIssueType.mts b/src/version3/parameters/updateIssueType.mts new file mode 100644 index 0000000000..9346646057 --- /dev/null +++ b/src/version3/parameters/updateIssueType.mts @@ -0,0 +1,6 @@ +import { IssueTypeUpdate } from '../models/index.mjs'; + +export interface UpdateIssueType extends IssueTypeUpdate { + /** The ID of the issue type. */ + id: string; +} diff --git a/src/version3/parameters/updateIssueType.ts b/src/version3/parameters/updateIssueType.ts deleted file mode 100644 index 36c90e58da..0000000000 --- a/src/version3/parameters/updateIssueType.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeUpdate } from '../models'; - -export interface UpdateIssueType extends IssueTypeUpdate { - /** The ID of the issue type. */ - id: string; -} diff --git a/src/version3/parameters/updateIssueTypeScheme.mts b/src/version3/parameters/updateIssueTypeScheme.mts new file mode 100644 index 0000000000..c968a35bdf --- /dev/null +++ b/src/version3/parameters/updateIssueTypeScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: number; +} diff --git a/src/version3/parameters/updateIssueTypeScheme.ts b/src/version3/parameters/updateIssueTypeScheme.ts deleted file mode 100644 index b8113455b8..0000000000 --- a/src/version3/parameters/updateIssueTypeScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeSchemeUpdateDetails } from '../models'; - -export interface UpdateIssueTypeScheme extends IssueTypeSchemeUpdateDetails { - /** The ID of the issue type scheme. */ - issueTypeSchemeId: number; -} diff --git a/src/version3/parameters/updateIssueTypeScreenScheme.mts b/src/version3/parameters/updateIssueTypeScreenScheme.mts new file mode 100644 index 0000000000..c13563a8ad --- /dev/null +++ b/src/version3/parameters/updateIssueTypeScreenScheme.mts @@ -0,0 +1,6 @@ +import { IssueTypeScreenSchemeUpdateDetails } from '../models/index.mjs'; + +export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; +} diff --git a/src/version3/parameters/updateIssueTypeScreenScheme.ts b/src/version3/parameters/updateIssueTypeScreenScheme.ts deleted file mode 100644 index 80d59930ee..0000000000 --- a/src/version3/parameters/updateIssueTypeScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { IssueTypeScreenSchemeUpdateDetails } from '../models'; - -export interface UpdateIssueTypeScreenScheme extends IssueTypeScreenSchemeUpdateDetails { - /** The ID of the issue type screen scheme. */ - issueTypeScreenSchemeId: string; -} diff --git a/src/version3/parameters/updateMultipleCustomFieldValues.mts b/src/version3/parameters/updateMultipleCustomFieldValues.mts new file mode 100644 index 0000000000..cc7672a3d4 --- /dev/null +++ b/src/version3/parameters/updateMultipleCustomFieldValues.mts @@ -0,0 +1,6 @@ +import { MultipleCustomFieldValuesUpdateDetails } from '../models/index.mjs'; + +export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { + /** Whether to generate a changelog for this update. */ + generateChangelog?: boolean; +} diff --git a/src/version3/parameters/updateMultipleCustomFieldValues.ts b/src/version3/parameters/updateMultipleCustomFieldValues.ts deleted file mode 100644 index 7bbb86abda..0000000000 --- a/src/version3/parameters/updateMultipleCustomFieldValues.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { MultipleCustomFieldValuesUpdateDetails } from '../models'; - -export interface UpdateMultipleCustomFieldValues extends MultipleCustomFieldValuesUpdateDetails { - /** Whether to generate a changelog for this update. */ - generateChangelog?: boolean; -} diff --git a/src/version3/parameters/updateNotificationScheme.mts b/src/version3/parameters/updateNotificationScheme.mts new file mode 100644 index 0000000000..5374c83b01 --- /dev/null +++ b/src/version3/parameters/updateNotificationScheme.mts @@ -0,0 +1,6 @@ +import { UpdateNotificationSchemeDetails } from '../models/index.mjs'; + +export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { + /** The ID of the notification scheme. */ + id: string; +} diff --git a/src/version3/parameters/updateNotificationScheme.ts b/src/version3/parameters/updateNotificationScheme.ts deleted file mode 100644 index 683066156a..0000000000 --- a/src/version3/parameters/updateNotificationScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateNotificationSchemeDetails } from '../models'; - -export interface UpdateNotificationScheme extends UpdateNotificationSchemeDetails { - /** The ID of the notification scheme. */ - id: string; -} diff --git a/src/version3/parameters/updatePermissionScheme.mts b/src/version3/parameters/updatePermissionScheme.mts new file mode 100644 index 0000000000..0cd431f69c --- /dev/null +++ b/src/version3/parameters/updatePermissionScheme.mts @@ -0,0 +1,16 @@ +import { PermissionScheme } from '../models/index.mjs'; + +export interface UpdatePermissionScheme extends PermissionScheme { + /** The ID of the permission scheme to update. */ + schemeId: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note + * that permissions are always included when you specify any value. Expand options include: + * + * `all` Returns all expandable information. `field` Returns information about the custom field granted the + * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all + * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the + * permission. `user` Returns information about the user who is granted the permission. + */ + expand?: string; +} diff --git a/src/version3/parameters/updatePermissionScheme.ts b/src/version3/parameters/updatePermissionScheme.ts deleted file mode 100644 index 18d840a77d..0000000000 --- a/src/version3/parameters/updatePermissionScheme.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { PermissionScheme } from '../models'; - -export interface UpdatePermissionScheme extends PermissionScheme { - /** The ID of the permission scheme to update. */ - schemeId: number; - /** - * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note - * that permissions are always included when you specify any value. Expand options include: - * - * `all` Returns all expandable information. `field` Returns information about the custom field granted the - * permission. `group` Returns information about the group that is granted the permission. `permissions` Returns all - * permission grants for each permission scheme. `projectRole` Returns information about the project role granted the - * permission. `user` Returns information about the user who is granted the permission. - */ - expand?: string; -} diff --git a/src/version3/parameters/updatePrecomputations.mts b/src/version3/parameters/updatePrecomputations.mts new file mode 100644 index 0000000000..6b7b3a1d47 --- /dev/null +++ b/src/version3/parameters/updatePrecomputations.mts @@ -0,0 +1,3 @@ +import { JqlFunctionPrecomputationUpdateRequest } from '../models/index.mjs'; + +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version3/parameters/updatePrecomputations.ts b/src/version3/parameters/updatePrecomputations.ts deleted file mode 100644 index ecf83b9aaf..0000000000 --- a/src/version3/parameters/updatePrecomputations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JqlFunctionPrecomputationUpdateRequest } from '../models'; - -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} diff --git a/src/version3/parameters/updatePriority.mts b/src/version3/parameters/updatePriority.mts new file mode 100644 index 0000000000..bb6d71864d --- /dev/null +++ b/src/version3/parameters/updatePriority.mts @@ -0,0 +1,6 @@ +import { UpdatePriorityDetails } from '../models/index.mjs'; + +export interface UpdatePriority extends UpdatePriorityDetails { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version3/parameters/updatePriority.ts b/src/version3/parameters/updatePriority.ts deleted file mode 100644 index 40ea2baab0..0000000000 --- a/src/version3/parameters/updatePriority.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdatePriorityDetails } from '../models'; - -export interface UpdatePriority extends UpdatePriorityDetails { - /** The ID of the issue priority. */ - id: string; -} diff --git a/src/version3/parameters/updateProject.mts b/src/version3/parameters/updateProject.mts new file mode 100644 index 0000000000..b6c43c7a96 --- /dev/null +++ b/src/version3/parameters/updateProject.mts @@ -0,0 +1,26 @@ +import { UpdateProjectDetails } from '../models/index.mjs'; + +export interface UpdateProject extends UpdateProjectDetails { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; + projectTypeKey?: string; + projectTemplateKey?: 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. Note that the project description, + * issue types, and project lead are included in all responses by default. Expand options include: + * + * - `description` The project description. + * - `issueTypes` The issue types associated with the project. + * - `lead` The project lead. + * - `projectKeys` All project keys associated with the project. + */ + expand?: + | 'description' + | 'issueTypes' + | 'lead' + | 'projectKeys' + | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] + | string + | string[]; +} diff --git a/src/version3/parameters/updateProject.ts b/src/version3/parameters/updateProject.ts deleted file mode 100644 index e37370bf45..0000000000 --- a/src/version3/parameters/updateProject.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { UpdateProjectDetails } from '../models'; - -export interface UpdateProject extends UpdateProjectDetails { - /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; - projectTypeKey?: string; - projectTemplateKey?: 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. Note that the project description, - * issue types, and project lead are included in all responses by default. Expand options include: - * - * - `description` The project description. - * - `issueTypes` The issue types associated with the project. - * - `lead` The project lead. - * - `projectKeys` All project keys associated with the project. - */ - expand?: - | 'description' - | 'issueTypes' - | 'lead' - | 'projectKeys' - | ('description' | 'issueTypes' | 'lead' | 'projectKeys')[] - | string - | string[]; -} diff --git a/src/version3/parameters/updateProjectAvatar.mts b/src/version3/parameters/updateProjectAvatar.mts new file mode 100644 index 0000000000..5759946c9e --- /dev/null +++ b/src/version3/parameters/updateProjectAvatar.mts @@ -0,0 +1,6 @@ +import { Avatar } from '../models/index.mjs'; + +export interface UpdateProjectAvatar extends Avatar { + /** The ID or (case-sensitive) key of the project. */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/updateProjectAvatar.ts b/src/version3/parameters/updateProjectAvatar.ts deleted file mode 100644 index d31b4ca4b6..0000000000 --- a/src/version3/parameters/updateProjectAvatar.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Avatar } from '../models'; - -export interface UpdateProjectAvatar extends Avatar { - /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; -} diff --git a/src/version3/parameters/updateProjectCategory.mts b/src/version3/parameters/updateProjectCategory.mts new file mode 100644 index 0000000000..5518f22fd3 --- /dev/null +++ b/src/version3/parameters/updateProjectCategory.mts @@ -0,0 +1,5 @@ +import { ProjectCategory } from '../models/index.mjs'; + +export interface UpdateProjectCategory extends Omit { + id: number; +} diff --git a/src/version3/parameters/updateProjectCategory.ts b/src/version3/parameters/updateProjectCategory.ts deleted file mode 100644 index 46ab828509..0000000000 --- a/src/version3/parameters/updateProjectCategory.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ProjectCategory } from '../models'; - -export interface UpdateProjectCategory extends Omit { - id: number; -} diff --git a/src/version3/parameters/updateProjectEmail.mts b/src/version3/parameters/updateProjectEmail.mts new file mode 100644 index 0000000000..fcf15aabbf --- /dev/null +++ b/src/version3/parameters/updateProjectEmail.mts @@ -0,0 +1,6 @@ +import { ProjectEmailAddress } from '../models/index.mjs'; + +export interface UpdateProjectEmail extends ProjectEmailAddress { + /** The project ID. */ + projectId: number; +} diff --git a/src/version3/parameters/updateProjectEmail.ts b/src/version3/parameters/updateProjectEmail.ts deleted file mode 100644 index c3bf7237a2..0000000000 --- a/src/version3/parameters/updateProjectEmail.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { ProjectEmailAddress } from '../models'; - -export interface UpdateProjectEmail extends ProjectEmailAddress { - /** The project ID. */ - projectId: number; -} diff --git a/src/version3/parameters/updateRemoteIssueLink.mts b/src/version3/parameters/updateRemoteIssueLink.mts new file mode 100644 index 0000000000..5d0702075a --- /dev/null +++ b/src/version3/parameters/updateRemoteIssueLink.mts @@ -0,0 +1,8 @@ +import { RemoteIssueLinkRequest } from '../models/index.mjs'; + +export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** The ID of the remote issue link. */ + linkId: string; +} diff --git a/src/version3/parameters/updateRemoteIssueLink.ts b/src/version3/parameters/updateRemoteIssueLink.ts deleted file mode 100644 index 4faccd1a03..0000000000 --- a/src/version3/parameters/updateRemoteIssueLink.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { RemoteIssueLinkRequest } from '../models'; - -export interface UpdateRemoteIssueLink extends RemoteIssueLinkRequest { - /** The ID or key of the issue. */ - issueIdOrKey: string; - /** The ID of the remote issue link. */ - linkId: string; -} diff --git a/src/version3/parameters/updateResolution.mts b/src/version3/parameters/updateResolution.mts new file mode 100644 index 0000000000..0bbc9d1cd1 --- /dev/null +++ b/src/version3/parameters/updateResolution.mts @@ -0,0 +1,6 @@ +import { UpdateResolutionDetails } from '../models/index.mjs'; + +export interface UpdateResolution extends UpdateResolutionDetails { + /** The ID of the issue resolution. */ + id: string; +} diff --git a/src/version3/parameters/updateResolution.ts b/src/version3/parameters/updateResolution.ts deleted file mode 100644 index 678c7cff19..0000000000 --- a/src/version3/parameters/updateResolution.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateResolutionDetails } from '../models'; - -export interface UpdateResolution extends UpdateResolutionDetails { - /** The ID of the issue resolution. */ - id: string; -} diff --git a/src/version3/parameters/updateScreen.mts b/src/version3/parameters/updateScreen.mts new file mode 100644 index 0000000000..70c1100c06 --- /dev/null +++ b/src/version3/parameters/updateScreen.mts @@ -0,0 +1,6 @@ +import { UpdateScreenDetails } from '../models/index.mjs'; + +export interface UpdateScreen extends UpdateScreenDetails { + /** The ID of the screen. */ + screenId: number; +} diff --git a/src/version3/parameters/updateScreen.ts b/src/version3/parameters/updateScreen.ts deleted file mode 100644 index 64dd0d6e10..0000000000 --- a/src/version3/parameters/updateScreen.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateScreenDetails } from '../models'; - -export interface UpdateScreen extends UpdateScreenDetails { - /** The ID of the screen. */ - screenId: number; -} diff --git a/src/version3/parameters/updateScreenScheme.mts b/src/version3/parameters/updateScreenScheme.mts new file mode 100644 index 0000000000..023292e8a3 --- /dev/null +++ b/src/version3/parameters/updateScreenScheme.mts @@ -0,0 +1,6 @@ +import { UpdateScreenSchemeDetails } from '../models/index.mjs'; + +export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { + /** The ID of the screen scheme. */ + screenSchemeId: string; +} diff --git a/src/version3/parameters/updateScreenScheme.ts b/src/version3/parameters/updateScreenScheme.ts deleted file mode 100644 index e3048bd29a..0000000000 --- a/src/version3/parameters/updateScreenScheme.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateScreenSchemeDetails } from '../models'; - -export interface UpdateScreenScheme extends UpdateScreenSchemeDetails { - /** The ID of the screen scheme. */ - screenSchemeId: string; -} diff --git a/src/version3/parameters/updateSecurityLevel.mts b/src/version3/parameters/updateSecurityLevel.mts new file mode 100644 index 0000000000..f7764e51c2 --- /dev/null +++ b/src/version3/parameters/updateSecurityLevel.mts @@ -0,0 +1,8 @@ +import { UpdateIssueSecurityLevelDetails } from '../models/index.mjs'; + +export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { + /** The ID of the issue security scheme level belongs to. */ + schemeId: string; + /** The ID of the issue security level to update. */ + levelId: string; +} diff --git a/src/version3/parameters/updateSecurityLevel.ts b/src/version3/parameters/updateSecurityLevel.ts deleted file mode 100644 index 0ae179629d..0000000000 --- a/src/version3/parameters/updateSecurityLevel.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { UpdateIssueSecurityLevelDetails } from '../models'; - -export interface UpdateSecurityLevel extends UpdateIssueSecurityLevelDetails { - /** The ID of the issue security scheme level belongs to. */ - schemeId: string; - /** The ID of the issue security level to update. */ - levelId: string; -} diff --git a/src/version3/parameters/updateStatuses.mts b/src/version3/parameters/updateStatuses.mts new file mode 100644 index 0000000000..7e701dc090 --- /dev/null +++ b/src/version3/parameters/updateStatuses.mts @@ -0,0 +1,3 @@ +import { StatusUpdateRequest } from '../models/index.mjs'; + +export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version3/parameters/updateStatuses.ts b/src/version3/parameters/updateStatuses.ts deleted file mode 100644 index ed7e1b8f9a..0000000000 --- a/src/version3/parameters/updateStatuses.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { StatusUpdateRequest } from '../models'; - -export interface UpdateStatuses extends StatusUpdateRequest {} diff --git a/src/version3/parameters/updateUiModification.mts b/src/version3/parameters/updateUiModification.mts new file mode 100644 index 0000000000..c8610f2855 --- /dev/null +++ b/src/version3/parameters/updateUiModification.mts @@ -0,0 +1,6 @@ +import { UpdateUiModificationDetails } from '../models/index.mjs'; + +export interface UpdateUiModification extends UpdateUiModificationDetails { + /** The ID of the UI modification. */ + uiModificationId: string; +} diff --git a/src/version3/parameters/updateUiModification.ts b/src/version3/parameters/updateUiModification.ts deleted file mode 100644 index 29ccd69c3b..0000000000 --- a/src/version3/parameters/updateUiModification.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { UpdateUiModificationDetails } from '../models'; - -export interface UpdateUiModification extends UpdateUiModificationDetails { - /** The ID of the UI modification. */ - uiModificationId: string; -} diff --git a/src/version3/parameters/updateVersion.mts b/src/version3/parameters/updateVersion.mts new file mode 100644 index 0000000000..738c6cd15a --- /dev/null +++ b/src/version3/parameters/updateVersion.mts @@ -0,0 +1,6 @@ +import { Version } from '../models/index.mjs'; + +export interface UpdateVersion extends Version { + /** The ID of the version. */ + id: string; +} diff --git a/src/version3/parameters/updateVersion.ts b/src/version3/parameters/updateVersion.ts deleted file mode 100644 index b455a17fb7..0000000000 --- a/src/version3/parameters/updateVersion.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Version } from '../models'; - -export interface UpdateVersion extends Version { - /** The ID of the version. */ - id: string; -} diff --git a/src/version3/parameters/updateWorkflowMapping.mts b/src/version3/parameters/updateWorkflowMapping.mts new file mode 100644 index 0000000000..ba35e58e46 --- /dev/null +++ b/src/version3/parameters/updateWorkflowMapping.mts @@ -0,0 +1,8 @@ +import type { IssueTypesWorkflowMapping } from '../models/index.mjs'; + +export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { + /** The ID of the workflow scheme. */ + id: number; + /** The name of the workflow. */ + workflowName: string; +} diff --git a/src/version3/parameters/updateWorkflowMapping.ts b/src/version3/parameters/updateWorkflowMapping.ts deleted file mode 100644 index d8a0642fb1..0000000000 --- a/src/version3/parameters/updateWorkflowMapping.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IssueTypesWorkflowMapping } from '../models'; - -export interface UpdateWorkflowMapping extends IssueTypesWorkflowMapping { - /** The ID of the workflow scheme. */ - id: number; - /** The name of the workflow. */ - workflowName: string; -} diff --git a/src/version3/parameters/updateWorkflowScheme.mts b/src/version3/parameters/updateWorkflowScheme.mts new file mode 100644 index 0000000000..0311bfff13 --- /dev/null +++ b/src/version3/parameters/updateWorkflowScheme.mts @@ -0,0 +1,9 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowScheme extends WorkflowScheme { + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the + * URL as `schemeId`. For example, _schemeId=10301_. + */ + id: number; +} diff --git a/src/version3/parameters/updateWorkflowScheme.ts b/src/version3/parameters/updateWorkflowScheme.ts deleted file mode 100644 index ba20697efe..0000000000 --- a/src/version3/parameters/updateWorkflowScheme.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { WorkflowScheme } from '../models'; - -export interface UpdateWorkflowScheme extends WorkflowScheme { - /** - * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the - * URL as `schemeId`. For example, _schemeId=10301_. - */ - id: number; -} diff --git a/src/version3/parameters/updateWorkflowSchemeDraft.mts b/src/version3/parameters/updateWorkflowSchemeDraft.mts new file mode 100644 index 0000000000..ba6eca7275 --- /dev/null +++ b/src/version3/parameters/updateWorkflowSchemeDraft.mts @@ -0,0 +1,6 @@ +import { WorkflowScheme } from '../models/index.mjs'; + +export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { + /** The ID of the active workflow scheme that the draft was created from. */ + id: number; +} diff --git a/src/version3/parameters/updateWorkflowSchemeDraft.ts b/src/version3/parameters/updateWorkflowSchemeDraft.ts deleted file mode 100644 index 5007161471..0000000000 --- a/src/version3/parameters/updateWorkflowSchemeDraft.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { WorkflowScheme } from '../models'; - -export interface UpdateWorkflowSchemeDraft extends WorkflowScheme { - /** The ID of the active workflow scheme that the draft was created from. */ - id: number; -} diff --git a/src/version3/parameters/updateWorkflowTransitionProperty.mts b/src/version3/parameters/updateWorkflowTransitionProperty.mts new file mode 100644 index 0000000000..191f633ea2 --- /dev/null +++ b/src/version3/parameters/updateWorkflowTransitionProperty.mts @@ -0,0 +1,21 @@ +import { WorkflowTransitionProperty } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown + * next to the transition. + */ + transitionId: number; + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the + * `key` defined in the request body. + */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot + * be edited. + */ + workflowMode?: 'live' | 'draft' | string; +} diff --git a/src/version3/parameters/updateWorkflowTransitionProperty.ts b/src/version3/parameters/updateWorkflowTransitionProperty.ts deleted file mode 100644 index 0afd501a38..0000000000 --- a/src/version3/parameters/updateWorkflowTransitionProperty.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { WorkflowTransitionProperty } from '../models'; - -export interface UpdateWorkflowTransitionProperty extends WorkflowTransitionProperty { - /** - * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown - * next to the transition. - */ - transitionId: number; - /** - * The key of the property being updated, also known as the name of the property. Set this to the same value as the - * `key` defined in the request body. - */ - key: string; - /** The name of the workflow that the transition belongs to. */ - workflowName: string; - /** - * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot - * be edited. - */ - workflowMode?: 'live' | 'draft' | string; -} diff --git a/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts b/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts new file mode 100644 index 0000000000..5812750473 --- /dev/null +++ b/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.mts @@ -0,0 +1,3 @@ +import type { WorkflowTransitionRulesUpdate } from '../models/index.mjs'; + +export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts b/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts deleted file mode 100644 index 7db5f74cdd..0000000000 --- a/src/version3/parameters/updateWorkflowTransitionRuleConfigurations.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { WorkflowTransitionRulesUpdate } from '../models'; - -export interface UpdateWorkflowTransitionRuleConfigurations extends WorkflowTransitionRulesUpdate {} diff --git a/src/version3/parameters/updateWorklog.mts b/src/version3/parameters/updateWorklog.mts new file mode 100644 index 0000000000..e874d922af --- /dev/null +++ b/src/version3/parameters/updateWorklog.mts @@ -0,0 +1,41 @@ +import { Document, Worklog } from '../models/index.mjs'; + +export interface UpdateWorklog extends Omit { + /** The ID or key the issue. */ + issueIdOrKey: string; + /** The ID of the worklog. */ + id: string; + /** Whether users watching the issue are notified by email. */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `new` Sets the estimate to a specific value, defined in `newEstimate`. + * - `leave` Leaves the estimate unchanged. + * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or + * `timeSpentSeconds`. + */ + adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; + /** + * A comment about the worklog in [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or + * updating a worklog. + */ + comment?: string | Document; + /** + * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For + * example, _2d_. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue + * is closed. Connect and Forge app users with _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version3/parameters/updateWorklog.ts b/src/version3/parameters/updateWorklog.ts deleted file mode 100644 index 747e4ca0be..0000000000 --- a/src/version3/parameters/updateWorklog.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Document, Worklog } from '../models'; - -export interface UpdateWorklog extends Omit { - /** The ID or key the issue. */ - issueIdOrKey: string; - /** The ID of the worklog. */ - id: string; - /** Whether users watching the issue are notified by email. */ - notifyUsers?: boolean; - /** - * Defines how to update the issue's time estimate, the options are: - * - * - `new` Sets the estimate to a specific value, defined in `newEstimate`. - * - `leave` Leaves the estimate unchanged. - * - `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or - * `timeSpentSeconds`. - */ - adjustEstimate?: 'new' | 'leave' | 'manual' | 'auto' | string; - /** - * A comment about the worklog in [Atlassian Document - * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or - * updating a worklog. - */ - comment?: string | Document; - /** - * The value to set as the issue's remaining time estimate, as days (#d), hours (#h), or minutes (#m or #). For - * example, _2d_. Required when `adjustEstimate` is `new`. - */ - newEstimate?: string; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. - */ - expand?: string; - /** - * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue - * is closed. Connect and Forge app users with _Administer Jira_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. - */ - overrideEditableFlag?: boolean; -} diff --git a/src/version3/parameters/validateProjectKey.ts b/src/version3/parameters/validateProjectKey.mts similarity index 100% rename from src/version3/parameters/validateProjectKey.ts rename to src/version3/parameters/validateProjectKey.mts diff --git a/src/version3/parameters/workflowRuleSearch.mts b/src/version3/parameters/workflowRuleSearch.mts new file mode 100644 index 0000000000..65b1dc2746 --- /dev/null +++ b/src/version3/parameters/workflowRuleSearch.mts @@ -0,0 +1,6 @@ +import { WorkflowRulesSearch } from '../models/index.mjs'; + +export interface WorkflowRuleSearch extends WorkflowRulesSearch { + /** The app migration transfer ID. */ + transferId: string; +} diff --git a/src/version3/parameters/workflowRuleSearch.ts b/src/version3/parameters/workflowRuleSearch.ts deleted file mode 100644 index 85fbfa37db..0000000000 --- a/src/version3/parameters/workflowRuleSearch.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { WorkflowRulesSearch } from '../models'; - -export interface WorkflowRuleSearch extends WorkflowRulesSearch { - /** The app migration transfer ID. */ - transferId: string; -} diff --git a/src/version3/permissionSchemes.mts b/src/version3/permissionSchemes.mts new file mode 100644 index 0000000000..8a8bb1509a --- /dev/null +++ b/src/version3/permissionSchemes.mts @@ -0,0 +1,558 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class PermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * 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: + * + * - `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 + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters: Parameters.GetAllPermissionSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns all permission schemes. + * + * ### About permission schemes and grants + * + * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a + * `permission`. + * + * #### Holder object + * + * 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: + * + * - `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 + * `type`. For example, if the `type` is a group, then you need to specify the group name. + * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the + * group ID. For other `type` it has the same value as `parameter` + * + * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some + * types may not have a `parameter` or `value`): + * + * - `anyone` Grant for anonymous users. + * - `applicationRole` Grant for users with access to the specified application (application name, application name). + * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. + * - `assignee` Grant for the user currently assigned to an issue. + * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). + * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field + * ID, `value` : custom field ID). + * - `projectLead` Grant for a project lead. + * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). + * - `reporter` Grant for the user who reported the issue. + * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not + * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more + * information. + * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is + * deprecated and the account ID should be used, `value` : user ID). + * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : + * custom field ID). + * + * #### Built-in permissions + * + * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define + * custom permissions. See the [project + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global + * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation + * for more information. + * + * **Project permissions** + * + * - `ADMINISTER_PROJECTS` + * - `BROWSE_PROJECTS` + * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) + * - `SERVICEDESK_AGENT` (Jira Service Desk only) + * - `VIEW_DEV_TOOLS` (Jira Software only) + * - `VIEW_READONLY_WORKFLOW` + * + * **Issue permissions** + * + * - `ASSIGNABLE_USER` + * - `ASSIGN_ISSUES` + * - `CLOSE_ISSUES` + * - `CREATE_ISSUES` + * - `DELETE_ISSUES` + * - `EDIT_ISSUES` + * - `LINK_ISSUES` + * - `MODIFY_REPORTER` + * - `MOVE_ISSUES` + * - `RESOLVE_ISSUES` + * - `SCHEDULE_ISSUES` + * - `SET_ISSUE_SECURITY` + * - `TRANSITION_ISSUES` + * + * **Voters and watchers permissions** + * + * - `MANAGE_WATCHERS` + * - `VIEW_VOTERS_AND_WATCHERS` + * + * **Comments permissions** + * + * - `ADD_COMMENTS` + * - `DELETE_ALL_COMMENTS` + * - `DELETE_OWN_COMMENTS` + * - `EDIT_ALL_COMMENTS` + * - `EDIT_OWN_COMMENTS` + * + * **Attachments permissions** + * + * - `CREATE_ATTACHMENTS` + * - `DELETE_ALL_ATTACHMENTS` + * - `DELETE_OWN_ATTACHMENTS` + * + * **Time tracking permissions** + * + * - `DELETE_ALL_WORKLOGS` + * - `DELETE_OWN_WORKLOGS` + * - `EDIT_ALL_WORKLOGS` + * - `EDIT_OWN_WORKLOGS` + * - `WORK_ON_ISSUES` + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: never, + ): Promise; + async getAllPermissionSchemes( + parameters?: Parameters.GetAllPermissionSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissionscheme', + method: 'GET', + params: { + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters: Parameters.CreatePermissionScheme | undefined, + callback: Callback, + ): Promise; + /** + * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission + * grants. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: never, + ): Promise; + async createPermissionScheme( + parameters?: Parameters.CreatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissionscheme', + method: 'POST', + params: { + expand: parameters?.expand, + }, + data: { + ...parameters, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme, + callback: Callback, + ): Promise; + /** + * Returns a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme, + callback?: never, + ): Promise; + async getPermissionScheme( + parameters: Parameters.GetPermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback: Callback, + ): Promise; + /** + * Updates a permission scheme. Below are some important things to note when using this resource: + * + * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all + * existing_ grants. + * - If you want to update only the name and description, then do not send a permissions list in the request. + * - Sending an empty list will remove all permission grants from the permission scheme. + * + * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission + * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme + * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). + * + * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: never, + ): Promise; + async updatePermissionScheme( + parameters: Parameters.UpdatePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + ...parameters, + schemeId: undefined, + expand: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission 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 deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback: Callback, + ): Promise; + /** + * Deletes a permission 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 deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; + async deletePermissionScheme( + parameters: Parameters.DeletePermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback: Callback, + ): Promise; + /** + * Returns all permission grants for a permission scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: never, + ): Promise; + async getPermissionSchemeGrants( + parameters: Parameters.GetPermissionSchemeGrants, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a permission grant in a permission 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 createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback: Callback, + ): Promise; + /** + * Creates a permission grant in a permission 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 createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: never, + ): Promise; + async createPermissionGrant( + parameters: Parameters.CreatePermissionGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + self: parameters.self, + holder: parameters.holder, + permission: parameters.permission, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback: Callback, + ): Promise; + /** + * Returns a permission grant. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: never, + ): Promise; + async getPermissionSchemeGrant( + parameters: Parameters.GetPermissionSchemeGrant, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback: Callback, + ): Promise; + /** + * Deletes a permission grant from a permission scheme. See [About permission schemes and + * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: never, + ): Promise; + async deletePermissionSchemeEntity( + parameters: Parameters.DeletePermissionSchemeEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/permissionSchemes.ts b/src/version3/permissionSchemes.ts deleted file mode 100644 index 9add325b3f..0000000000 --- a/src/version3/permissionSchemes.ts +++ /dev/null @@ -1,558 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class PermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * 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: - * - * - `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 - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters: Parameters.GetAllPermissionSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns all permission schemes. - * - * ### About permission schemes and grants - * - * A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a - * `permission`. - * - * #### Holder object - * - * 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: - * - * - `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 - * `type`. For example, if the `type` is a group, then you need to specify the group name. - * - `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the - * group ID. For other `type` it has the same value as `parameter` - * - * The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some - * types may not have a `parameter` or `value`): - * - * - `anyone` Grant for anonymous users. - * - `applicationRole` Grant for users with access to the specified application (application name, application name). - * See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. - * - `assignee` Grant for the user currently assigned to an issue. - * - `group` Grant for the specified group (`parameter` : group name, `value` : group ID). - * - `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field - * ID, `value` : custom field ID). - * - `projectLead` Grant for a project lead. - * - `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). - * - `reporter` Grant for the user who reported the issue. - * - `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not - * Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more - * information. - * - `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is - * deprecated and the account ID should be used, `value` : user ID). - * - `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : - * custom field ID). - * - * #### Built-in permissions - * - * The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define - * custom permissions. See the [project - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global - * permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation - * for more information. - * - * **Project permissions** - * - * - `ADMINISTER_PROJECTS` - * - `BROWSE_PROJECTS` - * - `MANAGE_SPRINTS_PERMISSION` (Jira Software only) - * - `SERVICEDESK_AGENT` (Jira Service Desk only) - * - `VIEW_DEV_TOOLS` (Jira Software only) - * - `VIEW_READONLY_WORKFLOW` - * - * **Issue permissions** - * - * - `ASSIGNABLE_USER` - * - `ASSIGN_ISSUES` - * - `CLOSE_ISSUES` - * - `CREATE_ISSUES` - * - `DELETE_ISSUES` - * - `EDIT_ISSUES` - * - `LINK_ISSUES` - * - `MODIFY_REPORTER` - * - `MOVE_ISSUES` - * - `RESOLVE_ISSUES` - * - `SCHEDULE_ISSUES` - * - `SET_ISSUE_SECURITY` - * - `TRANSITION_ISSUES` - * - * **Voters and watchers permissions** - * - * - `MANAGE_WATCHERS` - * - `VIEW_VOTERS_AND_WATCHERS` - * - * **Comments permissions** - * - * - `ADD_COMMENTS` - * - `DELETE_ALL_COMMENTS` - * - `DELETE_OWN_COMMENTS` - * - `EDIT_ALL_COMMENTS` - * - `EDIT_OWN_COMMENTS` - * - * **Attachments permissions** - * - * - `CREATE_ATTACHMENTS` - * - `DELETE_ALL_ATTACHMENTS` - * - `DELETE_OWN_ATTACHMENTS` - * - * **Time tracking permissions** - * - * - `DELETE_ALL_WORKLOGS` - * - `DELETE_OWN_WORKLOGS` - * - `EDIT_ALL_WORKLOGS` - * - `EDIT_OWN_WORKLOGS` - * - `WORK_ON_ISSUES` - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: never, - ): Promise; - async getAllPermissionSchemes( - parameters?: Parameters.GetAllPermissionSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissionscheme', - method: 'GET', - params: { - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters: Parameters.CreatePermissionScheme | undefined, - callback: Callback, - ): Promise; - /** - * Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission - * grants. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: never, - ): Promise; - async createPermissionScheme( - parameters?: Parameters.CreatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissionscheme', - method: 'POST', - params: { - expand: parameters?.expand, - }, - data: { - ...parameters, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, - callback: Callback, - ): Promise; - /** - * Returns a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, - callback?: never, - ): Promise; - async getPermissionScheme( - parameters: Parameters.GetPermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback: Callback, - ): Promise; - /** - * Updates a permission scheme. Below are some important things to note when using this resource: - * - * - If a permissions list is present in the request, then it is set in the permission scheme, overwriting _all - * existing_ grants. - * - If you want to update only the name and description, then do not send a permissions list in the request. - * - Sending an empty list will remove all permission grants from the permission scheme. - * - * If you want to add or delete a permission grant instead of updating the whole list, see [Create permission - * grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme - * entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). - * - * See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: never, - ): Promise; - async updatePermissionScheme( - parameters: Parameters.UpdatePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - ...parameters, - schemeId: undefined, - expand: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission 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 deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback: Callback, - ): Promise; - /** - * Deletes a permission 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 deletePermissionScheme(parameters: Parameters.DeletePermissionScheme, callback?: never): Promise; - async deletePermissionScheme( - parameters: Parameters.DeletePermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback: Callback, - ): Promise; - /** - * Returns all permission grants for a permission scheme. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: never, - ): Promise; - async getPermissionSchemeGrants( - parameters: Parameters.GetPermissionSchemeGrants, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a permission grant in a permission 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 createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback: Callback, - ): Promise; - /** - * Creates a permission grant in a permission 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 createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: never, - ): Promise; - async createPermissionGrant( - parameters: Parameters.CreatePermissionGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission`, - method: 'POST', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - self: parameters.self, - holder: parameters.holder, - permission: parameters.permission, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback: Callback, - ): Promise; - /** - * Returns a permission grant. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: never, - ): Promise; - async getPermissionSchemeGrant( - parameters: Parameters.GetPermissionSchemeGrant, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'GET', - params: { - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback: Callback, - ): Promise; - /** - * Deletes a permission grant from a permission scheme. See [About permission schemes and - * grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) 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 deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: never, - ): Promise; - async deletePermissionSchemeEntity( - parameters: Parameters.DeletePermissionSchemeEntity, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/permissionscheme/${parameters.schemeId}/permission/${parameters.permissionId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/permissions.mts b/src/version3/permissions.mts new file mode 100644 index 0000000000..7d99d41d0c --- /dev/null +++ b/src/version3/permissions.mts @@ -0,0 +1,236 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Permissions { + constructor(private client: Client) {} + + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * 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. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters: Parameters.GetMyPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be + * obtained in a global, project, issue or comment context. + * + * The user is reported as having a project permission: + * + * - In the global context, if the user has the project permission in any project. + * - For a project, where the project permission is determined using issue data, if the user meets the permission's + * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. + * - For an issue, where a project permission is determined using issue data, if the user has the permission in the + * issue. Otherwise, if the user has the project permission in the project containing the issue. + * - For a comment, where the user has both the permission to browse the comment and the project permission for the + * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose + * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. + * + * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a + * project context but may not have the permission for any or all issues. For example, if Reporters have the + * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a + * 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. + * + * Global permissions are unaffected by context. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: never, + ): Promise; + async getMyPermissions( + parameters?: Parameters.GetMyPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/mypermissions', + method: 'GET', + params: { + projectKey: parameters?.projectKey, + projectId: parameters?.projectId, + issueKey: parameters?.issueKey, + issueId: parameters?.issueId, + permissions: parameters?.permissions, + projectUuid: parameters?.projectUuid, + projectConfigurationUuid: parameters?.projectConfigurationUuid, + commentId: parameters?.commentId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all permissions, including: + * + * - Global 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). + */ + async getAllPermissions(callback: Callback): Promise; + /** + * Returns all permissions, including: + * + * - Global 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). + */ + async getAllPermissions(callback?: never): Promise; + async getAllPermissions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissions', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters: Parameters.GetBulkPermissions | undefined, + callback: Callback, + ): Promise; + /** + * Returns: + * + * - For a list of global permissions, the global permissions granted to a user. + * - For a list of project permissions and lists of projects and issues, for each project permission a list of the + * projects and issues a user can access or manipulate. + * + * If no account ID is provided, the operation returns details for the logged in user. + * + * Note that: + * + * - Invalid project and issue IDs are ignored. + * - A maximum of 1000 projects and 1000 issues can be checked. + * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and + * `projectPermissions.issues` are ignored. + * - Empty strings in `projectPermissions.permissions` are ignored. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other + * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain + * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made + * using AP.request() in a browser. + */ + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: never, + ): Promise; + async getBulkPermissions( + parameters?: Parameters.GetBulkPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissions/check', + method: 'POST', + data: { + projectPermissions: parameters?.projectPermissions, + globalPermissions: parameters?.globalPermissions, + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters: Parameters.GetPermittedProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns all the projects where the user is granted a list of project permissions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: never, + ): Promise; + async getPermittedProjects( + parameters?: Parameters.GetPermittedProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/permissions/project', + method: 'POST', + data: { + permissions: parameters?.permissions, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/permissions.ts b/src/version3/permissions.ts deleted file mode 100644 index 6936121d24..0000000000 --- a/src/version3/permissions.ts +++ /dev/null @@ -1,236 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Permissions { - constructor(private client: Client) {} - - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * 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. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters: Parameters.GetMyPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be - * obtained in a global, project, issue or comment context. - * - * The user is reported as having a project permission: - * - * - In the global context, if the user has the project permission in any project. - * - For a project, where the project permission is determined using issue data, if the user meets the permission's - * criteria for any issue in the project. Otherwise, if the user has the project permission in the project. - * - For an issue, where a project permission is determined using issue data, if the user has the permission in the - * issue. Otherwise, if the user has the project permission in the project containing the issue. - * - For a comment, where the user has both the permission to browse the comment and the project permission for the - * comment's parent issue. Only the BROWSE_PROJECTS permission is supported. If a `commentId` is provided whose - * `permissions` does not equal BROWSE_PROJECTS, a 400 error will be returned. - * - * This means that users may be shown as having an issue permission (such as EDIT_ISSUES) in the global context or a - * project context but may not have the permission for any or all issues. For example, if Reporters have the - * EDIT_ISSUES permission a user would be shown as having this permission in the global context or the context of a - * 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. - * - * Global permissions are unaffected by context. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: never, - ): Promise; - async getMyPermissions( - parameters?: Parameters.GetMyPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/mypermissions', - method: 'GET', - params: { - projectKey: parameters?.projectKey, - projectId: parameters?.projectId, - issueKey: parameters?.issueKey, - issueId: parameters?.issueId, - permissions: parameters?.permissions, - projectUuid: parameters?.projectUuid, - projectConfigurationUuid: parameters?.projectConfigurationUuid, - commentId: parameters?.commentId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all permissions, including: - * - * - Global 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). - */ - async getAllPermissions(callback: Callback): Promise; - /** - * Returns all permissions, including: - * - * - Global 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). - */ - async getAllPermissions(callback?: never): Promise; - async getAllPermissions(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissions', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters: Parameters.GetBulkPermissions | undefined, - callback: Callback, - ): Promise; - /** - * Returns: - * - * - For a list of global permissions, the global permissions granted to a user. - * - For a list of project permissions and lists of projects and issues, for each project permission a list of the - * projects and issues a user can access or manipulate. - * - * If no account ID is provided, the operation returns details for the logged in user. - * - * Note that: - * - * - Invalid project and issue IDs are ignored. - * - A maximum of 1000 projects and 1000 issues can be checked. - * - Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and - * `projectPermissions.issues` are ignored. - * - Empty strings in `projectPermissions.permissions` are ignored. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other - * users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain - * permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made - * using AP.request() in a browser. - */ - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: never, - ): Promise; - async getBulkPermissions( - parameters?: Parameters.GetBulkPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissions/check', - method: 'POST', - data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters: Parameters.GetPermittedProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns all the projects where the user is granted a list of project permissions. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: never, - ): Promise; - async getPermittedProjects( - parameters?: Parameters.GetPermittedProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/permissions/project', - method: 'POST', - data: { - permissions: parameters?.permissions, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectAvatars.mts b/src/version3/projectAvatars.mts new file mode 100644 index 0000000000..d7d7ba6fd5 --- /dev/null +++ b/src/version3/projectAvatars.mts @@ -0,0 +1,202 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectAvatars { + constructor(private client: Client) {} + + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the 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). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; + /** + * Sets the avatar displayed for a project. + * + * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the + * project, before using this operation to set the 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). + */ + async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; + async updateProjectAvatar( + parameters: Parameters.UpdateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar`, + method: 'PUT', + data: { + fileName: parameters.fileName, + id: parameters.id, + isDeletable: parameters.isDeletable, + isSelected: parameters.isSelected, + isSystemAvatar: parameters.isSystemAvatar, + owner: parameters.owner, + urls: parameters.urls, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; + /** + * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; + async deleteProjectAvatar( + parameters: Parameters.DeleteProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback: Callback, + ): Promise; + /** + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: never, + ): Promise; + async createProjectAvatar( + parameters: Parameters.CreateProjectAvatar, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar2`, + method: 'POST', + params: { + x: parameters.x, + y: parameters.y, + size: parameters.size, + }, + data: parameters.avatar, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * 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 getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars, + callback: Callback, + ): Promise; + /** + * Returns all project avatars, grouped by system and custom avatars. + * + * 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 getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars, + callback?: never, + ): Promise; + async getAllProjectAvatars( + parameters: Parameters.GetAllProjectAvatars, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatars`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectAvatars.ts b/src/version3/projectAvatars.ts deleted file mode 100644 index f343761268..0000000000 --- a/src/version3/projectAvatars.ts +++ /dev/null @@ -1,202 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectAvatars { - constructor(private client: Client) {} - - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the 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). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback: Callback): Promise; - /** - * Sets the avatar displayed for a project. - * - * Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the - * project, before using this operation to set the 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). - */ - async updateProjectAvatar(parameters: Parameters.UpdateProjectAvatar, callback?: never): Promise; - async updateProjectAvatar( - parameters: Parameters.UpdateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar`, - method: 'PUT', - data: { - fileName: parameters.fileName, - id: parameters.id, - isDeletable: parameters.isDeletable, - isSelected: parameters.isSelected, - isSystemAvatar: parameters.isSystemAvatar, - owner: parameters.owner, - urls: parameters.urls, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback: Callback): Promise; - /** - * Deletes a custom avatar from a project. Note that system avatars cannot be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async deleteProjectAvatar(parameters: Parameters.DeleteProjectAvatar, callback?: never): Promise; - async deleteProjectAvatar( - parameters: Parameters.DeleteProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback: Callback, - ): Promise; - /** - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: never, - ): Promise; - async createProjectAvatar( - parameters: Parameters.CreateProjectAvatar, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar2`, - method: 'POST', - params: { - x: parameters.x, - y: parameters.y, - size: parameters.size, - }, - data: parameters.avatar, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * 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 getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars, - callback: Callback, - ): Promise; - /** - * Returns all project avatars, grouped by system and custom avatars. - * - * 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 getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars, - callback?: never, - ): Promise; - async getAllProjectAvatars( - parameters: Parameters.GetAllProjectAvatars, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatars`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectCategories.mts b/src/version3/projectCategories.mts new file mode 100644 index 0000000000..6d795ebdaa --- /dev/null +++ b/src/version3/projectCategories.mts @@ -0,0 +1,167 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectCategories { + constructor(private client: Client) {} + + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback: Callback): Promise; + /** + * Returns all project categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAllProjectCategories(callback?: never): Promise; + async getAllProjectCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/projectCategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback: Callback, + ): Promise; + /** + * Creates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: never, + ): Promise; + async createProjectCategory( + parameters: Parameters.CreateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/projectCategory', + method: 'POST', + data: { + description: parameters.description, + id: parameters.id, + name: parameters.name, + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById, + callback: Callback, + ): Promise; + /** + * Returns a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById, + callback?: never, + ): Promise; + async getProjectCategoryById( + parameters: Parameters.GetProjectCategoryById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/projectCategory/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback: Callback, + ): Promise; + /** + * Updates a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: never, + ): Promise; + async updateProjectCategory( + parameters: Parameters.UpdateProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/projectCategory/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory, + callback: Callback, + ): Promise; + /** + * Deletes a project category. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeProjectCategory(parameters: Parameters.RemoveProjectCategory, callback?: never): Promise; + async removeProjectCategory( + parameters: Parameters.RemoveProjectCategory, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/projectCategory/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectCategories.ts b/src/version3/projectCategories.ts deleted file mode 100644 index 8e5ff3c321..0000000000 --- a/src/version3/projectCategories.ts +++ /dev/null @@ -1,167 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectCategories { - constructor(private client: Client) {} - - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback: Callback): Promise; - /** - * Returns all project categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAllProjectCategories(callback?: never): Promise; - async getAllProjectCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/projectCategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback: Callback, - ): Promise; - /** - * Creates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: never, - ): Promise; - async createProjectCategory( - parameters: Parameters.CreateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/projectCategory', - method: 'POST', - data: { - description: parameters.description, - id: parameters.id, - name: parameters.name, - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById, - callback: Callback, - ): Promise; - /** - * Returns a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById, - callback?: never, - ): Promise; - async getProjectCategoryById( - parameters: Parameters.GetProjectCategoryById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/projectCategory/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback: Callback, - ): Promise; - /** - * Updates a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: never, - ): Promise; - async updateProjectCategory( - parameters: Parameters.UpdateProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/projectCategory/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory, - callback: Callback, - ): Promise; - /** - * Deletes a project category. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeProjectCategory(parameters: Parameters.RemoveProjectCategory, callback?: never): Promise; - async removeProjectCategory( - parameters: Parameters.RemoveProjectCategory, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/projectCategory/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectComponents.mts b/src/version3/projectComponents.mts new file mode 100644 index 0000000000..3f45594a7b --- /dev/null +++ b/src/version3/projectComponents.mts @@ -0,0 +1,296 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectComponents { + constructor(private client: Client) {} + + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[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 in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback: Callback, + ): Promise; + /** + * Creates a component. Use components to provide containers for issues within a project. + * + * This operation can be accessed anonymously. + * + * **[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 in which the + * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createComponent( + parameters: Parameters.CreateComponent, + callback?: never, + ): Promise; + async createComponent( + parameters: Parameters.CreateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a component. + * + * 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 project containing the component. + */ + async getComponent( + parameters: Parameters.GetComponent, + callback: Callback, + ): Promise; + /** + * Returns a component. + * + * 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 project containing the component. + */ + async getComponent(parameters: Parameters.GetComponent, callback?: never): Promise; + async getComponent( + parameters: Parameters.GetComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback: Callback, + ): Promise; + /** + * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") + * the component lead is removed. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: never, + ): Promise; + async updateComponent( + parameters: Parameters.UpdateComponent, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + leadUserName: parameters.leadUserName, + leadAccountId: parameters.leadAccountId, + assigneeType: parameters.assigneeType, + project: parameters.project, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent(parameters: Parameters.DeleteComponent, callback: Callback): Promise; + /** + * Deletes a component. + * + * This operation can be accessed anonymously. + * + * **[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 containing + * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteComponent(parameters: Parameters.DeleteComponent, callback?: never): Promise; + async deleteComponent(parameters: Parameters.DeleteComponent, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}`, + method: 'DELETE', + params: { + moveIssuesTo: parameters.moveIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues, + callback: Callback, + ): Promise; + /** + * Returns the counts of issues assigned to the component. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues, + callback?: never, + ): Promise; + async getComponentRelatedIssues( + parameters: Parameters.GetComponentRelatedIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/component/${parameters.id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * 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. + * + * 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 getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * 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. + * + * 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 getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: never, + ): Promise; + async getProjectComponentsPaginated( + parameters: Parameters.GetProjectComponentsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/component`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * 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 getProjectComponents( + parameters: Parameters.GetProjectComponents, + callback: Callback, + ): Promise; + /** + * Returns all components in a project. See the [Get project components + * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of + * components with pagination. + * + * 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 getProjectComponents( + parameters: Parameters.GetProjectComponents, + callback?: never, + ): Promise; + async getProjectComponents( + parameters: Parameters.GetProjectComponents, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/components`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectComponents.ts b/src/version3/projectComponents.ts deleted file mode 100644 index 2a2456c58b..0000000000 --- a/src/version3/projectComponents.ts +++ /dev/null @@ -1,296 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectComponents { - constructor(private client: Client) {} - - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[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 in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback: Callback, - ): Promise; - /** - * Creates a component. Use components to provide containers for issues within a project. - * - * This operation can be accessed anonymously. - * - * **[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 in which the - * component is created or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createComponent( - parameters: Parameters.CreateComponent, - callback?: never, - ): Promise; - async createComponent( - parameters: Parameters.CreateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a component. - * - * 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 project containing the component. - */ - async getComponent( - parameters: Parameters.GetComponent, - callback: Callback, - ): Promise; - /** - * Returns a component. - * - * 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 project containing the component. - */ - async getComponent(parameters: Parameters.GetComponent, callback?: never): Promise; - async getComponent( - parameters: Parameters.GetComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback: Callback, - ): Promise; - /** - * Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") - * the component lead is removed. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: never, - ): Promise; - async updateComponent( - parameters: Parameters.UpdateComponent, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - leadUserName: parameters.leadUserName, - leadAccountId: parameters.leadAccountId, - assigneeType: parameters.assigneeType, - project: parameters.project, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent, callback: Callback): Promise; - /** - * Deletes a component. - * - * This operation can be accessed anonymously. - * - * **[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 containing - * the component or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteComponent(parameters: Parameters.DeleteComponent, callback?: never): Promise; - async deleteComponent(parameters: Parameters.DeleteComponent, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}`, - method: 'DELETE', - params: { - moveIssuesTo: parameters.moveIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, - callback: Callback, - ): Promise; - /** - * Returns the counts of issues assigned to the component. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, - callback?: never, - ): Promise; - async getComponentRelatedIssues( - parameters: Parameters.GetComponentRelatedIssues, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/component/${parameters.id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * 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. - * - * 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 getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * 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. - * - * 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 getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: never, - ): Promise; - async getProjectComponentsPaginated( - parameters: Parameters.GetProjectComponentsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/component`, - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - orderBy: parameters.orderBy, - query: parameters.query, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * 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 getProjectComponents( - parameters: Parameters.GetProjectComponents, - callback: Callback, - ): Promise; - /** - * Returns all components in a project. See the [Get project components - * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of - * components with pagination. - * - * 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 getProjectComponents( - parameters: Parameters.GetProjectComponents, - callback?: never, - ): Promise; - async getProjectComponents( - parameters: Parameters.GetProjectComponents, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/components`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectEmail.mts b/src/version3/projectEmail.mts new file mode 100644 index 0000000000..7df0bced01 --- /dev/null +++ b/src/version3/projectEmail.mts @@ -0,0 +1,77 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectEmail { + constructor(private client: Client) {} + + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[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 getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback: Callback, + ): Promise; + /** + * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * **[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 getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: never, + ): Promise; + async getProjectEmail( + parameters: Parameters.GetProjectEmail | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectId}/email`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * 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. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; + /** + * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). + * + * 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. + */ + async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; + async updateProjectEmail( + parameters: Parameters.UpdateProjectEmail, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectId}/email`, + method: 'PUT', + data: { + emailAddress: parameters.emailAddress, + emailAddressStatus: parameters.emailAddressStatus, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectEmail.ts b/src/version3/projectEmail.ts deleted file mode 100644 index ae27bbbdea..0000000000 --- a/src/version3/projectEmail.ts +++ /dev/null @@ -1,77 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectEmail { - constructor(private client: Client) {} - - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[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 getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback: Callback, - ): Promise; - /** - * Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * **[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 getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: never, - ): Promise; - async getProjectEmail( - parameters: Parameters.GetProjectEmail | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectId}/email`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * 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. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; - /** - * Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). - * - * 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. - */ - async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; - async updateProjectEmail( - parameters: Parameters.UpdateProjectEmail, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectId}/email`, - method: 'PUT', - data: { - emailAddress: parameters.emailAddress, - emailAddressStatus: parameters.emailAddressStatus, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectFeatures.mts b/src/version3/projectFeatures.mts new file mode 100644 index 0000000000..32174e5ac9 --- /dev/null +++ b/src/version3/projectFeatures.mts @@ -0,0 +1,58 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectFeatures { + constructor(private client: Client) {} + + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback: Callback, + ): Promise; + /** Returns the list of features for a project. */ + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: never, + ): Promise; + async getFeaturesForProject( + parameters: Parameters.GetFeaturesForProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/features`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback: Callback, + ): Promise; + /** Sets the state of a project feature. */ + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: never, + ): Promise; + async toggleFeatureForProject( + parameters: Parameters.ToggleFeatureForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, + method: 'PUT', + data: { + state: parameters.state, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectFeatures.ts b/src/version3/projectFeatures.ts deleted file mode 100644 index c7c080500c..0000000000 --- a/src/version3/projectFeatures.ts +++ /dev/null @@ -1,58 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectFeatures { - constructor(private client: Client) {} - - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback: Callback, - ): Promise; - /** Returns the list of features for a project. */ - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: never, - ): Promise; - async getFeaturesForProject( - parameters: Parameters.GetFeaturesForProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/features`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback: Callback, - ): Promise; - /** Sets the state of a project feature. */ - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: never, - ): Promise; - async toggleFeatureForProject( - parameters: Parameters.ToggleFeatureForProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/features/${parameters.featureKey}`, - method: 'PUT', - data: { - state: parameters.state, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectKeyAndNameValidation.mts b/src/version3/projectKeyAndNameValidation.mts new file mode 100644 index 0000000000..b36ec0ff5e --- /dev/null +++ b/src/version3/projectKeyAndNameValidation.mts @@ -0,0 +1,118 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectKeyAndNameValidation { + constructor(private client: Client) {} + + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters: Parameters.ValidateProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key by confirming the key is a valid string and not in use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: never, + ): Promise; + async validateProjectKey( + parameters?: Parameters.ValidateProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/3/projectvalidate/key', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters: Parameters.GetValidProjectKey | string | undefined, + callback: Callback, + ): Promise; + /** + * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: never, + ): Promise; + async getValidProjectKey( + parameters?: Parameters.GetValidProjectKey | string, + callback?: Callback, + ): Promise { + const key = typeof parameters === 'string' ? parameters : parameters?.key; + + const config: RequestConfig = { + url: '/rest/api/3/projectvalidate/validProjectKey', + method: 'GET', + params: { + key, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback: Callback, + ): Promise; + /** + * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in + * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a + * sequence number. If a valid project name cannot be generated, a 404 response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: never, + ): Promise; + async getValidProjectName( + parameters: Parameters.GetValidProjectName | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/3/projectvalidate/validProjectName', + method: 'GET', + params: { + name, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectKeyAndNameValidation.ts b/src/version3/projectKeyAndNameValidation.ts deleted file mode 100644 index 811c7d0d93..0000000000 --- a/src/version3/projectKeyAndNameValidation.ts +++ /dev/null @@ -1,118 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectKeyAndNameValidation { - constructor(private client: Client) {} - - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters: Parameters.ValidateProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key by confirming the key is a valid string and not in use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: never, - ): Promise; - async validateProjectKey( - parameters?: Parameters.ValidateProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/3/projectvalidate/key', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters: Parameters.GetValidProjectKey | string | undefined, - callback: Callback, - ): Promise; - /** - * Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: never, - ): Promise; - async getValidProjectKey( - parameters?: Parameters.GetValidProjectKey | string, - callback?: Callback, - ): Promise { - const key = typeof parameters === 'string' ? parameters : parameters?.key; - - const config: RequestConfig = { - url: '/rest/api/3/projectvalidate/validProjectKey', - method: 'GET', - params: { - key, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback: Callback, - ): Promise; - /** - * Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in - * use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a - * sequence number. If a valid project name cannot be generated, a 404 response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: never, - ): Promise; - async getValidProjectName( - parameters: Parameters.GetValidProjectName | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/3/projectvalidate/validProjectName', - method: 'GET', - params: { - name, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectPermissionSchemes.mts b/src/version3/projectPermissionSchemes.mts new file mode 100644 index 0000000000..232301791f --- /dev/null +++ b/src/version3/projectPermissionSchemes.mts @@ -0,0 +1,168 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectPermissionSchemes { + constructor(private client: Client) {} + + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) 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 the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback: Callback, + ): Promise; + /** + * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) 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 the _Administer Projects_ + * [project permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: never, + ): Promise; + async getProjectIssueSecurityScheme( + parameters: Parameters.GetProjectIssueSecurityScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectKeyOrId}/issuesecuritylevelscheme`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) 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 getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback: Callback, + ): Promise; + /** + * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) 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 getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: never, + ): Promise; + async getAssignedPermissionScheme( + parameters: Parameters.GetAssignedPermissionScheme | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectKeyOrId}/permissionscheme`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback: Callback, + ): Promise; + /** + * Assigns a permission scheme with a project. See [Managing project + * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) + */ + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: never, + ): Promise; + async assignPermissionScheme( + parameters: Parameters.AssignPermissionScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectKeyOrId}/permissionscheme`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback: Callback, + ): Promise; + /** + * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has + * access to. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security + * levels are only returned for authenticated user with _Set Issue Security_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + */ + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: never, + ): Promise; + async getSecurityLevelsForProject( + parameters: Parameters.GetSecurityLevelsForProject | string, + callback?: Callback, + ): Promise { + const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectKeyOrId}/securitylevel`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectPermissionSchemes.ts b/src/version3/projectPermissionSchemes.ts deleted file mode 100644 index 3beb67dca1..0000000000 --- a/src/version3/projectPermissionSchemes.ts +++ /dev/null @@ -1,168 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectPermissionSchemes { - constructor(private client: Client) {} - - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) 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 the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback: Callback, - ): Promise; - /** - * Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) 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 the _Administer Projects_ - * [project permission](https://confluence.atlassian.com/x/yodKLg). - */ - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: never, - ): Promise; - async getProjectIssueSecurityScheme( - parameters: Parameters.GetProjectIssueSecurityScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectKeyOrId}/issuesecuritylevelscheme`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) 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 getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback: Callback, - ): Promise; - /** - * Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) 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 getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: never, - ): Promise; - async getAssignedPermissionScheme( - parameters: Parameters.GetAssignedPermissionScheme | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectKeyOrId}/permissionscheme`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback: Callback, - ): Promise; - /** - * Assigns a permission scheme with a project. See [Managing project - * permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) - */ - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: never, - ): Promise; - async assignPermissionScheme( - parameters: Parameters.AssignPermissionScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectKeyOrId}/permissionscheme`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - id: parameters.id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback: Callback, - ): Promise; - /** - * Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has - * access to. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security - * levels are only returned for authenticated user with _Set Issue Security_ [global - * permission](https://confluence.atlassian.com/x/x4dKLg) for the project. - */ - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: never, - ): Promise; - async getSecurityLevelsForProject( - parameters: Parameters.GetSecurityLevelsForProject | string, - callback?: Callback, - ): Promise { - const projectKeyOrId = typeof parameters === 'string' ? parameters : parameters.projectKeyOrId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectKeyOrId}/securitylevel`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectProperties.mts b/src/version3/projectProperties.mts new file mode 100644 index 0000000000..64dc45381e --- /dev/null +++ b/src/version3/projectProperties.mts @@ -0,0 +1,174 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectProperties { + constructor(private client: Client) {} + + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * 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 getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback: Callback, + ): Promise; + /** + * Returns all [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * keys for the project. + * + * 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 getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: never, + ): Promise; + async getProjectPropertyKeys( + parameters: Parameters.GetProjectPropertyKeys | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/properties`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * 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 property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * + * 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 property. + */ + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: never, + ): Promise; + async getProjectProperty( + parameters: Parameters.GetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[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) for the project in which the property is created. + */ + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback: Callback, + ): Promise; + /** + * Sets the value of the [project + * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). + * You can use project properties to store custom data against the project. + * + * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The + * maximum length is 32768 characters. + * + * This operation can be accessed anonymously. + * + * **[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) for the project in which the property is created. + */ + async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; + async setProjectProperty( + parameters: Parameters.SetProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'PUT', + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[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) for the project containing the property. + */ + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback: Callback, + ): Promise; + /** + * Deletes the + * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) + * from a project. + * + * This operation can be accessed anonymously. + * + * **[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) for the project containing the property. + */ + async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; + async deleteProjectProperty( + parameters: Parameters.DeleteProjectProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectProperties.ts b/src/version3/projectProperties.ts deleted file mode 100644 index 9c80b3a9ee..0000000000 --- a/src/version3/projectProperties.ts +++ /dev/null @@ -1,174 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectProperties { - constructor(private client: Client) {} - - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * 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 getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback: Callback, - ): Promise; - /** - * Returns all [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * keys for the project. - * - * 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 getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: never, - ): Promise; - async getProjectPropertyKeys( - parameters: Parameters.GetProjectPropertyKeys | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/properties`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * 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 property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * - * 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 property. - */ - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: never, - ): Promise; - async getProjectProperty( - parameters: Parameters.GetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[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) for the project in which the property is created. - */ - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback: Callback, - ): Promise; - /** - * Sets the value of the [project - * property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). - * You can use project properties to store custom data against the project. - * - * The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The - * maximum length is 32768 characters. - * - * This operation can be accessed anonymously. - * - * **[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) for the project in which the property is created. - */ - async setProjectProperty(parameters: Parameters.SetProjectProperty, callback?: never): Promise; - async setProjectProperty( - parameters: Parameters.SetProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'PUT', - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[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) for the project containing the property. - */ - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback: Callback, - ): Promise; - /** - * Deletes the - * [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) - * from a project. - * - * This operation can be accessed anonymously. - * - * **[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) for the project containing the property. - */ - async deleteProjectProperty(parameters: Parameters.DeleteProjectProperty, callback?: never): Promise; - async deleteProjectProperty( - parameters: Parameters.DeleteProjectProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/properties/${parameters.propertyKey}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectRoleActors.mts b/src/version3/projectRoleActors.mts new file mode 100644 index 0000000000..2086178eac --- /dev/null +++ b/src/version3/projectRoleActors.mts @@ -0,0 +1,249 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectRoleActors { + constructor(private client: Client) {} + + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback: Callback, + ): Promise; + /** + * Adds actors to a project role for the project. + * + * To replace all actors for the project, use [Set actors for project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; + async addActorUsers( + parameters: Parameters.AddActorUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'POST', + data: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; + /** + * Sets the actors for a project role for a project, replacing all existing actors. + * + * To add actors to the project without overwriting the existing list, use [Add actors to project + * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setActors(parameters: Parameters.SetActors, callback?: never): Promise; + async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'PUT', + data: { + categorisedActors: parameters.categorisedActors, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-3-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; + /** + * Deletes actors from a project role for the project. + * + * To remove default actors from the project role, use [Delete default actors from project + * role](#api-rest-api-3-role-id-actors-delete). + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; + async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'DELETE', + params: { + user: parameters.user, + group: parameters.group, + groupId: parameters.groupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback: Callback, + ): Promise; + /** + * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: never, + ): Promise; + async getProjectRoleActorsForRole( + parameters: Parameters.GetProjectRoleActorsForRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/role/${id}/actors`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback: Callback, + ): Promise; + /** + * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add + * groups and users in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: never, + ): Promise; + async addProjectRoleActorsToRole( + parameters: Parameters.AddProjectRoleActorsToRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}/actors`, + method: 'POST', + data: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback: Callback, + ): Promise; + /** + * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, + * but you cannot delete a group and a user in the same request. + * + * Changing a project role's default actors does not affect project role members for projects already created. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: never, + ): Promise; + async deleteProjectRoleActorsFromRole( + parameters: Parameters.DeleteProjectRoleActorsFromRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}/actors`, + method: 'DELETE', + params: { + user: parameters.user, + groupId: parameters.groupId, + group: parameters.group, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectRoleActors.ts b/src/version3/projectRoleActors.ts deleted file mode 100644 index 227a24ac32..0000000000 --- a/src/version3/projectRoleActors.ts +++ /dev/null @@ -1,249 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectRoleActors { - constructor(private client: Client) {} - - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback: Callback, - ): Promise; - /** - * Adds actors to a project role for the project. - * - * To replace all actors for the project, use [Set actors for project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-put). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addActorUsers(parameters: Parameters.AddActorUsers, callback?: never): Promise; - async addActorUsers( - parameters: Parameters.AddActorUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'POST', - data: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback: Callback): Promise; - /** - * Sets the actors for a project role for a project, replacing all existing actors. - * - * To add actors to the project without overwriting the existing list, use [Add actors to project - * role](#api-rest-api-3-project-projectIdOrKey-role-id-post). - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setActors(parameters: Parameters.SetActors, callback?: never): Promise; - async setActors(parameters: Parameters.SetActors, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'PUT', - data: { - categorisedActors: parameters.categorisedActors, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-3-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback: Callback): Promise; - /** - * Deletes actors from a project role for the project. - * - * To remove default actors from the project role, use [Delete default actors from project - * role](#api-rest-api-3-role-id-actors-delete). - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteActor(parameters: Parameters.DeleteActor, callback?: never): Promise; - async deleteActor(parameters: Parameters.DeleteActor, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'DELETE', - params: { - user: parameters.user, - group: parameters.group, - groupId: parameters.groupId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback: Callback, - ): Promise; - /** - * Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: never, - ): Promise; - async getProjectRoleActorsForRole( - parameters: Parameters.GetProjectRoleActorsForRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/role/${id}/actors`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback: Callback, - ): Promise; - /** - * Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add - * groups and users in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: never, - ): Promise; - async addProjectRoleActorsToRole( - parameters: Parameters.AddProjectRoleActorsToRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}/actors`, - method: 'POST', - data: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback: Callback, - ): Promise; - /** - * Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, - * but you cannot delete a group and a user in the same request. - * - * Changing a project role's default actors does not affect project role members for projects already created. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: never, - ): Promise; - async deleteProjectRoleActorsFromRole( - parameters: Parameters.DeleteProjectRoleActorsFromRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}/actors`, - method: 'DELETE', - params: { - user: parameters.user, - groupId: parameters.groupId, - group: parameters.group, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectRoles.mts b/src/version3/projectRoles.mts new file mode 100644 index 0000000000..4695441228 --- /dev/null +++ b/src/version3/projectRoles.mts @@ -0,0 +1,422 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +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. + * + * 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. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + 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. + * + * 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. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site + * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: never, + ): Promise; + async getProjectRoles>( + parameters: Parameters.GetProjectRoles | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/role`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback: Callback, + ): Promise; + /** + * Returns a project role's details and actors associated with the project. The list of actors is sorted by display + * name. + * + * To check whether a user belongs to a role based on their group memberships, use [Get + * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and + * groups match with the actors returned for the project. + * + * This operation can be accessed anonymously. + * + * **[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 or + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; + async getProjectRole( + parameters: Parameters.GetProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, + method: 'GET', + params: { + excludeInactiveUsers: parameters.excludeInactiveUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * This operation can be accessed anonymously. + * + * **[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) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + 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. + * + * This operation can be accessed anonymously. + * + * **[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) for the project. + */ + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: never, + ): Promise; + async getProjectRoleDetails( + parameters: Parameters.GetProjectRoleDetails | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/roledetails`, + method: 'GET', + params: { + currentMember: typeof parameters !== 'string' && parameters.currentMember, + excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### 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 are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification + * schemes](#api-rest-api-3-notificationscheme-get), [issue security + * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * 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 + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback: Callback): Promise; + /** + * Gets a list of all project roles, complete with project role details and default actors. + * + * ### 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 are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification + * schemes](#api-rest-api-3-notificationscheme-get), [issue security + * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and + * workflow conditions. + * + * #### Members and actors + * + * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated + * with a project role. + * + * Actors may be set as [default + * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * 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 + * actors can be removed at the project level later if desired. + * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default + * actors. This enables you to assign a user to different roles in different projects. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllProjectRoles(callback?: never): Promise; + async getAllProjectRoles(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/role', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback: Callback, + ): Promise; + /** + * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default + * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role + * after creating it. + * + * _Note that although a new project role is available to all projects upon creation, any default actors that are + * associated with the project role are not added to projects that existed prior to the role being created._< + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: never, + ): Promise; + async createProjectRole( + parameters: Parameters.CreateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/role', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback: Callback, + ): Promise; + /** + * Gets the project role details and the default actors associated with the role. The list of default actors is sorted + * by display name. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: never, + ): Promise; + async getProjectRoleById( + parameters: Parameters.GetProjectRoleById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/role/${id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates either the project role's name or its description. + * + * You cannot update both the name and description at the same time using this operation. If you send a request with a + * name and a description only the name is updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: never, + ): Promise; + async partialUpdateProjectRole( + parameters: Parameters.PartialUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}`, + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback: Callback, + ): Promise; + /** + * Updates the project role's name and description. You must include both a name and a description in the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: never, + ): Promise; + async fullyUpdateProjectRole( + parameters: Parameters.FullyUpdateProjectRole, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/role/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback: Callback, + ): Promise; + /** + * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in + * use. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; + async deleteProjectRole( + parameters: Parameters.DeleteProjectRole | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/role/${id}`, + method: 'DELETE', + params: { + swap: typeof parameters !== 'string' && parameters.swap, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectRoles.ts b/src/version3/projectRoles.ts deleted file mode 100644 index 36bf07a571..0000000000 --- a/src/version3/projectRoles.ts +++ /dev/null @@ -1,422 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -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. - * - * 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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - 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. - * - * 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. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site - * or _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: never, - ): Promise; - async getProjectRoles>( - parameters: Parameters.GetProjectRoles | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/role`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback: Callback, - ): Promise; - /** - * Returns a project role's details and actors associated with the project. The list of actors is sorted by display - * name. - * - * To check whether a user belongs to a role based on their group memberships, use [Get - * user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and - * groups match with the actors returned for the project. - * - * This operation can be accessed anonymously. - * - * **[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 or - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRole(parameters: Parameters.GetProjectRole, callback?: never): Promise; - async getProjectRole( - parameters: Parameters.GetProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, - method: 'GET', - params: { - excludeInactiveUsers: parameters.excludeInactiveUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * This operation can be accessed anonymously. - * - * **[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) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - 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. - * - * This operation can be accessed anonymously. - * - * **[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) for the project. - */ - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: never, - ): Promise; - async getProjectRoleDetails( - parameters: Parameters.GetProjectRoleDetails | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/roledetails`, - method: 'GET', - params: { - currentMember: typeof parameters !== 'string' && parameters.currentMember, - excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### 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 are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification - * schemes](#api-rest-api-3-notificationscheme-get), [issue security - * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * 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 - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback: Callback): Promise; - /** - * Gets a list of all project roles, complete with project role details and default actors. - * - * ### 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 are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification - * schemes](#api-rest-api-3-notificationscheme-get), [issue security - * levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and - * workflow conditions. - * - * #### Members and actors - * - * In the Jira REST API, a member of a project role is called an _actor_. An _actor_ is a group or user associated - * with a project role. - * - * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) - * 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 - * actors can be removed at the project level later if desired. - * - Actors: Users and groups that are associated with a project role for a project, which may differ from the default - * actors. This enables you to assign a user to different roles in different projects. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllProjectRoles(callback?: never): Promise; - async getAllProjectRoles(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/role', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback: Callback, - ): Promise; - /** - * Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default - * actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role - * after creating it. - * - * _Note that although a new project role is available to all projects upon creation, any default actors that are - * associated with the project role are not added to projects that existed prior to the role being created._< - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: never, - ): Promise; - async createProjectRole( - parameters: Parameters.CreateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/role', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback: Callback, - ): Promise; - /** - * Gets the project role details and the default actors associated with the role. The list of default actors is sorted - * by display name. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: never, - ): Promise; - async getProjectRoleById( - parameters: Parameters.GetProjectRoleById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/role/${id}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates either the project role's name or its description. - * - * You cannot update both the name and description at the same time using this operation. If you send a request with a - * name and a description only the name is updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: never, - ): Promise; - async partialUpdateProjectRole( - parameters: Parameters.PartialUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}`, - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback: Callback, - ): Promise; - /** - * Updates the project role's name and description. You must include both a name and a description in the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: never, - ): Promise; - async fullyUpdateProjectRole( - parameters: Parameters.FullyUpdateProjectRole, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/role/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback: Callback, - ): Promise; - /** - * Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in - * use. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProjectRole(parameters: Parameters.DeleteProjectRole | string, callback?: never): Promise; - async deleteProjectRole( - parameters: Parameters.DeleteProjectRole | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/role/${id}`, - method: 'DELETE', - params: { - swap: typeof parameters !== 'string' && parameters.swap, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectTypes.mts b/src/version3/projectTypes.mts new file mode 100644 index 0000000000..d2d7e36302 --- /dev/null +++ b/src/version3/projectTypes.mts @@ -0,0 +1,119 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectTypes { + constructor(private client: Client) {} + + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback: Callback): Promise; + /** + * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid + * license for each type. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllProjectTypes(callback?: never): Promise; + async getAllProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/type', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback: Callback): Promise; + /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ + async getAllAccessibleProjectTypes(callback?: never): Promise; + async getAllAccessibleProjectTypes(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/type/accessible', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: never, + ): Promise; + async getProjectTypeByKey( + parameters: Parameters.GetProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/type/${projectTypeKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback: Callback, + ): Promise; + /** + * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: never, + ): Promise; + async getAccessibleProjectTypeByKey( + parameters: Parameters.GetAccessibleProjectTypeByKey | string, + callback?: Callback, + ): Promise { + const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/type/${projectTypeKey}/accessible`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectTypes.ts b/src/version3/projectTypes.ts deleted file mode 100644 index 580dc24706..0000000000 --- a/src/version3/projectTypes.ts +++ /dev/null @@ -1,119 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectTypes { - constructor(private client: Client) {} - - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback: Callback): Promise; - /** - * Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid - * license for each type. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getAllProjectTypes(callback?: never): Promise; - async getAllProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/type', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback: Callback): Promise; - /** Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. */ - async getAllAccessibleProjectTypes(callback?: never): Promise; - async getAllAccessibleProjectTypes(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/type/accessible', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: never, - ): Promise; - async getProjectTypeByKey( - parameters: Parameters.GetProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/type/${projectTypeKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback: Callback, - ): Promise; - /** - * Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: never, - ): Promise; - async getAccessibleProjectTypeByKey( - parameters: Parameters.GetAccessibleProjectTypeByKey | string, - callback?: Callback, - ): Promise { - const projectTypeKey = typeof parameters === 'string' ? parameters : parameters.projectTypeKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/type/${projectTypeKey}/accessible`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projectVersions.mts b/src/version3/projectVersions.mts new file mode 100644 index 0000000000..cd6b8dedc9 --- /dev/null +++ b/src/version3/projectVersions.mts @@ -0,0 +1,439 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ProjectVersions { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * 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 getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource + * if you want to get a full list of versions without pagination. + * + * 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 getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: never, + ): Promise; + async getProjectVersionsPaginated( + parameters: Parameters.GetProjectVersionsPaginated | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * 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 getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback: Callback, + ): Promise; + /** + * Returns all versions in a project. The response is not paginated. Use [Get project versions + * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with + * pagination. + * + * 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 getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: never, + ): Promise; + async getProjectVersions( + parameters: Parameters.GetProjectVersions | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/versions`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; + /** + * Creates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project the version is added to. + */ + async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; + async createVersion( + parameters: Parameters.CreateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/version', + method: 'POST', + data: { + expand: parameters.expand, + self: parameters.self, + id: parameters.id, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + 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, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a project version. + * + * 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 getVersion( + parameters: Parameters.GetVersion | string, + callback: Callback, + ): Promise; + /** + * Returns a project version. + * + * 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 getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; + async getVersion( + parameters: Parameters.GetVersion | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/version/${id}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; + /** + * Updates a project version. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; + async updateVersion( + parameters: Parameters.UpdateVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}`, + method: 'PUT', + data: { + expand: parameters.expand, + description: parameters.description, + name: parameters.name, + archived: parameters.archived, + released: parameters.released, + startDate: parameters.startDate, + releaseDate: parameters.releaseDate, + projectId: parameters.projectId, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; + /** + * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any + * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. + * + * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource + * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; + async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; + /** + * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; + async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns the following counts for a version: + * + * - Number of issues where the `fixVersion` is set to the version. + * - Number of issues where the `affectedVersion` is set to the version. + * - Number of issues where a version custom field is set to the version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: never, + ): Promise; + async getVersionRelatedIssues( + parameters: Parameters.GetVersionRelatedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/version/${id}/relatedIssueCounts`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback: Callback, + ): Promise; + /** + * Deletes a project version. + * + * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, + * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of + * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are + * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version + * being deleted. + * + * This operation can be accessed anonymously. + * + * **[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) for the project that contains the version. + */ + async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; + async deleteAndReplaceVersion( + parameters: Parameters.DeleteAndReplaceVersion, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/removeAndSwap`, + method: 'POST', + data: { + moveFixIssuesTo: parameters.moveFixIssuesTo, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + customFieldReplacementList: parameters.customFieldReplacementList, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback: Callback, + ): Promise; + /** + * Returns counts of the issues and unresolved issues for the project version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ project permission for the project that contains the version. + */ + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: never, + ): Promise; + async getVersionUnresolvedIssues( + parameters: Parameters.GetVersionUnresolvedIssues | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/version/${id}/unresolvedIssueCount`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectVersions.ts b/src/version3/projectVersions.ts deleted file mode 100644 index 5a53a87d9c..0000000000 --- a/src/version3/projectVersions.ts +++ /dev/null @@ -1,439 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ProjectVersions { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * 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 getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource - * if you want to get a full list of versions without pagination. - * - * 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 getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: never, - ): Promise; - async getProjectVersionsPaginated( - parameters: Parameters.GetProjectVersionsPaginated | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * 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 getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback: Callback, - ): Promise; - /** - * Returns all versions in a project. The response is not paginated. Use [Get project versions - * paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with - * pagination. - * - * 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 getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: never, - ): Promise; - async getProjectVersions( - parameters: Parameters.GetProjectVersions | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/versions`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback: Callback): Promise; - /** - * Creates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project the version is added to. - */ - async createVersion(parameters: Parameters.CreateVersion, callback?: never): Promise; - async createVersion( - parameters: Parameters.CreateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/version', - method: 'POST', - data: { - expand: parameters.expand, - self: parameters.self, - id: parameters.id, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - 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, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a project version. - * - * 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 getVersion( - parameters: Parameters.GetVersion | string, - callback: Callback, - ): Promise; - /** - * Returns a project version. - * - * 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 getVersion(parameters: Parameters.GetVersion | string, callback?: never): Promise; - async getVersion( - parameters: Parameters.GetVersion | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/version/${id}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback: Callback): Promise; - /** - * Updates a project version. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async updateVersion(parameters: Parameters.UpdateVersion, callback?: never): Promise; - async updateVersion( - parameters: Parameters.UpdateVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}`, - method: 'PUT', - data: { - expand: parameters.expand, - description: parameters.description, - name: parameters.name, - archived: parameters.archived, - released: parameters.released, - startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback: Callback): Promise; - /** - * Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any - * occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. - * - * Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource - * supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async mergeVersions(parameters: Parameters.MergeVersions, callback?: never): Promise; - async mergeVersions(parameters: Parameters.MergeVersions, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}/mergeto/${parameters.moveIssuesTo}`, - method: 'PUT', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback: Callback): Promise; - /** - * Modifies the version's sequence within the project, which affects the display order of the versions in Jira. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async moveVersion(parameters: Parameters.MoveVersion, callback?: never): Promise; - async moveVersion(parameters: Parameters.MoveVersion, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns the following counts for a version: - * - * - Number of issues where the `fixVersion` is set to the version. - * - Number of issues where the `affectedVersion` is set to the version. - * - Number of issues where a version custom field is set to the version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: never, - ): Promise; - async getVersionRelatedIssues( - parameters: Parameters.GetVersionRelatedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/version/${id}/relatedIssueCounts`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback: Callback, - ): Promise; - /** - * Deletes a project version. - * - * Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, - * `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of - * `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are - * cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version - * being deleted. - * - * This operation can be accessed anonymously. - * - * **[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) for the project that contains the version. - */ - async deleteAndReplaceVersion(parameters: Parameters.DeleteAndReplaceVersion, callback?: never): Promise; - async deleteAndReplaceVersion( - parameters: Parameters.DeleteAndReplaceVersion, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/version/${parameters.id}/removeAndSwap`, - method: 'POST', - data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, - customFieldReplacementList: parameters.customFieldReplacementList, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback: Callback, - ): Promise; - /** - * Returns counts of the issues and unresolved issues for the project version. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ project permission for the project that contains the version. - */ - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: never, - ): Promise; - async getVersionUnresolvedIssues( - parameters: Parameters.GetVersionUnresolvedIssues | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/version/${id}/unresolvedIssueCount`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/projects.mts b/src/version3/projects.mts new file mode 100644 index 0000000000..50e7f898e0 --- /dev/null +++ b/src/version3/projects.mts @@ -0,0 +1,514 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Projects { + constructor(private client: Client) {} + + /** + * 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` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback: Callback, + ): Promise; + /** + * 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` | + * + * The project types are available according to the installed Jira features as follows: + * + * - Jira Core, the default, enables `business` projects. + * - Jira Service Management enables `service_desk` projects. + * - Jira Software enables `software` projects. + * + * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the + * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > + * **Apps** > **Finding new apps**. For more information, see [ Managing + * add-ons](https://confluence.atlassian.com/x/S31NLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createProject( + parameters: Parameters.CreateProject, + callback?: never, + ): Promise; + async createProject( + parameters: Parameters.CreateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project', + method: 'POST', + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + fieldConfigurationScheme: parameters.fieldConfigurationScheme, + issueSecurityScheme: parameters.issueSecurityScheme, + issueTypeScheme: parameters.issueTypeScheme, + issueTypeScreenScheme: parameters.issueTypeScreenScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + workflowScheme: parameters.workflowScheme, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 getRecent( + parameters: Parameters.GetRecent | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; + async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/recent', + method: 'GET', + params: { + expand: parameters?.expand, + properties: parameters?.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 searchProjects( + parameters: Parameters.SearchProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects visible to the user. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Projects are returned only where the user has one of: + * + * - _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 searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; + async searchProjects( + parameters?: Parameters.SearchProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/project/search', + method: 'GET', + params: { + action: parameters?.action, + categoryId: parameters?.categoryId, + expand: parameters?.expand, + id: parameters?.id, + keys: parameters?.keys, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + properties: parameters?.properties, + propertyQuery: parameters?.propertyQuery, + query: parameters?.query, + startAt: parameters?.startAt, + status: parameters?.status, + typeKey: parameters?.typeKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * 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 getProject( + parameters: Parameters.GetProject | string, + callback: Callback, + ): Promise; + /** + * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. + * + * 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 getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; + async getProject( + parameters: Parameters.GetProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}`, + method: 'GET', + params: { + expand: typeof parameters !== 'string' && parameters.expand, + properties: typeof parameters !== 'string' && parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. + * + * All parameters are optional in the body of the request. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; + async updateProject( + parameters: Parameters.UpdateProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}`, + method: 'PUT', + params: { + expand: parameters.expand, + }, + data: { + assigneeType: parameters.assigneeType, + avatarId: parameters.avatarId, + categoryId: parameters.categoryId, + description: parameters.description, + issueSecurityScheme: parameters.issueSecurityScheme, + key: parameters.key, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + notificationScheme: parameters.notificationScheme, + permissionScheme: parameters.permissionScheme, + projectTemplateKey: parameters.projectTemplateKey, + projectTypeKey: parameters.projectTypeKey, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; + /** + * Deletes a project. + * + * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. + * To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; + async deleteProject( + parameters: Parameters.DeleteProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}`, + method: 'DELETE', + params: { + enableUndo: typeof parameters !== 'string' && parameters.enableUndo, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; + /** + * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project + * and then delete it. To restore a project, use the Jira UI. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; + async archiveProject( + parameters: Parameters.ArchiveProject | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/archive`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [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 deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback: Callback, + ): Promise; + /** + * Deletes a project asynchronously. + * + * This operation is: + * + * - Transactional, that is, if part of the delete fails the project is not deleted. + * - [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 deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: never, + ): Promise; + async deleteProjectAsynchronously( + parameters: Parameters.DeleteProjectAsynchronously | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/delete`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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). + */ + 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). + */ + async restore(parameters: Parameters.Restore | string, callback?: never): Promise; + async restore( + parameters: Parameters.Restore | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/restore`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * 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 getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback: Callback, + ): Promise; + /** + * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of + * valid issue types and each issue type has a set of valid statuses. + * + * 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 getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: never, + ): Promise; + async getAllStatuses( + parameters: Parameters.GetAllStatuses | string, + callback?: Callback, + ): Promise { + const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectIdOrKey}/statuses`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[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 getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback: Callback, + ): Promise; + /** + * Get the issue type hierarchy for a next-gen project. + * + * The issue type hierarchy for a project consists of: + * + * - _Epic_ at level 1 (optional). + * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these + * issue types are used to break down the content of an epic. + * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. + * Issues based on a level -1 issue type must have a parent issue. + * + * **[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 getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: never, + ): Promise; + async getHierarchy( + parameters: Parameters.GetHierarchy | string, + callback?: Callback, + ): Promise { + const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; + + const config: RequestConfig = { + url: `/rest/api/3/project/${projectId}/hierarchy`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projects.ts b/src/version3/projects.ts deleted file mode 100644 index 1272ee5e71..0000000000 --- a/src/version3/projects.ts +++ /dev/null @@ -1,514 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Projects { - constructor(private client: Client) {} - - /** - * 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` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback: Callback, - ): Promise; - /** - * 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` | - * - * The project types are available according to the installed Jira features as follows: - * - * - Jira Core, the default, enables `business` projects. - * - Jira Service Management enables `service_desk` projects. - * - Jira Software enables `software` projects. - * - * To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the - * System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > - * **Apps** > **Finding new apps**. For more information, see [ Managing - * add-ons](https://confluence.atlassian.com/x/S31NLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createProject( - parameters: Parameters.CreateProject, - callback?: never, - ): Promise; - async createProject( - parameters: Parameters.CreateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project', - method: 'POST', - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - fieldConfigurationScheme: parameters.fieldConfigurationScheme, - issueSecurityScheme: parameters.issueSecurityScheme, - issueTypeScheme: parameters.issueTypeScheme, - issueTypeScreenScheme: parameters.issueTypeScreenScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - workflowScheme: parameters.workflowScheme, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 getRecent( - parameters: Parameters.GetRecent | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 getRecent(parameters?: Parameters.GetRecent, callback?: never): Promise; - async getRecent(parameters?: Parameters.GetRecent, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/recent', - method: 'GET', - params: { - expand: parameters?.expand, - properties: parameters?.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 searchProjects( - parameters: Parameters.SearchProjects | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * projects visible to the user. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Projects are returned only where the user has one of: - * - * - _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 searchProjects(parameters?: Parameters.SearchProjects, callback?: never): Promise; - async searchProjects( - parameters?: Parameters.SearchProjects, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/project/search', - method: 'GET', - params: { - action: parameters?.action, - categoryId: parameters?.categoryId, - expand: parameters?.expand, - id: parameters?.id, - keys: parameters?.keys, - maxResults: parameters?.maxResults, - orderBy: parameters?.orderBy, - properties: parameters?.properties, - propertyQuery: parameters?.propertyQuery, - query: parameters?.query, - startAt: parameters?.startAt, - status: parameters?.status, - typeKey: parameters?.typeKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * 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 getProject( - parameters: Parameters.GetProject | string, - callback: Callback, - ): Promise; - /** - * Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. - * - * 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 getProject(parameters: Parameters.GetProject | string, callback?: never): Promise; - async getProject( - parameters: Parameters.GetProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}`, - method: 'GET', - params: { - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. - * - * All parameters are optional in the body of the request. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; - async updateProject( - parameters: Parameters.UpdateProject, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/project/${parameters.projectIdOrKey}`, - method: 'PUT', - params: { - expand: parameters.expand, - }, - data: { - assigneeType: parameters.assigneeType, - avatarId: parameters.avatarId, - categoryId: parameters.categoryId, - description: parameters.description, - issueSecurityScheme: parameters.issueSecurityScheme, - key: parameters.key, - leadAccountId: parameters.leadAccountId, - name: parameters.name, - notificationScheme: parameters.notificationScheme, - permissionScheme: parameters.permissionScheme, - projectTemplateKey: parameters.projectTemplateKey, - projectTypeKey: parameters.projectTypeKey, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback: Callback): Promise; - /** - * Deletes a project. - * - * You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. - * To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteProject(parameters: Parameters.DeleteProject | string, callback?: never): Promise; - async deleteProject( - parameters: Parameters.DeleteProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}`, - method: 'DELETE', - params: { - enableUndo: typeof parameters !== 'string' && parameters.enableUndo, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback: Callback): Promise; - /** - * Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project - * and then delete it. To restore a project, use the Jira UI. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async archiveProject(parameters: Parameters.ArchiveProject | string, callback?: never): Promise; - async archiveProject( - parameters: Parameters.ArchiveProject | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/archive`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [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 deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback: Callback, - ): Promise; - /** - * Deletes a project asynchronously. - * - * This operation is: - * - * - Transactional, that is, if part of the delete fails the project is not deleted. - * - [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 deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: never, - ): Promise; - async deleteProjectAsynchronously( - parameters: Parameters.DeleteProjectAsynchronously | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/delete`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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). - */ - 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). - */ - async restore(parameters: Parameters.Restore | string, callback?: never): Promise; - async restore( - parameters: Parameters.Restore | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/restore`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * 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 getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback: Callback, - ): Promise; - /** - * Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of - * valid issue types and each issue type has a set of valid statuses. - * - * 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 getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: never, - ): Promise; - async getAllStatuses( - parameters: Parameters.GetAllStatuses | string, - callback?: Callback, - ): Promise { - const projectIdOrKey = typeof parameters === 'string' ? parameters : parameters.projectIdOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectIdOrKey}/statuses`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[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 getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback: Callback, - ): Promise; - /** - * Get the issue type hierarchy for a next-gen project. - * - * The issue type hierarchy for a project consists of: - * - * - _Epic_ at level 1 (optional). - * - One or more issue types at level 0 such as _Story_, _Task_, or _Bug_. Where the issue type _Epic_ is defined, these - * issue types are used to break down the content of an epic. - * - _Subtask_ at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. - * Issues based on a level -1 issue type must have a parent issue. - * - * **[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 getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: never, - ): Promise; - async getHierarchy( - parameters: Parameters.GetHierarchy | string, - callback?: Callback, - ): Promise { - const projectId = typeof parameters === 'string' ? parameters : parameters.projectId; - - const config: RequestConfig = { - url: `/rest/api/3/project/${projectId}/hierarchy`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screenSchemes.mts b/src/version3/screenSchemes.mts new file mode 100644 index 0000000000..208c11a52d --- /dev/null +++ b/src/version3/screenSchemes.mts @@ -0,0 +1,160 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects 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). + */ + async getScreenSchemes( + parameters: Parameters.GetScreenSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen + * schemes. + * + * Only screen schemes used in classic projects 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). + */ + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: never, + ): Promise; + async getScreenSchemes( + parameters?: Parameters.GetScreenSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screenscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen 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 createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Creates a screen 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 createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: never, + ): Promise; + async createScreenScheme( + parameters: Parameters.CreateScreenScheme | string, + callback?: Callback, + ): Promise { + const name = typeof parameters === 'string' ? parameters : parameters.name; + + const config: RequestConfig = { + url: '/rest/api/3/screenscheme', + method: 'POST', + data: { + name, + description: typeof parameters !== 'string' && parameters.description, + screens: typeof parameters !== 'string' && parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; + /** + * Updates a screen scheme. Only screen schemes used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; + async updateScreenScheme( + parameters: Parameters.UpdateScreenScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screenscheme/${parameters.screenSchemeId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + screens: parameters.screens, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. + * + * Only screens schemes used in classic projects can be deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; + async deleteScreenScheme( + parameters: Parameters.DeleteScreenScheme | string, + callback?: Callback, + ): Promise { + const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; + + const config: RequestConfig = { + url: `/rest/api/3/screenscheme/${screenSchemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screenSchemes.ts b/src/version3/screenSchemes.ts deleted file mode 100644 index 0d105c2fdf..0000000000 --- a/src/version3/screenSchemes.ts +++ /dev/null @@ -1,160 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ScreenSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects 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). - */ - async getScreenSchemes( - parameters: Parameters.GetScreenSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of screen - * schemes. - * - * Only screen schemes used in classic projects 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). - */ - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: never, - ): Promise; - async getScreenSchemes( - parameters?: Parameters.GetScreenSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/screenscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen 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 createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Creates a screen 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 createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: never, - ): Promise; - async createScreenScheme( - parameters: Parameters.CreateScreenScheme | string, - callback?: Callback, - ): Promise { - const name = typeof parameters === 'string' ? parameters : parameters.name; - - const config: RequestConfig = { - url: '/rest/api/3/screenscheme', - method: 'POST', - data: { - name, - description: typeof parameters !== 'string' && parameters.description, - screens: typeof parameters !== 'string' && parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback: Callback): Promise; - /** - * Updates a screen scheme. Only screen schemes used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreenScheme(parameters: Parameters.UpdateScreenScheme, callback?: never): Promise; - async updateScreenScheme( - parameters: Parameters.UpdateScreenScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screenscheme/${parameters.screenSchemeId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - screens: parameters.screens, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. - * - * Only screens schemes used in classic projects can be deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenScheme(parameters: Parameters.DeleteScreenScheme | string, callback?: never): Promise; - async deleteScreenScheme( - parameters: Parameters.DeleteScreenScheme | string, - callback?: Callback, - ): Promise { - const screenSchemeId = typeof parameters === 'string' ? parameters : parameters.screenSchemeId; - - const config: RequestConfig = { - url: `/rest/api/3/screenscheme/${screenSchemeId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screenTabFields.mts b/src/version3/screenTabFields.mts new file mode 100644 index 0000000000..d272e5c062 --- /dev/null +++ b/src/version3/screenTabFields.mts @@ -0,0 +1,150 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabFields { + constructor(private client: Client) {} + + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback: Callback, + ): Promise; + /** + * Returns all fields for a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: never, + ): Promise; + async getAllScreenTabFields( + parameters: Parameters.GetAllScreenTabFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'GET', + params: { + projectKey: parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback: Callback, + ): Promise; + /** + * Adds a field to a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: never, + ): Promise; + async addScreenTabField( + parameters: Parameters.AddScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, + method: 'POST', + data: { + fieldId: parameters.fieldId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback: Callback, + ): Promise; + /** + * Removes a field from a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; + async removeScreenTabField( + parameters: Parameters.RemoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; + /** + * Moves a screen tab field. + * + * If `after` and `position` are provided in the request, `position` is ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; + async moveScreenTabField( + parameters: Parameters.MoveScreenTabField, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, + method: 'POST', + data: { + after: parameters.after, + position: parameters.position, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screenTabFields.ts b/src/version3/screenTabFields.ts deleted file mode 100644 index 96de3f640e..0000000000 --- a/src/version3/screenTabFields.ts +++ /dev/null @@ -1,150 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ScreenTabFields { - constructor(private client: Client) {} - - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback: Callback, - ): Promise; - /** - * Returns all fields for a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: never, - ): Promise; - async getAllScreenTabFields( - parameters: Parameters.GetAllScreenTabFields, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'GET', - params: { - projectKey: parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback: Callback, - ): Promise; - /** - * Adds a field to a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: never, - ): Promise; - async addScreenTabField( - parameters: Parameters.AddScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields`, - method: 'POST', - data: { - fieldId: parameters.fieldId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback: Callback, - ): Promise; - /** - * Removes a field from a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async removeScreenTabField(parameters: Parameters.RemoveScreenTabField, callback?: never): Promise; - async removeScreenTabField( - parameters: Parameters.RemoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback: Callback): Promise; - /** - * Moves a screen tab field. - * - * If `after` and `position` are provided in the request, `position` is ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTabField(parameters: Parameters.MoveScreenTabField, callback?: never): Promise; - async moveScreenTabField( - parameters: Parameters.MoveScreenTabField, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/fields/${parameters.id}/move`, - method: 'POST', - data: { - after: parameters.after, - position: parameters.position, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screenTabs.mts b/src/version3/screenTabs.mts new file mode 100644 index 0000000000..608f8f819d --- /dev/null +++ b/src/version3/screenTabs.mts @@ -0,0 +1,166 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ScreenTabs { + constructor(private client: Client) {} + + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is + * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen + * Scheme. + */ + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: never, + ): Promise; + async getAllScreenTabs( + parameters: Parameters.GetAllScreenTabs | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/${screenId}/tabs`, + method: 'GET', + params: { + projectKey: typeof parameters !== 'string' && parameters.projectKey, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback: Callback, + ): Promise; + /** + * Creates a tab for a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; + async addScreenTab( + parameters: Parameters.AddScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs`, + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback: Callback, + ): Promise; + /** + * Updates the name of a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; + async renameScreenTab( + parameters: Parameters.RenameScreenTab, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'PUT', + data: { + id: parameters.id, + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; + /** + * Deletes a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; + async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; + /** + * Moves a screen tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; + async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screenTabs.ts b/src/version3/screenTabs.ts deleted file mode 100644 index 370565a10f..0000000000 --- a/src/version3/screenTabs.ts +++ /dev/null @@ -1,166 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ScreenTabs { - constructor(private client: Client) {} - - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback: Callback, - ): Promise; - /** - * Returns the list of tabs for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is - * specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen - * Scheme. - */ - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: never, - ): Promise; - async getAllScreenTabs( - parameters: Parameters.GetAllScreenTabs | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/${screenId}/tabs`, - method: 'GET', - params: { - projectKey: typeof parameters !== 'string' && parameters.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback: Callback, - ): Promise; - /** - * Creates a tab for a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addScreenTab(parameters: Parameters.AddScreenTab, callback?: never): Promise; - async addScreenTab( - parameters: Parameters.AddScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs`, - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback: Callback, - ): Promise; - /** - * Updates the name of a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async renameScreenTab(parameters: Parameters.RenameScreenTab, callback?: never): Promise; - async renameScreenTab( - parameters: Parameters.RenameScreenTab, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'PUT', - data: { - id: parameters.id, - name: parameters.name, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback: Callback): Promise; - /** - * Deletes a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: never): Promise; - async deleteScreenTab(parameters: Parameters.DeleteScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback: Callback): Promise; - /** - * Moves a screen tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: never): Promise; - async moveScreenTab(parameters: Parameters.MoveScreenTab, callback?: Callback): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}/tabs/${parameters.tabId}/move/${parameters.pos}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/screens.mts b/src/version3/screens.mts new file mode 100644 index 0000000000..9da60d95cb --- /dev/null +++ b/src/version3/screens.mts @@ -0,0 +1,243 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Screens { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * screens a field is used in. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: never, + ): Promise; + async getScreensForField( + parameters: Parameters.GetScreensForField | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/field/${fieldId}/screens`, + method: 'GET', + params: { + startAt: typeof parameters !== 'string' && parameters.startAt, + maxResults: typeof parameters !== 'string' && parameters.maxResults, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens( + parameters: Parameters.GetScreens | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * screens or those specified by one or more screen IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; + async getScreens( + parameters?: Parameters.GetScreens, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screens', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + id: parameters?.id, + queryString: parameters?.queryString, + scope: parameters?.scope, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; + /** + * Creates a screen with a default field tab. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; + async createScreen( + parameters: Parameters.CreateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screens', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback: Callback, + ): Promise; + /** + * Adds a field to the default tab of the default screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: never, + ): Promise; + async addFieldToDefaultScreen( + parameters: Parameters.AddFieldToDefaultScreen | string, + callback?: Callback, + ): Promise { + const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/addToDefault/${fieldId}`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; + /** + * Updates a screen. Only screens used in classic projects can be updated. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; + async updateScreen( + parameters: Parameters.UpdateScreen, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/screens/${parameters.screenId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; + /** + * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. + * + * Only screens used in classic projects can be deleted. + */ + async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; + async deleteScreen( + parameters: Parameters.DeleteScreen | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/${screenId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback: Callback, + ): Promise; + /** + * Returns the fields that can be added to a tab on a screen. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: never, + ): Promise; + async getAvailableScreenFields( + parameters: Parameters.GetAvailableScreenFields | string, + callback?: Callback, + ): Promise { + const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; + + const config: RequestConfig = { + url: `/rest/api/3/screens/${screenId}/availableFields`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/screens.ts b/src/version3/screens.ts deleted file mode 100644 index 7a1c41365c..0000000000 --- a/src/version3/screens.ts +++ /dev/null @@ -1,243 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Screens { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * screens a field is used in. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: never, - ): Promise; - async getScreensForField( - parameters: Parameters.GetScreensForField | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/field/${fieldId}/screens`, - method: 'GET', - params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens( - parameters: Parameters.GetScreens | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * screens or those specified by one or more screen IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getScreens(parameters?: Parameters.GetScreens, callback?: never): Promise; - async getScreens( - parameters?: Parameters.GetScreens, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/screens', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - id: parameters?.id, - queryString: parameters?.queryString, - scope: parameters?.scope, - orderBy: parameters?.orderBy, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback: Callback): Promise; - /** - * Creates a screen with a default field tab. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createScreen(parameters: Parameters.CreateScreen, callback?: never): Promise; - async createScreen( - parameters: Parameters.CreateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/screens', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback: Callback, - ): Promise; - /** - * Adds a field to the default tab of the default screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: never, - ): Promise; - async addFieldToDefaultScreen( - parameters: Parameters.AddFieldToDefaultScreen | string, - callback?: Callback, - ): Promise { - const fieldId = typeof parameters === 'string' ? parameters : parameters.fieldId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/addToDefault/${fieldId}`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback: Callback): Promise; - /** - * Updates a screen. Only screens used in classic projects can be updated. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateScreen(parameters: Parameters.UpdateScreen, callback?: never): Promise; - async updateScreen( - parameters: Parameters.UpdateScreen, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/screens/${parameters.screenId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback: Callback): Promise; - /** - * Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. - * - * Only screens used in classic projects can be deleted. - */ - async deleteScreen(parameters: Parameters.DeleteScreen | string, callback?: never): Promise; - async deleteScreen( - parameters: Parameters.DeleteScreen | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/${screenId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback: Callback, - ): Promise; - /** - * Returns the fields that can be added to a tab on a screen. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: never, - ): Promise; - async getAvailableScreenFields( - parameters: Parameters.GetAvailableScreenFields | string, - callback?: Callback, - ): Promise { - const screenId = typeof parameters === 'string' ? parameters : parameters.screenId; - - const config: RequestConfig = { - url: `/rest/api/3/screens/${screenId}/availableFields`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/serverInfo.mts b/src/version3/serverInfo.mts new file mode 100644 index 0000000000..69b7b7667e --- /dev/null +++ b/src/version3/serverInfo.mts @@ -0,0 +1,33 @@ +import * as Models from './models/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class ServerInfo { + constructor(private client: Client) {} + + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getServerInfo(callback: Callback): Promise; + /** + * Returns information about the Jira instance. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getServerInfo(callback?: never): Promise; + async getServerInfo(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/serverInfo', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/serverInfo.ts b/src/version3/serverInfo.ts deleted file mode 100644 index d1eb84ee3f..0000000000 --- a/src/version3/serverInfo.ts +++ /dev/null @@ -1,33 +0,0 @@ -import * as Models from './models'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class ServerInfo { - constructor(private client: Client) {} - - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getServerInfo(callback: Callback): Promise; - /** - * Returns information about the Jira instance. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getServerInfo(callback?: never): Promise; - async getServerInfo(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/serverInfo', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/status.mts b/src/version3/status.mts new file mode 100644 index 0000000000..ce2302e2f0 --- /dev/null +++ b/src/version3/status.mts @@ -0,0 +1,196 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Status { + constructor(private client: Client) {} + + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback: Callback, + ): Promise; + /** + * Returns a list of the statuses specified by one or more status IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: never, + ): Promise; + async getStatusesById( + parameters: Parameters.GetStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'GET', + params: { + id, + expand: typeof parameters !== 'string' && parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses( + parameters: Parameters.CreateStatuses, + callback: Callback, + ): Promise; + /** + * Creates statuses for a global or project scope. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; + async createStatuses( + parameters: Parameters.CreateStatuses, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'POST', + data: { + statuses: parameters.statuses, + scope: parameters.scope, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; + /** + * Updates statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; + async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'PUT', + data: { + statuses: parameters.statuses, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback: Callback, + ): Promise; + /** + * Deletes statuses by ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; + async deleteStatusesById( + parameters: Parameters.DeleteStatusesById | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: '/rest/api/3/statuses', + method: 'DELETE', + params: { + id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * statuses that match a search on name or project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search( + parameters: Parameters.Search | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * statuses that match a search on name or project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) + */ + async search(parameters?: Parameters.Search, callback?: never): Promise; + async search(parameters?: Parameters.Search, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuses/search', + method: 'GET', + params: { + expand: parameters?.expand, + projectId: parameters?.projectId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + searchString: parameters?.searchString, + statusCategory: parameters?.statusCategory, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/status.ts b/src/version3/status.ts deleted file mode 100644 index ac52b3a0a0..0000000000 --- a/src/version3/status.ts +++ /dev/null @@ -1,196 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Status { - constructor(private client: Client) {} - - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback: Callback, - ): Promise; - /** - * Returns a list of the statuses specified by one or more status IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: never, - ): Promise; - async getStatusesById( - parameters: Parameters.GetStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'GET', - params: { - id, - expand: typeof parameters !== 'string' && parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses( - parameters: Parameters.CreateStatuses, - callback: Callback, - ): Promise; - /** - * Creates statuses for a global or project scope. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async createStatuses(parameters: Parameters.CreateStatuses, callback?: never): Promise; - async createStatuses( - parameters: Parameters.CreateStatuses, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'POST', - data: { - statuses: parameters.statuses, - scope: parameters.scope, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback: Callback): Promise; - /** - * Updates statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: never): Promise; - async updateStatuses(parameters: Parameters.UpdateStatuses, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'PUT', - data: { - statuses: parameters.statuses, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback: Callback, - ): Promise; - /** - * Deletes statuses by ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async deleteStatusesById(parameters: Parameters.DeleteStatusesById | string, callback?: never): Promise; - async deleteStatusesById( - parameters: Parameters.DeleteStatusesById | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: '/rest/api/3/statuses', - method: 'DELETE', - params: { - id, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * statuses that match a search on name or project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search( - parameters: Parameters.Search | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * statuses that match a search on name or project. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer projects_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - * - _Administer Jira_ [project permission.](https://confluence.atlassian.com/x/yodKLg) - */ - async search(parameters?: Parameters.Search, callback?: never): Promise; - async search(parameters?: Parameters.Search, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuses/search', - method: 'GET', - params: { - expand: parameters?.expand, - projectId: parameters?.projectId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - searchString: parameters?.searchString, - statusCategory: parameters?.statusCategory, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/tasks.mts b/src/version3/tasks.mts new file mode 100644 index 0000000000..ed927c4923 --- /dev/null +++ b/src/version3/tasks.mts @@ -0,0 +1,87 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Tasks { + constructor(private client: Client) {} + + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask( + parameters: Parameters.GetTask | string, + callback: Callback, + ): Promise; + /** + * Returns the status of a [long-running asynchronous + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; + async getTask( + parameters: Parameters.GetTask | string, + callback?: Callback, + ): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/3/task/${taskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; + /** + * Cancels a task. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - Creator of the task. + */ + async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; + async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { + const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; + + const config: RequestConfig = { + url: `/rest/api/3/task/${taskId}/cancel`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/tasks.ts b/src/version3/tasks.ts deleted file mode 100644 index 12997fe418..0000000000 --- a/src/version3/tasks.ts +++ /dev/null @@ -1,87 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Tasks { - constructor(private client: Client) {} - - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask( - parameters: Parameters.GetTask | string, - callback: Callback, - ): Promise; - /** - * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async getTask(parameters: Parameters.GetTask | string, callback?: never): Promise; - async getTask( - parameters: Parameters.GetTask | string, - callback?: Callback, - ): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/3/task/${taskId}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback: Callback): Promise; - /** - * Cancels a task. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either - * of: - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - * - Creator of the task. - */ - async cancelTask(parameters: Parameters.CancelTask | string, callback?: never): Promise; - async cancelTask(parameters: Parameters.CancelTask | string, callback?: Callback): Promise { - const taskId = typeof parameters === 'string' ? parameters : parameters.taskId; - - const config: RequestConfig = { - url: `/rest/api/3/task/${taskId}/cancel`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/timeTracking.mts b/src/version3/timeTracking.mts new file mode 100644 index 0000000000..432321d6b6 --- /dev/null +++ b/src/version3/timeTracking.mts @@ -0,0 +1,169 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class TimeTracking { + constructor(private client: Client) {} + + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback: Callback): Promise; + /** + * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a + * successful but empty response is returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSelectedTimeTrackingImplementation(callback?: never): Promise; + async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters: Parameters.SelectTimeTrackingImplementation | undefined, + callback: Callback, + ): Promise; + /** + * Selects a time tracking provider. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: never, + ): Promise; + async selectTimeTrackingImplementation( + parameters?: Parameters.SelectTimeTrackingImplementation, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking', + method: 'PUT', + data: { + key: parameters?.key, + name: parameters?.name, + url: parameters?.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations( + callback: Callback, + ): Promise; + /** + * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time + * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more + * information on time tracking providers, see the documentation for the [ Time Tracking + * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAvailableTimeTrackingImplementations(callback?: never): Promise; + async getAvailableTimeTrackingImplementations( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking/list', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * 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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback: Callback): Promise; + /** + * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. + * 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:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getSharedTimeTrackingConfiguration(callback?: never): Promise; + async getSharedTimeTrackingConfiguration( + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/configuration/timetracking/options', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the time tracking 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 setSharedTimeTrackingConfiguration( + parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, + callback: Callback, + ): Promise; + /** + * Sets the time tracking 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 setSharedTimeTrackingConfiguration( + parameters?: Parameters.SetSharedTimeTrackingConfiguration, + callback?: never, + ): Promise; + async 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, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/timeTracking.ts b/src/version3/timeTracking.ts deleted file mode 100644 index aaae78b612..0000000000 --- a/src/version3/timeTracking.ts +++ /dev/null @@ -1,169 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class TimeTracking { - constructor(private client: Client) {} - - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback: Callback): Promise; - /** - * Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a - * successful but empty response is returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSelectedTimeTrackingImplementation(callback?: never): Promise; - async getSelectedTimeTrackingImplementation(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters: Parameters.SelectTimeTrackingImplementation | undefined, - callback: Callback, - ): Promise; - /** - * Selects a time tracking provider. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: never, - ): Promise; - async selectTimeTrackingImplementation( - parameters?: Parameters.SelectTimeTrackingImplementation, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking', - method: 'PUT', - data: { - key: parameters?.key, - name: parameters?.name, - url: parameters?.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations( - callback: Callback, - ): Promise; - /** - * Returns all time tracking providers. By default, Jira only has one time tracking provider: _JIRA provided time - * tracking_. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more - * information on time tracking providers, see the documentation for the [ Time Tracking - * Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAvailableTimeTrackingImplementations(callback?: never): Promise; - async getAvailableTimeTrackingImplementations( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking/list', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * 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:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback: Callback): Promise; - /** - * Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. - * 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:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getSharedTimeTrackingConfiguration(callback?: never): Promise; - async getSharedTimeTrackingConfiguration( - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/configuration/timetracking/options', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the time tracking 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 setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, - callback: Callback, - ): Promise; - /** - * Sets the time tracking 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 setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, - callback?: never, - ): Promise; - async 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, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/uIModificationsApps.ts b/src/version3/uIModificationsApps.ts deleted file mode 100644 index 23d0254ffe..0000000000 --- a/src/version3/uIModificationsApps.ts +++ /dev/null @@ -1,171 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class UIModificationsApps { - constructor(private client: Client) {} - - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getUiModifications( - parameters: Parameters.GetUiModifications | undefined, - callback: Callback, - ): Promise; - /** - * Gets UI modifications. UI modifications can only be retrieved by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: never, - ): Promise; - async getUiModifications( - parameters?: Parameters.GetUiModifications, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/uiModifications', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - expand: parameters?.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback: Callback, - ): Promise; - /** - * 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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. - */ - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: never, - ): Promise; - async createUiModification( - parameters: Parameters.CreateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/uiModifications', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. - */ - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback: Callback, - ): Promise; - /** - * Updates a UI modification. UI modification can only be updated by Forge apps. - * - * Each UI modification can define up to 1000 contexts. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. - */ - async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; - async updateUiModification( - parameters: Parameters.UpdateUiModification, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/uiModifications/${parameters.uiModificationId}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, - contexts: parameters.contexts, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback: Callback, - ): Promise; - /** - * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can - * only be deleted by Forge apps. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: never, - ): Promise; - async deleteUiModification( - parameters: Parameters.DeleteUiModification | string, - callback?: Callback, - ): Promise { - const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; - - const config: RequestConfig = { - url: `/rest/api/3/uiModifications/${uiModificationId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/uiModificationsApps.mts b/src/version3/uiModificationsApps.mts new file mode 100644 index 0000000000..b84463e940 --- /dev/null +++ b/src/version3/uiModificationsApps.mts @@ -0,0 +1,171 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UiModificationsApps { + constructor(private client: Client) {} + + /** + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getUiModifications( + parameters: Parameters.GetUiModifications | undefined, + callback: Callback, + ): Promise; + /** + * Gets UI modifications. UI modifications can only be retrieved by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: never, + ): Promise; + async getUiModifications( + parameters?: Parameters.GetUiModifications, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/uiModifications', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback: Callback, + ): Promise; + /** + * 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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. + */ + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: never, + ): Promise; + async createUiModification( + parameters: Parameters.CreateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/uiModifications', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. + */ + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback: Callback, + ): Promise; + /** + * Updates a UI modification. UI modification can only be updated by Forge apps. + * + * Each UI modification can define up to 1000 contexts. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/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. + */ + async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; + async updateUiModification( + parameters: Parameters.UpdateUiModification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/uiModifications/${parameters.uiModificationId}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + data: parameters.data, + contexts: parameters.contexts, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback: Callback, + ): Promise; + /** + * Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can + * only be deleted by Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: never, + ): Promise; + async deleteUiModification( + parameters: Parameters.DeleteUiModification | string, + callback?: Callback, + ): Promise { + const uiModificationId = typeof parameters === 'string' ? parameters : parameters.uiModificationId; + + const config: RequestConfig = { + url: `/rest/api/3/uiModifications/${uiModificationId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/userProperties.mts b/src/version3/userProperties.mts new file mode 100644 index 0000000000..7fa616cae3 --- /dev/null +++ b/src/version3/userProperties.mts @@ -0,0 +1,190 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class UserProperties { + constructor(private client: Client) {} + + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters: Parameters.GetUserPropertyKeys | undefined, + callback: Callback, + ): Promise; + /** + * Returns the keys of all properties for a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on + * any user. + * - Access to Jira, to access the calling user's property keys. + */ + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: never, + ): Promise; + async getUserPropertyKeys( + parameters?: Parameters.GetUserPropertyKeys, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/properties', + method: 'GET', + params: { + accountId: parameters?.accountId, + userKey: parameters?.userKey, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-3-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback: Callback, + ): Promise; + /** + * Returns the value of a user's property. If no property key is provided [Get user property + * keys](#api-rest-api-3-user-properties-get) is called. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. + * - Access to Jira, to get a property from the calling user's record. + */ + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: never, + ): Promise; + async getUserProperty( + parameters: Parameters.GetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/user/properties/${parameters.propertyKey}`, + method: 'GET', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[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 a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; + /** + * Sets the value of a user's property. Use this resource to store custom data against a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[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 a property on any user. + * - Access to Jira, to set a property on the calling user's record. + */ + async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; + async setUserProperty( + parameters: Parameters.SetUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/user/properties/${parameters.propertyKey}`, + method: 'PUT', + params: { + accountId: parameters.accountId, + }, + data: parameters.propertyValue, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; + /** + * Deletes a property from a user. + * + * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and + * maintained in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any + * user. + * - Access to Jira, to delete a property from the calling user's record. + */ + async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; + async deleteUserProperty( + parameters: Parameters.DeleteUserProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/user/properties/${parameters.propertyKey}`, + method: 'DELETE', + params: { + accountId: parameters.accountId, + userKey: parameters.userKey, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/userProperties.ts b/src/version3/userProperties.ts deleted file mode 100644 index a65acc1c60..0000000000 --- a/src/version3/userProperties.ts +++ /dev/null @@ -1,190 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class UserProperties { - constructor(private client: Client) {} - - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters: Parameters.GetUserPropertyKeys | undefined, - callback: Callback, - ): Promise; - /** - * Returns the keys of all properties for a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on - * any user. - * - Access to Jira, to access the calling user's property keys. - */ - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: never, - ): Promise; - async getUserPropertyKeys( - parameters?: Parameters.GetUserPropertyKeys, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/properties', - method: 'GET', - params: { - accountId: parameters?.accountId, - userKey: parameters?.userKey, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-3-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback: Callback, - ): Promise; - /** - * Returns the value of a user's property. If no property key is provided [Get user property - * keys](#api-rest-api-3-user-properties-get) is called. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. - * - Access to Jira, to get a property from the calling user's record. - */ - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: never, - ): Promise; - async getUserProperty( - parameters: Parameters.GetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/user/properties/${parameters.propertyKey}`, - method: 'GET', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[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 a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback: Callback): Promise; - /** - * Sets the value of a user's property. Use this resource to store custom data against a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[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 a property on any user. - * - Access to Jira, to set a property on the calling user's record. - */ - async setUserProperty(parameters: Parameters.SetUserProperty, callback?: never): Promise; - async setUserProperty( - parameters: Parameters.SetUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/user/properties/${parameters.propertyKey}`, - method: 'PUT', - params: { - accountId: parameters.accountId, - }, - data: parameters.propertyValue, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback: Callback): Promise; - /** - * Deletes a property from a user. - * - * Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and - * maintained in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any - * user. - * - Access to Jira, to delete a property from the calling user's record. - */ - async deleteUserProperty(parameters: Parameters.DeleteUserProperty, callback?: never): Promise; - async deleteUserProperty( - parameters: Parameters.DeleteUserProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/user/properties/${parameters.propertyKey}`, - method: 'DELETE', - params: { - accountId: parameters.accountId, - userKey: parameters.userKey, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/userSearch.mts b/src/version3/userSearch.mts new file mode 100644 index 0000000000..7894990629 --- /dev/null +++ b/src/version3/userSearch.mts @@ -0,0 +1,608 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '@/callback.mjs'; +import { Client } from '@/clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import { RequestConfig } from '@/requestConfig.mjs'; + +export class UserSearch { + constructor(private client: Client) {} + + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback: Callback, + ): Promise; + /** + * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users + * whose attributes match a string. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned issues in the projects. This means the operation + * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the + * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: never, + ): Promise; + async findBulkAssignableUsers( + parameters: Parameters.FindBulkAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/assignable/multiProjectSearch', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + projectKeys: parameters.projectKeys, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * 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 + * 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 + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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. + */ + async findAssignableUsers( + parameters: Parameters.FindAssignableUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be + * 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 + * 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 + * returned in the response if they can be assigned to the issue or issue transition. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that can be assigned the issue. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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. + */ + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: never, + ): Promise; + async findAssignableUsers( + parameters?: Parameters.FindAssignableUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/assignable/search', + method: 'GET', + params: { + query: parameters?.query, + sessionId: parameters?.sessionId, + username: parameters?.username, + accountId: parameters?.accountId, + project: parameters?.project, + issueKey: parameters?.issueKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + actionDescriptorId: parameters?.actionDescriptorId, + recommend: parameters?.recommend, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have a set of permissions for a project or issue. + * + * If no search string is provided, a list of all users with the permissions is returned. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission for the project or + * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users + * who match the search string and have permission for the project or issue, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. + * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users + * for that project. + */ + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: never, + ): Promise; + async findUsersWithAllPermissions( + parameters: Parameters.FindUsersWithAllPermissions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/permission/search', + method: 'GET', + params: { + query: parameters.query, + username: parameters.username, + accountId: parameters.accountId, + permissions: parameters.permissions, + issueKey: parameters.issueKey, + projectKey: parameters.projectKey, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback: Callback, + ): Promise; + /** + * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where + * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude + * users from the results. + * + * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns + * only the users from that range that match the query term. This means the operation usually returns fewer users than + * specified in `maxResults`. To get all the users who match the query term, use [Get all + * users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return search results for an exact name match only. + */ + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: never, + ): Promise; + async findUsersForPicker( + parameters: Parameters.FindUsersForPicker, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/picker', + method: 'GET', + params: { + query: parameters.query, + maxResults: parameters.maxResults, + showAvatar: parameters.showAvatar, + excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), + avatarSize: parameters.avatarSize, + excludeConnectUsers: parameters.excludeConnectUsers, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of 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 + * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers( + parameters: Parameters.FindUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of 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 + * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your + * code. + * + * This operation can be accessed anonymously. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users + * without the required permission return empty search results. + */ + async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; + async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + property: parameters?.property, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; + async findUsersByQuery( + parameters: Parameters.FindUsersByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/search/query', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback: Callback, + ): Promise; + /** + * Finds users with a structured query and returns a + * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the structured query. This means the operation usually + * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get + * all users](#api-rest-api-3-users-search-get) and filter the records in your code. + * + * **[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). + * + * The query statements are: + * + * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. + * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. + * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. + * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. + * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. + * - `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. + * + * 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: + * + * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + */ + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: never, + ): Promise; + async findUserKeysByQuery( + parameters: Parameters.FindUserKeysByQuery, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/search/query/key', + method: 'GET', + params: { + query: parameters.query, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters: Parameters.FindUsersWithBrowsePermission | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of users who fulfill these criteria: + * + * - Their user attributes match a search string. + * - They have permission to browse issues. + * + * Use this resource to find users who can browse: + * + * - An issue, by providing the `issueKey`. + * - Any issue in a project, by providing the `projectKey`. + * + * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and + * then returns only the users from that range that match the search string and have permission to browse issues. This + * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the + * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and + * filter the records in your code. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * the user's email address is hidden. See the [Profile visibility + * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. + * + * This operation can be accessed anonymously. + * + * **[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). Anonymous calls and calls by + * users without the required permission return empty search results. + */ + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: never, + ): Promise; + async findUsersWithBrowsePermission( + parameters?: Parameters.FindUsersWithBrowsePermission, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/viewissue/search', + method: 'GET', + params: { + query: parameters?.query, + username: parameters?.username, + accountId: parameters?.accountId, + issueKey: parameters?.issueKey, + projectKey: parameters?.projectKey, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/userSearch.ts b/src/version3/userSearch.ts deleted file mode 100644 index 3c0088dee1..0000000000 --- a/src/version3/userSearch.ts +++ /dev/null @@ -1,608 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class UserSearch { - constructor(private client: Client) {} - - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback: Callback, - ): Promise; - /** - * Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users - * whose attributes match a string. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned issues in the projects. This means the operation - * usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the - * projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: never, - ): Promise; - async findBulkAssignableUsers( - parameters: Parameters.FindBulkAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/assignable/multiProjectSearch', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - projectKeys: parameters.projectKeys, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * 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 - * 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 - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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. - */ - async findAssignableUsers( - parameters: Parameters.FindAssignableUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be - * 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 - * 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 - * returned in the response if they can be assigned to the issue or issue transition. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that can be assigned the issue. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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. - */ - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: never, - ): Promise; - async findAssignableUsers( - parameters?: Parameters.FindAssignableUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/assignable/search', - method: 'GET', - params: { - query: parameters?.query, - sessionId: parameters?.sessionId, - username: parameters?.username, - accountId: parameters?.accountId, - project: parameters?.project, - issueKey: parameters?.issueKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - actionDescriptorId: parameters?.actionDescriptorId, - recommend: parameters?.recommend, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have a set of permissions for a project or issue. - * - * If no search string is provided, a list of all users with the permissions is returned. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission for the project or - * issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users - * who match the search string and have permission for the project or issue, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. - * - _Administer Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users - * for that project. - */ - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: never, - ): Promise; - async findUsersWithAllPermissions( - parameters: Parameters.FindUsersWithAllPermissions, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/permission/search', - method: 'GET', - params: { - query: parameters.query, - username: parameters.username, - accountId: parameters.accountId, - permissions: parameters.permissions, - issueKey: parameters.issueKey, - projectKey: parameters.projectKey, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback: Callback, - ): Promise; - /** - * Returns a list of users whose attributes match the query term. The returned object includes the `html` field where - * the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude - * users from the results. - * - * This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns - * only the users from that range that match the query term. This means the operation usually returns fewer users than - * specified in `maxResults`. To get all the users who match the query term, use [Get all - * users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return search results for an exact name match only. - */ - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: never, - ): Promise; - async findUsersForPicker( - parameters: Parameters.FindUsersForPicker, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/picker', - method: 'GET', - params: { - query: parameters.query, - maxResults: parameters.maxResults, - showAvatar: parameters.showAvatar, - excludeAccountIds: paramSerializer('excludeAccountIds', parameters.excludeAccountIds), - avatarSize: parameters.avatarSize, - excludeConnectUsers: parameters.excludeConnectUsers, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of 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 - * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers( - parameters: Parameters.FindUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of 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 - * search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your - * code. - * - * This operation can be accessed anonymously. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users - * without the required permission return empty search results. - */ - async findUsers(parameters?: Parameters.FindUsers, callback?: never): Promise; - async findUsers(parameters?: Parameters.FindUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - property: parameters?.property, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user details. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUsersByQuery(parameters: Parameters.FindUsersByQuery, callback?: never): Promise; - async findUsersByQuery( - parameters: Parameters.FindUsersByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/search/query', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback: Callback, - ): Promise; - /** - * Finds users with a structured query and returns a - * [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of user keys. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the structured query. This means the operation usually - * returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get - * all users](#api-rest-api-3-users-search-get) and filter the records in your code. - * - * **[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). - * - * The query statements are: - * - * - `is assignee of PROJ` Returns the users that are assignees of at least one issue in project _PROJ_. - * - `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues _PROJ-1_ or _PROJ-2_. - * - `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues _PROJ-1_ or _PROJ-2_. - * - `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues _PROJ-1_ or _PROJ-2_. - * - `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues _PROJ-1_ or _PROJ-2_. - * - `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. - * - * 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: - * - * `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` - */ - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: never, - ): Promise; - async findUserKeysByQuery( - parameters: Parameters.FindUserKeysByQuery, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/search/query/key', - method: 'GET', - params: { - query: parameters.query, - startAt: parameters.startAt, - maxResults: parameters.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters: Parameters.FindUsersWithBrowsePermission | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of users who fulfill these criteria: - * - * - Their user attributes match a search string. - * - They have permission to browse issues. - * - * Use this resource to find users who can browse: - * - * - An issue, by providing the `issueKey`. - * - Any issue in a project, by providing the `projectKey`. - * - * This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and - * then returns only the users from that range that match the search string and have permission to browse issues. This - * means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the - * search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and - * filter the records in your code. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * the user's email address is hidden. See the [Profile visibility - * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. - * - * This operation can be accessed anonymously. - * - * **[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). Anonymous calls and calls by - * users without the required permission return empty search results. - */ - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: never, - ): Promise; - async findUsersWithBrowsePermission( - parameters?: Parameters.FindUsersWithBrowsePermission, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/viewissue/search', - method: 'GET', - params: { - query: parameters?.query, - username: parameters?.username, - accountId: parameters?.accountId, - issueKey: parameters?.issueKey, - projectKey: parameters?.projectKey, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/users.mts b/src/version3/users.mts new file mode 100644 index 0000000000..0931d968e5 --- /dev/null +++ b/src/version3/users.mts @@ -0,0 +1,493 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '@/paramSerializer.mjs'; +import { RequestConfig } from '@/requestConfig.mjs'; + +export class Users { + constructor(private client: Client) {} + + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + /** + * Returns a user. + * + * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that + * 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:** _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 { + const config: RequestConfig = { + url: '/rest/api/3/user', + method: 'GET', + params: { + accountId: parameters?.accountId, + expand: parameters?.expand, + key: parameters?.key, + username: parameters?.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; + /** + * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is + * available this resource will be deprecated. + * + * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have + * access to Jira, the operation returns a 400 status. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; + async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user', + method: 'POST', + data: { + emailAddress: parameters.emailAddress, + products: parameters.products + ? parameters.products + : ['jira-core', 'jira-servicedesk', 'jira-product-discovery', 'jira-software'], + self: parameters.self, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; + /** + * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This + * operation does not delete the user's Atlassian account. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site + * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). + */ + async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; + async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user', + method: 'DELETE', + params: { + accountId: parameters.accountId, + key: parameters.key, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * users specified by one or more account IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; + async bulkGetUsers( + parameters: Parameters.BulkGetUsers, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/bulk', + method: 'GET', + params: { + accountId: paramSerializer('accountId', parameters.accountId), + maxResults: parameters.maxResults, + startAt: parameters.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback: Callback, + ): Promise; + /** + * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or + * `username` parameters can be specified. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: never, + ): Promise; + async bulkGetUsersMigration( + parameters: Parameters.BulkGetUsersMigration, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/bulk/migration', + method: 'GET', + params: { + key: paramSerializer('key', parameters.key), + maxResults: parameters.maxResults, + startAt: parameters.startAt, + username: paramSerializer('username', parameters.username), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters: Parameters.GetUserDefaultColumns | undefined, + callback: Callback, + ): Promise; + /** + * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` + * is not passed in the request, the calling user's details are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for + * any user. + * - Permission to access Jira, to get the calling user's column details. + */ + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: never, + ): Promise; + async getUserDefaultColumns( + parameters?: Parameters.GetUserDefaultColumns, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/columns', + method: 'GET', + params: { + accountId: parameters?.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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 | undefined, + 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 { + const config: RequestConfig = { + url: '/rest/api/3/user/columns', + method: 'PUT', + params: { + accountId: parameters?.accountId, + }, + data: parameters?.columns, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; + /** + * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system + * default. If `accountId` is not passed, the calling user's default columns are reset. + * + * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; + async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/columns', + method: 'DELETE', + params: { + accountId: parameters.accountId, + username: parameters.username, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. 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). + */ + 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 + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: never, + ): Promise; + async getUserEmail( + parameters: Parameters.GetUserEmail | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/3/user/email', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a user's email address. 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). + */ + 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 + * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + */ + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: never, + ): Promise; + async getUserEmailBulk( + parameters: Parameters.GetUserEmailBulk | string, + callback?: Callback, + ): Promise { + const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; + + const config: RequestConfig = { + url: '/rest/api/3/user/email/bulk', + method: 'GET', + params: { + accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the groups to which a user belongs. + * + * **[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 getUserGroups( + parameters: Parameters.GetUserGroups, + callback: Callback, + ): Promise; + /** + * Returns the groups to which a user belongs. + * + * **[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 getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; + async getUserGroups( + parameters: Parameters.GetUserGroups, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/user/groups', + method: 'GET', + params: { + accountId: parameters.accountId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault( + parameters: Parameters.GetAllUsersDefault | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; + async getAllUsersDefault( + parameters?: Parameters.GetAllUsersDefault, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/users', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers( + parameters: Parameters.GetAllUsers | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of all users, including active users, inactive users and previously deleted users that have an + * Atlassian account. + * + * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that + * 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:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; + async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/users/search', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/users.ts b/src/version3/users.ts deleted file mode 100644 index bdbfc46c98..0000000000 --- a/src/version3/users.ts +++ /dev/null @@ -1,493 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class Users { - constructor(private client: Client) {} - - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; - /** - * Returns a user. - * - * Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that - * 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:** _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 { - const config: RequestConfig = { - url: '/rest/api/3/user', - method: 'GET', - params: { - accountId: parameters?.accountId, - expand: parameters?.expand, - key: parameters?.key, - username: parameters?.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback: Callback): Promise; - /** - * Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is - * available this resource will be deprecated. - * - * If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have - * access to Jira, the operation returns a 400 status. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createUser(parameters: Parameters.CreateUser, callback?: never): Promise; - async createUser(parameters: Parameters.CreateUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user', - method: 'POST', - data: { - emailAddress: parameters.emailAddress, - products: parameters.products - ? parameters.products - : ['jira-core', 'jira-servicedesk', 'jira-product-discovery', 'jira-software'], - self: parameters.self, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback: Callback): Promise; - /** - * Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This - * operation does not delete the user's Atlassian account. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Site - * administration (that is, membership of the _site-admin_ [group](https://confluence.atlassian.com/x/24xjL)). - */ - async removeUser(parameters: Parameters.RemoveUser, callback?: never): Promise; - async removeUser(parameters: Parameters.RemoveUser, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user', - method: 'DELETE', - params: { - accountId: parameters.accountId, - key: parameters.key, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback: Callback): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * users specified by one or more account IDs. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsers(parameters: Parameters.BulkGetUsers, callback?: never): Promise; - async bulkGetUsers( - parameters: Parameters.BulkGetUsers, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/bulk', - method: 'GET', - params: { - accountId: paramSerializer('accountId', parameters.accountId), - maxResults: parameters.maxResults, - startAt: parameters.startAt, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback: Callback, - ): Promise; - /** - * Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or - * `username` parameters can be specified. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: never, - ): Promise; - async bulkGetUsersMigration( - parameters: Parameters.BulkGetUsersMigration, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/bulk/migration', - method: 'GET', - params: { - key: paramSerializer('key', parameters.key), - maxResults: parameters.maxResults, - startAt: parameters.startAt, - username: paramSerializer('username', parameters.username), - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters: Parameters.GetUserDefaultColumns | undefined, - callback: Callback, - ): Promise; - /** - * Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` - * is not passed in the request, the calling user's details are returned. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * - * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for - * any user. - * - Permission to access Jira, to get the calling user's column details. - */ - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: never, - ): Promise; - async getUserDefaultColumns( - parameters?: Parameters.GetUserDefaultColumns, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/columns', - method: 'GET', - params: { - accountId: parameters?.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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 | undefined, - 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 { - const config: RequestConfig = { - url: '/rest/api/3/user/columns', - method: 'PUT', - params: { - accountId: parameters?.accountId, - }, - data: parameters?.columns, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback: Callback): Promise; - /** - * Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system - * default. If `accountId` is not passed, the calling user's default columns are reset. - * - * **[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 resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: never): Promise; - async resetUserColumns(parameters: Parameters.ResetUserColumns, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/columns', - method: 'DELETE', - params: { - accountId: parameters.accountId, - username: parameters.username, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. 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). - */ - 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 - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: never, - ): Promise; - async getUserEmail( - parameters: Parameters.GetUserEmail | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/3/user/email', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a user's email address. 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). - */ - 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 - * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). - */ - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: never, - ): Promise; - async getUserEmailBulk( - parameters: Parameters.GetUserEmailBulk | string, - callback?: Callback, - ): Promise { - const accountId = typeof parameters === 'string' ? parameters : parameters.accountId; - - const config: RequestConfig = { - url: '/rest/api/3/user/email/bulk', - method: 'GET', - params: { - accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the groups to which a user belongs. - * - * **[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 getUserGroups( - parameters: Parameters.GetUserGroups, - callback: Callback, - ): Promise; - /** - * Returns the groups to which a user belongs. - * - * **[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 getUserGroups(parameters: Parameters.GetUserGroups, callback?: never): Promise; - async getUserGroups( - parameters: Parameters.GetUserGroups, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/user/groups', - method: 'GET', - params: { - accountId: parameters.accountId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault( - parameters: Parameters.GetAllUsersDefault | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsersDefault(parameters?: Parameters.GetAllUsersDefault, callback?: never): Promise; - async getAllUsersDefault( - parameters?: Parameters.GetAllUsersDefault, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/users', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - startAt: parameters?.startAt, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers( - parameters: Parameters.GetAllUsers | undefined, - callback: Callback, - ): Promise; - /** - * Returns a list of all users, including active users, inactive users and previously deleted users that have an - * Atlassian account. - * - * Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that - * 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:** _Browse - * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: never): Promise; - async getAllUsers(parameters?: Parameters.GetAllUsers, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/users/search', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - startAt: parameters?.startAt, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/webhooks.mts b/src/version3/webhooks.mts new file mode 100644 index 0000000000..42599e7c25 --- /dev/null +++ b/src/version3/webhooks.mts @@ -0,0 +1,221 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class Webhooks { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters: Parameters.GetDynamicWebhooksForApp | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the + * webhooks registered by the calling app. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: never, + ): Promise; + async getDynamicWebhooksForApp( + parameters?: Parameters.GetDynamicWebhooksForApp, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback: Callback, + ): Promise; + /** + * Registers webhooks. + * + * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the + * user who registered a dynamic webhook. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: never, + ): Promise; + async registerDynamicWebhooks( + parameters: Parameters.RegisterDynamicWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook', + method: 'POST', + data: { + webhooks: parameters.webhooks, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; + /** + * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps + * are specified, they are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; + async deleteWebhookById( + parameters: Parameters.DeleteWebhookById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook', + method: 'DELETE', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters: Parameters.GetFailedWebhooks | undefined, + callback: Callback, + ): Promise; + /** + * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of + * retries. + * + * After 72 hours the failure may no longer be returned by this operation. + * + * The oldest failure is returned first. + * + * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on + * the list as the `failedAfter` value or use the URL provided in `next`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + */ + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: never, + ): Promise; + async getFailedWebhooks( + parameters?: Parameters.GetFailedWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook/failed', + method: 'GET', + params: { + maxResults: parameters?.maxResults, + after: parameters?.after, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback: Callback, + ): Promise; + /** + * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to + * keep them alive. + * + * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth + * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + */ + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: never, + ): Promise; + async refreshWebhooks( + parameters: Parameters.RefreshWebhooks, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/webhook/refresh', + method: 'PUT', + data: { + webhookIds: parameters.webhookIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/webhooks.ts b/src/version3/webhooks.ts deleted file mode 100644 index 64d597fbc9..0000000000 --- a/src/version3/webhooks.ts +++ /dev/null @@ -1,221 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class Webhooks { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters: Parameters.GetDynamicWebhooksForApp | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of the - * webhooks registered by the calling app. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: never, - ): Promise; - async getDynamicWebhooksForApp( - parameters?: Parameters.GetDynamicWebhooksForApp, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback: Callback, - ): Promise; - /** - * Registers webhooks. - * - * **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the - * user who registered a dynamic webhook. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: never, - ): Promise; - async registerDynamicWebhooks( - parameters: Parameters.RegisterDynamicWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook', - method: 'POST', - data: { - webhooks: parameters.webhooks, - url: parameters.url, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback: Callback): Promise; - /** - * Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps - * are specified, they are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async deleteWebhookById(parameters: Parameters.DeleteWebhookById, callback?: never): Promise; - async deleteWebhookById( - parameters: Parameters.DeleteWebhookById, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook', - method: 'DELETE', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters: Parameters.GetFailedWebhooks | undefined, - callback: Callback, - ): Promise; - /** - * Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of - * retries. - * - * After 72 hours the failure may no longer be returned by this operation. - * - * The oldest failure is returned first. - * - * This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on - * the list as the `failedAfter` value or use the URL provided in `next`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. - */ - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: never, - ): Promise; - async getFailedWebhooks( - parameters?: Parameters.GetFailedWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook/failed', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - after: parameters?.after, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback: Callback, - ): Promise; - /** - * Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to - * keep them alive. - * - * Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth - * 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. - */ - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: never, - ): Promise; - async refreshWebhooks( - parameters: Parameters.RefreshWebhooks, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/webhook/refresh', - method: 'PUT', - data: { - webhookIds: parameters.webhookIds, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowSchemeDrafts.mts b/src/version3/workflowSchemeDrafts.mts new file mode 100644 index 0000000000..88d8ec6e34 --- /dev/null +++ b/src/version3/workflowSchemeDrafts.mts @@ -0,0 +1,542 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeDrafts { + constructor(private client: Client) {} + + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback: Callback, + ): Promise; + /** + * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an + * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: never, + ): Promise; + async createWorkflowSchemeDraftFromParent( + parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/createdraft`, + method: 'POST', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * 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: + * + * - Only active workflow schemes can have draft workflow schemes. + * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async getWorkflowSchemeDraft( + parameters: Parameters.GetWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback: Callback, + ): Promise; + /** + * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a + * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: never, + ): Promise; + async updateWorkflowSchemeDraft( + parameters: Parameters.UpdateWorkflowSchemeDraft, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback: Callback, + ): Promise; + /** + * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraft( + parameters: Parameters.DeleteWorkflowSchemeDraft | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned + * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue + * Types_ listed in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDraftDefaultWorkflow( + parameters: Parameters.GetDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: never, + ): Promise; + async updateDraftDefaultWorkflow( + parameters: Parameters.UpdateDraftDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/default`, + method: 'PUT', + data: { + workflow: parameters.workflow, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system + * workflow (the _jira_ workflow). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDraftDefaultWorkflow( + parameters: Parameters.DeleteDraftDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeDraftIssueType( + parameters: Parameters.GetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeDraftIssueType( + parameters: Parameters.SetWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeDraftIssueType( + parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * 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 + * `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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Publishes a draft workflow scheme. + * + * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues + * 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 + * `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. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: never, + ): Promise; + async publishDraftWorkflowScheme( + parameters: Parameters.PublishDraftWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/draft/publish`, + method: 'POST', + params: { + validateOnly: typeof parameters !== 'string' && parameters.validateOnly, + }, + data: { + statusMappings: typeof parameters !== 'string' && parameters.statusMappings, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: never, + ): Promise; + async getDraftWorkflow( + parameters: Parameters.GetDraftWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, + method: 'GET', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default + * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: never, + ): Promise; + async updateDraftWorkflowMapping( + parameters: Parameters.UpdateDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + workflow: parameters.workflow, + issueTypes: parameters.issueTypes, + defaultMapping: parameters.defaultMapping, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: never, + ): Promise; + async deleteDraftWorkflowMapping( + parameters: Parameters.DeleteDraftWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, + method: 'DELETE', + params: { + workflowName: parameters.workflowName, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowSchemeDrafts.ts b/src/version3/workflowSchemeDrafts.ts deleted file mode 100644 index 9472a21faa..0000000000 --- a/src/version3/workflowSchemeDrafts.ts +++ /dev/null @@ -1,542 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowSchemeDrafts { - constructor(private client: Client) {} - - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback: Callback, - ): Promise; - /** - * Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an - * active workflow scheme can only have one draft workflow 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 createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: never, - ): Promise; - async createWorkflowSchemeDraftFromParent( - parameters: Parameters.CreateWorkflowSchemeDraftFromParent | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/createdraft`, - method: 'POST', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * 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: - * - * - Only active workflow schemes can have draft workflow schemes. - * - An active workflow scheme can only have one draft workflow 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 getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async getWorkflowSchemeDraft( - parameters: Parameters.GetWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback: Callback, - ): Promise; - /** - * Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a - * draft is created. Note that an active workflow scheme can only have one draft workflow 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 updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: never, - ): Promise; - async updateWorkflowSchemeDraft( - parameters: Parameters.UpdateWorkflowSchemeDraft, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback: Callback, - ): Promise; - /** - * Deletes a draft workflow 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 deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraft( - parameters: Parameters.DeleteWorkflowSchemeDraft | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned - * any issue types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue - * Types_ listed in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDraftDefaultWorkflow( - parameters: Parameters.GetDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft/default`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: never, - ): Promise; - async updateDraftDefaultWorkflow( - parameters: Parameters.UpdateDraftDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/default`, - method: 'PUT', - data: { - workflow: parameters.workflow, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system - * workflow (the _jira_ workflow). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDraftDefaultWorkflow( - parameters: Parameters.DeleteDraftDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft/default`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeDraftIssueType( - parameters: Parameters.GetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeDraftIssueType( - parameters: Parameters.SetWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeDraftIssueType( - parameters: Parameters.DeleteWorkflowSchemeDraftIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/issuetype/${parameters.issueType}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * 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 - * `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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Publishes a draft workflow scheme. - * - * Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues - * 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 - * `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. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: never, - ): Promise; - async publishDraftWorkflowScheme( - parameters: Parameters.PublishDraftWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/draft/publish`, - method: 'POST', - params: { - validateOnly: typeof parameters !== 'string' && parameters.validateOnly, - }, - data: { - statusMappings: typeof parameters !== 'string' && parameters.statusMappings, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: never, - ): Promise; - async getDraftWorkflow( - parameters: Parameters.GetDraftWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, - method: 'GET', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default - * workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: never, - ): Promise; - async updateDraftWorkflowMapping( - parameters: Parameters.UpdateDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, - defaultMapping: parameters.defaultMapping, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: never, - ): Promise; - async deleteDraftWorkflowMapping( - parameters: Parameters.DeleteDraftWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/draft/workflow`, - method: 'DELETE', - params: { - workflowName: parameters.workflowName, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowSchemeProjectAssociations.mts b/src/version3/workflowSchemeProjectAssociations.mts new file mode 100644 index 0000000000..63fa4a4b87 --- /dev/null +++ b/src/version3/workflowSchemeProjectAssociations.mts @@ -0,0 +1,91 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemeProjectAssociations { + constructor(private client: Client) {} + + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback: Callback, + ): Promise; + /** + * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a + * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are + * ignored and no errors are returned. + * + * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the + * `Default Workflow Scheme` is stored means it has no ID. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: never, + ): Promise; + async getWorkflowSchemeProjectAssociations( + parameters: Parameters.GetWorkflowSchemeProjectAssociations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/project', + method: 'GET', + params: { + projectId: parameters.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[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 | undefined, + callback: Callback, + ): Promise; + /** + * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. + * + * Workflow schemes can only be assigned to classic projects. + * + * **[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?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/project', + method: 'PUT', + data: { + workflowSchemeId: parameters?.workflowSchemeId, + projectId: parameters?.projectId, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowSchemeProjectAssociations.ts b/src/version3/workflowSchemeProjectAssociations.ts deleted file mode 100644 index 8c1596f10f..0000000000 --- a/src/version3/workflowSchemeProjectAssociations.ts +++ /dev/null @@ -1,91 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowSchemeProjectAssociations { - constructor(private client: Client) {} - - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback: Callback, - ): Promise; - /** - * Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a - * list of the requested projects associated with it. Any team-managed or non-existent projects in the request are - * ignored and no errors are returned. - * - * If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the - * `Default Workflow Scheme` is stored means it has no ID. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: never, - ): Promise; - async getWorkflowSchemeProjectAssociations( - parameters: Parameters.GetWorkflowSchemeProjectAssociations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme/project', - method: 'GET', - params: { - projectId: parameters.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[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 | undefined, - callback: Callback, - ): Promise; - /** - * Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. - * - * Workflow schemes can only be assigned to classic projects. - * - * **[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?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme/project', - method: 'PUT', - data: { - workflowSchemeId: parameters?.workflowSchemeId, - projectId: parameters?.projectId, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowSchemes.mts b/src/version3/workflowSchemes.mts new file mode 100644 index 0000000000..b067f50b14 --- /dev/null +++ b/src/version3/workflowSchemes.mts @@ -0,0 +1,596 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowSchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters: Parameters.GetAllWorkflowSchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * workflow schemes, not including draft workflow schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: never, + ): Promise; + async getAllWorkflowSchemes( + parameters?: Parameters.GetAllWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a workflow 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 createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback: Callback, + ): Promise; + /** + * Creates a workflow 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 createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: never, + ): Promise; + async createWorkflowScheme( + parameters: Parameters.CreateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme', + method: 'POST', + data: { + id: parameters.id, + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + 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 workflow 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 getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Returns a workflow 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 getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: never, + ): Promise; + async getWorkflowScheme( + parameters: Parameters.GetWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * 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`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + 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`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: never, + ): Promise; + async updateWorkflowScheme( + parameters: Parameters.UpdateWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}`, + method: 'PUT', + data: { + name: parameters.name, + description: parameters.description, + defaultWorkflow: parameters.defaultWorkflow, + issueTypeMappings: parameters.issueTypeMappings, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at + * least one project). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: never, + ): Promise; + async deleteWorkflowScheme( + parameters: Parameters.DeleteWorkflowScheme | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue + * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed + * in its issue types for the workflow scheme in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: never, + ): Promise; + async getDefaultWorkflow( + parameters: Parameters.GetDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/default`, + method: 'GET', + params: { + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback: Callback, + ): Promise; + /** + * Sets the default workflow for a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The + * draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: never, + ): Promise; + async updateDefaultWorkflow( + parameters: Parameters.UpdateDefaultWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/default`, + method: 'PUT', + data: { + workflow: parameters.workflow, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback: Callback, + ): Promise; + /** + * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow + * (the _jira_ workflow). + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme + * can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: never, + ): Promise; + async deleteDefaultWorkflow( + parameters: Parameters.DeleteDefaultWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/default`, + method: 'DELETE', + params: { + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async getWorkflowSchemeIssueType( + parameters: Parameters.GetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'GET', + params: { + returnDraftIfExists: parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Sets the workflow for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow + * mapping. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async setWorkflowSchemeIssueType( + parameters: Parameters.SetWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'PUT', + data: parameters.details, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback: Callback, + ): Promise; + /** + * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: never, + ): Promise; + async deleteWorkflowSchemeIssueType( + parameters: Parameters.DeleteWorkflowSchemeIssueType, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, + method: 'DELETE', + params: { + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback: Callback, + ): Promise; + /** + * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: never, + ): Promise; + async getWorkflow( + parameters: Parameters.GetWorkflow | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/workflow`, + method: 'GET', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback: Callback, + ): Promise; + /** + * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for + * the workflow scheme. Unmapped issues types are mapped to the default workflow. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types + * mappings. The draft workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: never, + ): Promise; + async updateWorkflowMapping( + parameters: Parameters.UpdateWorkflowMapping, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.id}/workflow`, + method: 'PUT', + params: { + workflowName: parameters.workflowName, + }, + data: { + workflow: parameters.workflow, + issueTypes: parameters.issueTypes, + defaultMapping: parameters.defaultMapping, + updateDraftIfNeeded: parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback: Callback, + ): Promise; + /** + * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. + * + * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to + * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft + * workflow scheme can be published in Jira. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: never, + ): Promise; + async deleteWorkflowMapping( + parameters: Parameters.DeleteWorkflowMapping | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${id}/workflow`, + method: 'DELETE', + params: { + workflowName: typeof parameters !== 'string' && parameters.workflowName, + updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowSchemes.ts b/src/version3/workflowSchemes.ts deleted file mode 100644 index d5d083cd1d..0000000000 --- a/src/version3/workflowSchemes.ts +++ /dev/null @@ -1,596 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowSchemes { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters: Parameters.GetAllWorkflowSchemes | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all - * workflow schemes, not including draft workflow schemes. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: never, - ): Promise; - async getAllWorkflowSchemes( - parameters?: Parameters.GetAllWorkflowSchemes, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Creates a workflow 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 createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback: Callback, - ): Promise; - /** - * Creates a workflow 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 createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: never, - ): Promise; - async createWorkflowScheme( - parameters: Parameters.CreateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflowscheme', - method: 'POST', - data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - 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 workflow 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 getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Returns a workflow 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 getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: never, - ): Promise; - async getWorkflowScheme( - parameters: Parameters.GetWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * 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`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - 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`. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: never, - ): Promise; - async updateWorkflowScheme( - parameters: Parameters.UpdateWorkflowScheme, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}`, - method: 'PUT', - data: { - name: parameters.name, - description: parameters.description, - defaultWorkflow: parameters.defaultWorkflow, - issueTypeMappings: parameters.issueTypeMappings, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at - * least one project). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: never, - ): Promise; - async deleteWorkflowScheme( - parameters: Parameters.DeleteWorkflowScheme | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue - * types that have not been mapped to any other workflow. The default workflow has _All Unassigned Issue Types_ listed - * in its issue types for the workflow scheme in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: never, - ): Promise; - async getDefaultWorkflow( - parameters: Parameters.GetDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/default`, - method: 'GET', - params: { - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback: Callback, - ): Promise; - /** - * Sets the default workflow for a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The - * draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: never, - ): Promise; - async updateDefaultWorkflow( - parameters: Parameters.UpdateDefaultWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/default`, - method: 'PUT', - data: { - workflow: parameters.workflow, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback: Callback, - ): Promise; - /** - * Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow - * (the _jira_ workflow). - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme - * can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: never, - ): Promise; - async deleteDefaultWorkflow( - parameters: Parameters.DeleteDefaultWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/default`, - method: 'DELETE', - params: { - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Returns the issue type-workflow mapping for an issue type in a workflow 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 getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async getWorkflowSchemeIssueType( - parameters: Parameters.GetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'GET', - params: { - returnDraftIfExists: parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Sets the workflow for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow - * mapping. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async setWorkflowSchemeIssueType( - parameters: Parameters.SetWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'PUT', - data: parameters.details, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback: Callback, - ): Promise; - /** - * Deletes the issue type-workflow mapping for an issue type in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: never, - ): Promise; - async deleteWorkflowSchemeIssueType( - parameters: Parameters.DeleteWorkflowSchemeIssueType, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/issuetype/${parameters.issueType}`, - method: 'DELETE', - params: { - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback: Callback, - ): Promise; - /** - * Returns the workflow-issue type mappings for a workflow 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 getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: never, - ): Promise; - async getWorkflow( - parameters: Parameters.GetWorkflow | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/workflow`, - method: 'GET', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - returnDraftIfExists: typeof parameters !== 'string' && parameters.returnDraftIfExists, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback: Callback, - ): Promise; - /** - * Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for - * the workflow scheme. Unmapped issues types are mapped to the default workflow. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types - * mappings. The draft workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: never, - ): Promise; - async updateWorkflowMapping( - parameters: Parameters.UpdateWorkflowMapping, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${parameters.id}/workflow`, - method: 'PUT', - params: { - workflowName: parameters.workflowName, - }, - data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, - defaultMapping: parameters.defaultMapping, - updateDraftIfNeeded: parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback: Callback, - ): Promise; - /** - * Deletes the workflow-issue type mapping for a workflow in a workflow scheme. - * - * Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to - * `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft - * workflow scheme can be published in Jira. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: never, - ): Promise; - async deleteWorkflowMapping( - parameters: Parameters.DeleteWorkflowMapping | string, - callback?: Callback, - ): Promise { - const id = typeof parameters === 'string' ? parameters : parameters.id; - - const config: RequestConfig = { - url: `/rest/api/3/workflowscheme/${id}/workflow`, - method: 'DELETE', - params: { - workflowName: typeof parameters !== 'string' && parameters.workflowName, - updateDraftIfNeeded: typeof parameters !== 'string' && parameters.updateDraftIfNeeded, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowStatusCategories.mts b/src/version3/workflowStatusCategories.mts new file mode 100644 index 0000000000..a0eb01c9f6 --- /dev/null +++ b/src/version3/workflowStatusCategories.mts @@ -0,0 +1,68 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatusCategories { + constructor(private client: Client) {} + + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback: Callback): Promise; + /** + * Returns a list of all status categories. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategories(callback?: never): Promise; + async getStatusCategories(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/statuscategory', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-3-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback: Callback, + ): Promise; + /** + * Returns a status category. Status categories provided a mechanism for categorizing + * [statuses](#api-rest-api-3-status-idOrName-get). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: never, + ): Promise; + async getStatusCategory( + parameters: Parameters.GetStatusCategory | string, + callback?: Callback, + ): Promise { + const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; + + const config: RequestConfig = { + url: `/rest/api/3/statuscategory/${idOrKey}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowStatusCategories.ts b/src/version3/workflowStatusCategories.ts deleted file mode 100644 index 261b9b4d63..0000000000 --- a/src/version3/workflowStatusCategories.ts +++ /dev/null @@ -1,68 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowStatusCategories { - constructor(private client: Client) {} - - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback: Callback): Promise; - /** - * Returns a list of all status categories. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategories(callback?: never): Promise; - async getStatusCategories(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/statuscategory', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-3-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback: Callback, - ): Promise; - /** - * Returns a status category. Status categories provided a mechanism for categorizing - * [statuses](#api-rest-api-3-status-idOrName-get). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. - */ - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: never, - ): Promise; - async getStatusCategory( - parameters: Parameters.GetStatusCategory | string, - callback?: Callback, - ): Promise { - const idOrKey = typeof parameters === 'string' ? parameters : parameters.idOrKey; - - const config: RequestConfig = { - url: `/rest/api/3/statuscategory/${idOrKey}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowStatuses.mts b/src/version3/workflowStatuses.mts new file mode 100644 index 0000000000..94c8bee6a8 --- /dev/null +++ b/src/version3/workflowStatuses.mts @@ -0,0 +1,73 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowStatuses { + constructor(private client: Client) {} + + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getStatuses(callback: Callback): Promise; + /** + * Returns a list of all statuses associated with active workflows. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getStatuses(callback?: never): Promise; + async getStatuses(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/status', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. + */ + async getStatus( + parameters: Parameters.GetStatus | string, + callback: Callback, + ): Promise; + /** + * Returns a status. The status must be associated with an active workflow to be returned. + * + * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the + * status by its ID may be preferable. + * + * This operation can be accessed anonymously. + * + * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. + */ + async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; + async getStatus( + parameters: Parameters.GetStatus | string, + callback?: Callback, + ): Promise { + const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; + + const config: RequestConfig = { + url: `/rest/api/3/status/${idOrName}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowStatuses.ts b/src/version3/workflowStatuses.ts deleted file mode 100644 index d65c6f16de..0000000000 --- a/src/version3/workflowStatuses.ts +++ /dev/null @@ -1,73 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowStatuses { - constructor(private client: Client) {} - - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getStatuses(callback: Callback): Promise; - /** - * Returns a list of all statuses associated with active workflows. - * - * This operation can be accessed anonymously. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. - */ - async getStatuses(callback?: never): Promise; - async getStatuses(callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/api/3/status', - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. - */ - async getStatus( - parameters: Parameters.GetStatus | string, - callback: Callback, - ): Promise; - /** - * Returns a status. The status must be associated with an active workflow to be returned. - * - * If a name is used on more than one status, only the status found first is returned. Therefore, identifying the - * status by its ID may be preferable. - * - * This operation can be accessed anonymously. - * - * [Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required: None. - */ - async getStatus(parameters: Parameters.GetStatus | string, callback?: never): Promise; - async getStatus( - parameters: Parameters.GetStatus | string, - callback?: Callback, - ): Promise { - const idOrName = typeof parameters === 'string' ? parameters : parameters.idOrName; - - const config: RequestConfig = { - url: `/rest/api/3/status/${idOrName}`, - method: 'GET', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowTransitionProperties.mts b/src/version3/workflowTransitionProperties.mts new file mode 100644 index 0000000000..92dd5b474e --- /dev/null +++ b/src/version3/workflowTransitionProperties.mts @@ -0,0 +1,198 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionProperties { + constructor(private client: Client) {} + + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback: Callback, + ): Promise; + /** + * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: never, + ): Promise; + async getWorkflowTransitionProperties( + parameters: Parameters.GetWorkflowTransitionProperties, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'GET', + params: { + includeReservedKeys: parameters.includeReservedKeys, + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. + * For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async createWorkflowTransitionProperty( + parameters: Parameters.CreateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'POST', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Updates a workflow transition by changing the property value. Trying to update a property that does not exist + * results in a new property being added to the transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: never, + ): Promise; + async updateWorkflowTransitionProperty( + parameters: Parameters.UpdateWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'PUT', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + data: { + ...parameters, + transitionId: undefined, + key: undefined, + workflowName: undefined, + workflowMode: undefined, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback: Callback, + ): Promise; + /** + * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a + * transition. For more information, see [Transition + * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and + * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: never, + ): Promise; + async deleteWorkflowTransitionProperty( + parameters: Parameters.DeleteWorkflowTransitionProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, + method: 'DELETE', + params: { + key: parameters.key, + workflowName: parameters.workflowName, + workflowMode: parameters.workflowMode, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowTransitionProperties.ts b/src/version3/workflowTransitionProperties.ts deleted file mode 100644 index 4305996be4..0000000000 --- a/src/version3/workflowTransitionProperties.ts +++ /dev/null @@ -1,198 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowTransitionProperties { - constructor(private client: Client) {} - - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback: Callback, - ): Promise; - /** - * Returns the properties on a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: never, - ): Promise; - async getWorkflowTransitionProperties( - parameters: Parameters.GetWorkflowTransitionProperties, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'GET', - params: { - includeReservedKeys: parameters.includeReservedKeys, - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. - * For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async createWorkflowTransitionProperty( - parameters: Parameters.CreateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'POST', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Updates a workflow transition by changing the property value. Trying to update a property that does not exist - * results in a new property being added to the transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: never, - ): Promise; - async updateWorkflowTransitionProperty( - parameters: Parameters.UpdateWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'PUT', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - data: { - ...parameters, - transitionId: undefined, - key: undefined, - workflowName: undefined, - workflowMode: undefined, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback: Callback, - ): Promise; - /** - * Deletes a property from a workflow transition. Transition properties are used to change the behavior of a - * transition. For more information, see [Transition - * properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and - * [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: never, - ): Promise; - async deleteWorkflowTransitionProperty( - parameters: Parameters.DeleteWorkflowTransitionProperty, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: `/rest/api/3/workflow/transitions/${parameters.transitionId}/properties`, - method: 'DELETE', - params: { - key: parameters.key, - workflowName: parameters.workflowName, - workflowMode: parameters.workflowMode, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflowTransitionRules.mts b/src/version3/workflowTransitionRules.mts new file mode 100644 index 0000000000..9bf5c4c11d --- /dev/null +++ b/src/version3/workflowTransitionRules.mts @@ -0,0 +1,189 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import type { Callback } from '@/callback.mjs'; +import type { Client } from '../clients/index.mjs'; +import type { RequestConfig } from '@/requestConfig.mjs'; + +export class WorkflowTransitionRules { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition 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 are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [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 getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition + * rules: + * + * - Of one or more transition rule types, such as [workflow post + * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). + * - Matching one or more transition rule keys. + * + * Only workflows containing transition 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 are returned. + * + * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be + * ignored. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * [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 getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async getWorkflowTransitionRuleConfigurations( + parameters: Parameters.GetWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/rule/config', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + types: parameters.types, + keys: parameters.keys, + workflowNames: parameters.workflowNames, + withTags: parameters.withTags, + draft: parameters.draft, + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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. + * + * To assist with app migration, this operation can be used to: + * + * - 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). + * + * 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. + */ + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback: Callback, + ): Promise; + /** + * Updates configuration of workflow transition rules. The following rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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. + * + * To assist with app migration, this operation can be used to: + * + * - 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). + * + * 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. + */ + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async updateWorkflowTransitionRuleConfigurations( + parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/rule/config', + method: 'PUT', + data: { + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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 deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Deletes workflow transition rules from one or more workflows. These rule types are supported: + * + * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) + * - [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 deleted. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can use this operation. + */ + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: never, + ): Promise; + async deleteWorkflowTransitionRuleConfigurations( + parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/rule/config/delete', + method: 'PUT', + data: { + workflows: parameters?.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflowTransitionRules.ts b/src/version3/workflowTransitionRules.ts deleted file mode 100644 index 21d2a8e41d..0000000000 --- a/src/version3/workflowTransitionRules.ts +++ /dev/null @@ -1,189 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { RequestConfig } from '../requestConfig'; - -export class WorkflowTransitionRules { - constructor(private client: Client) {} - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition 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 are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [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 getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * workflows with transition rules. The workflows can be filtered to return only those containing workflow transition - * rules: - * - * - Of one or more transition rule types, such as [workflow post - * functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). - * - Matching one or more transition rule keys. - * - * Only workflows containing transition 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 are returned. - * - * Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be - * ignored. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * [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 getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async getWorkflowTransitionRuleConfigurations( - parameters: Parameters.GetWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/rule/config', - method: 'GET', - params: { - startAt: parameters.startAt, - maxResults: parameters.maxResults, - types: parameters.types, - keys: parameters.keys, - workflowNames: parameters.workflowNames, - withTags: parameters.withTags, - draft: parameters.draft, - expand: parameters.expand, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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. - * - * To assist with app migration, this operation can be used to: - * - * - 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). - * - * 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. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback: Callback, - ): Promise; - /** - * Updates configuration of workflow transition rules. The following rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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. - * - * To assist with app migration, this operation can be used to: - * - * - 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). - * - * 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. - */ - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async updateWorkflowTransitionRuleConfigurations( - parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/rule/config', - method: 'PUT', - data: { - workflows: parameters.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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 deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters: Parameters.DeleteWorkflowTransitionRuleConfigurations | undefined, - callback: Callback, - ): Promise; - /** - * Deletes workflow transition rules from one or more workflows. These rule types are supported: - * - * - [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) - * - [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 deleted. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. - */ - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: never, - ): Promise; - async deleteWorkflowTransitionRuleConfigurations( - parameters?: Parameters.DeleteWorkflowTransitionRuleConfigurations, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/rule/config/delete', - method: 'PUT', - data: { - workflows: parameters?.workflows, - }, - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/src/version3/workflows.mts b/src/version3/workflows.mts new file mode 100644 index 0000000000..82e5957249 --- /dev/null +++ b/src/version3/workflows.mts @@ -0,0 +1,142 @@ +import * as Models from './models/index.mjs'; +import * as Parameters from './parameters/index.mjs'; +import { Callback } from '../callback.mjs'; +import { Client } from '../clients/index.mjs'; +import { paramSerializer } from '../paramSerializer.mjs'; +import { RequestConfig } from '../requestConfig.mjs'; + +export class Workflows { + constructor(private client: Client) {} + + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback: Callback, + ): Promise; + /** + * Creates a workflow. Workflow transitions are created with the default system transition rules. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; + async createWorkflow( + parameters: Parameters.CreateWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow', + method: 'POST', + data: { + name: parameters.name, + description: parameters.description, + transitions: parameters.transitions, + statuses: parameters.statuses, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen 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 getWorkflowsPaginated( + parameters: Parameters.GetWorkflowsPaginated | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, + * all published classic workflows are returned. + * + * This operation does not return next-gen 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 getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: never, + ): Promise; + async getWorkflowsPaginated( + parameters?: Parameters.GetWorkflowsPaginated, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflow/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + workflowName: paramSerializer('workflowName', parameters?.workflowName), + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow 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 deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback: Callback, + ): Promise; + /** + * Deletes a workflow. + * + * The workflow cannot be deleted if it is: + * + * - An active workflow. + * - A system workflow. + * - Associated with any workflow scheme. + * - Associated with any draft workflow 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 deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: never, + ): Promise; + async deleteInactiveWorkflow( + parameters: Parameters.DeleteInactiveWorkflow | string, + callback?: Callback, + ): Promise { + const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; + + const config: RequestConfig = { + url: `/rest/api/3/workflow/${entityId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/workflows.ts b/src/version3/workflows.ts deleted file mode 100644 index d6785fe38c..0000000000 --- a/src/version3/workflows.ts +++ /dev/null @@ -1,142 +0,0 @@ -import * as Models from './models'; -import * as Parameters from './parameters'; -import { Callback } from '../callback'; -import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; -import { RequestConfig } from '../requestConfig'; - -export class Workflows { - constructor(private client: Client) {} - - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback: Callback, - ): Promise; - /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. - * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). - */ - async createWorkflow(parameters: Parameters.CreateWorkflow, callback?: never): Promise; - async createWorkflow( - parameters: Parameters.CreateWorkflow, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow', - method: 'POST', - data: { - name: parameters.name, - description: parameters.description, - transitions: parameters.transitions, - statuses: parameters.statuses, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen 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 getWorkflowsPaginated( - parameters: Parameters.GetWorkflowsPaginated | undefined, - callback: Callback, - ): Promise; - /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, - * all published classic workflows are returned. - * - * This operation does not return next-gen 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 getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: never, - ): Promise; - async getWorkflowsPaginated( - parameters?: Parameters.GetWorkflowsPaginated, - callback?: Callback, - ): Promise { - const config: RequestConfig = { - url: '/rest/api/3/workflow/search', - method: 'GET', - params: { - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - workflowName: paramSerializer('workflowName', parameters?.workflowName), - expand: parameters?.expand, - queryString: parameters?.queryString, - orderBy: parameters?.orderBy, - isActive: parameters?.isActive, - }, - }; - - return this.client.sendRequest(config, callback); - } - - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow 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 deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback: Callback, - ): Promise; - /** - * Deletes a workflow. - * - * The workflow cannot be deleted if it is: - * - * - An active workflow. - * - A system workflow. - * - Associated with any workflow scheme. - * - Associated with any draft workflow 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 deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: never, - ): Promise; - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: Callback, - ): Promise { - const entityId = typeof parameters === 'string' ? parameters : parameters.entityId; - - const config: RequestConfig = { - url: `/rest/api/3/workflow/${entityId}`, - method: 'DELETE', - }; - - return this.client.sendRequest(config, callback); - } -} diff --git a/tests/integration/agile/sprint.test.ts b/tests/integration/agile/sprint.test.mts similarity index 100% rename from tests/integration/agile/sprint.test.ts rename to tests/integration/agile/sprint.test.mts diff --git a/tests/integration/constants.ts b/tests/integration/constants.mts similarity index 100% rename from tests/integration/constants.ts rename to tests/integration/constants.mts diff --git a/tests/integration/index.ts b/tests/integration/index.mts similarity index 100% rename from tests/integration/index.ts rename to tests/integration/index.mts diff --git a/tests/integration/utils/cleanupEnvironment.ts b/tests/integration/utils/cleanupEnvironment.mts similarity index 100% rename from tests/integration/utils/cleanupEnvironment.ts rename to tests/integration/utils/cleanupEnvironment.mts diff --git a/tests/integration/utils/createAgileProject.ts b/tests/integration/utils/createAgileProject.mts similarity index 100% rename from tests/integration/utils/createAgileProject.ts rename to tests/integration/utils/createAgileProject.mts diff --git a/tests/integration/utils/createIssue.ts b/tests/integration/utils/createIssue.mts similarity index 100% rename from tests/integration/utils/createIssue.ts rename to tests/integration/utils/createIssue.mts diff --git a/tests/integration/utils/createSoftwareProject.ts b/tests/integration/utils/createSoftwareProject.mts similarity index 100% rename from tests/integration/utils/createSoftwareProject.ts rename to tests/integration/utils/createSoftwareProject.mts diff --git a/tests/integration/utils/deleteAgileProject.ts b/tests/integration/utils/deleteAgileProject.mts similarity index 100% rename from tests/integration/utils/deleteAgileProject.ts rename to tests/integration/utils/deleteAgileProject.mts diff --git a/tests/integration/utils/deleteSoftwareProject.ts b/tests/integration/utils/deleteSoftwareProject.mts similarity index 100% rename from tests/integration/utils/deleteSoftwareProject.ts rename to tests/integration/utils/deleteSoftwareProject.mts diff --git a/tests/integration/utils/getClient.ts b/tests/integration/utils/getClient.mts similarity index 100% rename from tests/integration/utils/getClient.ts rename to tests/integration/utils/getClient.mts diff --git a/tests/integration/utils/index.ts b/tests/integration/utils/index.mts similarity index 100% rename from tests/integration/utils/index.ts rename to tests/integration/utils/index.mts diff --git a/tests/integration/utils/prepareEnvironment.ts b/tests/integration/utils/prepareEnvironment.mts similarity index 100% rename from tests/integration/utils/prepareEnvironment.ts rename to tests/integration/utils/prepareEnvironment.mts diff --git a/tests/integration/version2/avatars.test.ts b/tests/integration/version2/avatars.test.mts similarity index 100% rename from tests/integration/version2/avatars.test.ts rename to tests/integration/version2/avatars.test.mts diff --git a/tests/integration/version2/dashboards.test.ts b/tests/integration/version2/dashboards.test.mts similarity index 100% rename from tests/integration/version2/dashboards.test.ts rename to tests/integration/version2/dashboards.test.mts diff --git a/tests/integration/version2/groups.test.ts b/tests/integration/version2/groups.test.mts similarity index 100% rename from tests/integration/version2/groups.test.ts rename to tests/integration/version2/groups.test.mts diff --git a/tests/integration/version2/issueAttachments.test.ts b/tests/integration/version2/issueAttachments.test.mts similarity index 100% rename from tests/integration/version2/issueAttachments.test.ts rename to tests/integration/version2/issueAttachments.test.mts diff --git a/tests/integration/version2/issueComments.test.ts b/tests/integration/version2/issueComments.test.mts similarity index 100% rename from tests/integration/version2/issueComments.test.ts rename to tests/integration/version2/issueComments.test.mts diff --git a/tests/integration/version2/issueSearch.test.ts b/tests/integration/version2/issueSearch.test.mts similarity index 100% rename from tests/integration/version2/issueSearch.test.ts rename to tests/integration/version2/issueSearch.test.mts diff --git a/tests/integration/version2/issueVotes.test.ts b/tests/integration/version2/issueVotes.test.mts similarity index 100% rename from tests/integration/version2/issueVotes.test.ts rename to tests/integration/version2/issueVotes.test.mts diff --git a/tests/integration/version2/issues.test.ts b/tests/integration/version2/issues.test.mts similarity index 100% rename from tests/integration/version2/issues.test.ts rename to tests/integration/version2/issues.test.mts diff --git a/tests/integration/version2/projectRoles.test.ts b/tests/integration/version2/projectRoles.test.mts similarity index 100% rename from tests/integration/version2/projectRoles.test.ts rename to tests/integration/version2/projectRoles.test.mts diff --git a/tests/integration/version2/projects.test.ts b/tests/integration/version2/projects.test.mts similarity index 100% rename from tests/integration/version2/projects.test.ts rename to tests/integration/version2/projects.test.mts diff --git a/tests/integration/version3/avatars.test.ts b/tests/integration/version3/avatars.test.mts similarity index 100% rename from tests/integration/version3/avatars.test.ts rename to tests/integration/version3/avatars.test.mts diff --git a/tests/integration/version3/dashboards.test.ts b/tests/integration/version3/dashboards.test.mts similarity index 100% rename from tests/integration/version3/dashboards.test.ts rename to tests/integration/version3/dashboards.test.mts diff --git a/tests/integration/version3/groups.test.ts b/tests/integration/version3/groups.test.mts similarity index 100% rename from tests/integration/version3/groups.test.ts rename to tests/integration/version3/groups.test.mts diff --git a/tests/integration/version3/issueAttachments.test.ts b/tests/integration/version3/issueAttachments.test.mts similarity index 100% rename from tests/integration/version3/issueAttachments.test.ts rename to tests/integration/version3/issueAttachments.test.mts diff --git a/tests/integration/version3/issueComments.test.ts b/tests/integration/version3/issueComments.test.mts similarity index 100% rename from tests/integration/version3/issueComments.test.ts rename to tests/integration/version3/issueComments.test.mts diff --git a/tests/integration/version3/issueSearch.test.ts b/tests/integration/version3/issueSearch.test.mts similarity index 100% rename from tests/integration/version3/issueSearch.test.ts rename to tests/integration/version3/issueSearch.test.mts diff --git a/tests/integration/version3/issueVotes.test.ts b/tests/integration/version3/issueVotes.test.mts similarity index 100% rename from tests/integration/version3/issueVotes.test.ts rename to tests/integration/version3/issueVotes.test.mts diff --git a/tests/integration/version3/issues.test.ts b/tests/integration/version3/issues.test.mts similarity index 100% rename from tests/integration/version3/issues.test.ts rename to tests/integration/version3/issues.test.mts diff --git a/tests/integration/version3/projectRoles.test.ts b/tests/integration/version3/projectRoles.test.mts similarity index 100% rename from tests/integration/version3/projectRoles.test.ts rename to tests/integration/version3/projectRoles.test.mts diff --git a/tests/integration/version3/projects.test.ts b/tests/integration/version3/projects.test.mts similarity index 100% rename from tests/integration/version3/projects.test.ts rename to tests/integration/version3/projects.test.mts diff --git a/tests/unit/agile/board.test.ts b/tests/unit/agile/board.test.mts similarity index 100% rename from tests/unit/agile/board.test.ts rename to tests/unit/agile/board.test.mts diff --git a/tests/unit/agile/client/agileClient.test.mts b/tests/unit/agile/client/agileClient.test.mts new file mode 100644 index 0000000000..36268eb384 --- /dev/null +++ b/tests/unit/agile/client/agileClient.test.mts @@ -0,0 +1,36 @@ +import { describe, it, expect } from 'vitest'; +import { AgileClient } from '@/agile/index.mjs'; +import { Backlog } from '@/agile/backlog.mjs'; +import { Board } from '@/agile/board.mjs'; +import { Builds } from '@/agile/builds.mjs'; +import { Deployments } from '@/agile/deployments.mjs'; +import { DevelopmentInformation } from '@/agile/developmentInformation.mjs'; +import { DevopsComponents } from '@/agile/devopsComponents.mjs'; +import { Epic } from '@/agile/epic.mjs'; +import { FeatureFlags } from '@/agile/featureFlags.mjs'; +import { Issue } from '@/agile/issue.mjs'; +import { Operations } from '@/agile/operations.mjs'; +import { RemoteLinks } from '@/agile/remoteLinks.mjs'; +import { SecurityInformation } from '@/agile/securityInformation.mjs'; +import { Sprint } from '@/agile/sprint.mjs'; + +describe('AgileClient', () => { + it('should have all required properties instantiated', () => { + const client = new AgileClient({ host: 'http://localhost:3000' }); + + // Verify each property exists and is an instance of the correct class + expect(client.backlog).toBeInstanceOf(Backlog); + expect(client.board).toBeInstanceOf(Board); + expect(client.builds).toBeInstanceOf(Builds); + expect(client.deployments).toBeInstanceOf(Deployments); + expect(client.developmentInformation).toBeInstanceOf(DevelopmentInformation); + expect(client.devopsComponents).toBeInstanceOf(DevopsComponents); + expect(client.epic).toBeInstanceOf(Epic); + expect(client.featureFlags).toBeInstanceOf(FeatureFlags); + expect(client.issue).toBeInstanceOf(Issue); + expect(client.operations).toBeInstanceOf(Operations); + expect(client.remoteLinks).toBeInstanceOf(RemoteLinks); + expect(client.securityInformation).toBeInstanceOf(SecurityInformation); + expect(client.sprint).toBeInstanceOf(Sprint); + }); +}); diff --git a/tests/unit/agile/issue.test.ts b/tests/unit/agile/issue.test.mts similarity index 100% rename from tests/unit/agile/issue.test.ts rename to tests/unit/agile/issue.test.mts diff --git a/tests/unit/agile/sprint.test.ts b/tests/unit/agile/sprint.test.mts similarity index 100% rename from tests/unit/agile/sprint.test.ts rename to tests/unit/agile/sprint.test.mts diff --git a/tests/unit/clients/baseClient.test.ts b/tests/unit/clients/baseClient.test.mts similarity index 100% rename from tests/unit/clients/baseClient.test.ts rename to tests/unit/clients/baseClient.test.mts diff --git a/tests/unit/createClient.test.ts b/tests/unit/createClient.test.ts deleted file mode 100644 index 802189eae0..0000000000 --- a/tests/unit/createClient.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { test } from 'vitest'; -import { - AgileClient, - BaseClient, - ClientType, - createClient, - Version2Client, - Version3Client, -} from '@jirajs'; - -const defaultConfig = { host: 'http://localhost' }; - -test('should create Agile client', ({ expect }) => { - const client = createClient(ClientType.Agile, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof AgileClient).toBeTruthy(); -}); - -test('should create Version 2 client', ({ expect }) => { - const client = createClient(ClientType.Version2, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof Version2Client).toBeTruthy(); -}); - -test('should create Version 3 client', ({ expect }) => { - const client = createClient(ClientType.Version3, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof Version3Client).toBeTruthy(); -}); - -test('should create ServiceDesk client', ({ expect }) => { - const client = createClient(ClientType.Version2, defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof Version2Client).toBeTruthy(); -}); - -test('should create Base client', ({ expect }) => { - // @ts-ignore - const client = createClient('baseClient', defaultConfig); - - expect(!!client).toBeTruthy(); - expect(client instanceof BaseClient).toBeTruthy(); -}); diff --git a/tests/unit/index.test.mts b/tests/unit/index.test.mts new file mode 100644 index 0000000000..f1050df9ca --- /dev/null +++ b/tests/unit/index.test.mts @@ -0,0 +1,41 @@ +import { test } from 'vitest'; +import { + AgileClient, + ServiceDeskClient, + Version2Client, + Version3Client, + type Callback, + type Config, +} from '@/index.mjs'; + +test('Callback should be defined', ({ expect }) => { + const callback: Callback = () => {}; + + expect(!!callback).toBeTruthy(); +}); + +test('Config should be defined', ({ expect }) => { + const config: Config = { + host: 'http://localhost', + }; + + expect(!!config).toBeTruthy(); + expect(!!config.host).toBeTruthy(); + expect(typeof config.host).toBe('string'); +}); + +test('Agile client should be defined', ({ expect }) => { + expect(!!AgileClient).toBeTruthy(); +}); + +test('Version2 client should be defined', ({ expect }) => { + expect(!!Version2Client).toBeTruthy(); +}); + +test('Version3 client should be defined', ({ expect }) => { + expect(!!Version3Client).toBeTruthy(); +}); + +test('ServiceDesk client should be defined', ({ expect }) => { + expect(!!ServiceDeskClient).toBeTruthy(); +}); diff --git a/tests/unit/index.test.ts b/tests/unit/index.test.ts deleted file mode 100644 index 8ea9c38d52..0000000000 --- a/tests/unit/index.test.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { test } from 'vitest'; -import { - AgileClient, - AgileModels, - AgileParameters, - ServiceDeskClient, - ServiceDeskModels, - ServiceDeskParameters, - Version2Client, - Version2Models, - Version2Parameters, - Version3Client, - Version3Models, - Version3Parameters, - type Callback, - type Config, -} from '@jirajs'; - -test('Callback should be defined', ({ expect }) => { - const callback: Callback = () => {}; - - expect(!!callback).toBeTruthy(); -}); - -test('Config should be defined', ({ expect }) => { - const config: Config = { - host: 'http://localhost', - }; - - expect(!!config).toBeTruthy(); - expect(!!config.host).toBeTruthy(); - expect(typeof config.host).toBe('string'); -}); - -test('Agile client should be defined', ({ expect }) => { - expect(!!AgileClient).toBeTruthy(); -}); - -test('Agile models should be defined', ({ expect }) => { - expect(!!AgileModels).toBeTruthy(); -}); - -test('Agile parameters should be defined', ({ expect }) => { - expect(!!AgileParameters).toBeTruthy(); -}); - -test('Version2 client should be defined', ({ expect }) => { - expect(!!Version2Client).toBeTruthy(); -}); - -test('Version2 models should be defined', ({ expect }) => { - expect(!!Version2Models).toBeTruthy(); -}); - -test('Version2 parameters should be defined', ({ expect }) => { - expect(!!Version2Parameters).toBeTruthy(); -}); - -test('Version3 client should be defined', ({ expect }) => { - expect(!!Version3Client).toBeTruthy(); -}); - -test('Version3 models should be defined', ({ expect }) => { - expect(!!Version3Models).toBeTruthy(); -}); - -test('Version3 parameters should be defined', ({ expect }) => { - expect(!!Version3Parameters).toBeTruthy(); -}); - -test('ServiceDesk client should be defined', ({ expect }) => { - expect(!!ServiceDeskClient).toBeTruthy(); -}); - -test('ServiceDesk models should be defined', ({ expect }) => { - expect(!!ServiceDeskModels).toBeTruthy(); -}); - -test('ServiceDesk parameters should be defined', ({ expect }) => { - expect(!!ServiceDeskParameters).toBeTruthy(); -}); diff --git a/tests/unit/serviceDesk/client/serviceDeskClient.test.mts b/tests/unit/serviceDesk/client/serviceDeskClient.test.mts new file mode 100644 index 0000000000..35391e81a6 --- /dev/null +++ b/tests/unit/serviceDesk/client/serviceDeskClient.test.mts @@ -0,0 +1,26 @@ +import { describe, it, expect } from 'vitest'; +import { ServiceDeskClient } from '@/serviceDesk/index.mjs'; +import { Customer } from '@/serviceDesk/customer.mjs'; +import { Info } from '@/serviceDesk/info.mjs'; +import { Insight } from '@/serviceDesk/insight.mjs'; +import { KnowledgeBase } from '@/serviceDesk/knowledgeBase.mjs'; +import { Organization } from '@/serviceDesk/organization.mjs'; +import { Request } from '@/serviceDesk/request.mjs'; +import { RequestType } from '@/serviceDesk/requestType.mjs'; +import { ServiceDesk } from '@/serviceDesk/serviceDesk.mjs'; + +describe('ServiceDeskClient', () => { + it('should have all required properties instantiated', () => { + const client = new ServiceDeskClient({ host: 'http://localhost:3000' }); + + // Verify each property exists and is an instance of the correct class + expect(client.customer).toBeInstanceOf(Customer); + expect(client.info).toBeInstanceOf(Info); + expect(client.insights).toBeInstanceOf(Insight); + expect(client.knowledgeBase).toBeInstanceOf(KnowledgeBase); + expect(client.organization).toBeInstanceOf(Organization); + expect(client.request).toBeInstanceOf(Request); + expect(client.requestType).toBeInstanceOf(RequestType); + expect(client.serviceDesk).toBeInstanceOf(ServiceDesk); + }); +}); diff --git a/tests/unit/services/authenticationService.test.ts b/tests/unit/services/authenticationService.test.mts similarity index 100% rename from tests/unit/services/authenticationService.test.ts rename to tests/unit/services/authenticationService.test.mts diff --git a/tests/unit/version2/appMigration.test.ts b/tests/unit/version2/appMigration.test.mts similarity index 100% rename from tests/unit/version2/appMigration.test.ts rename to tests/unit/version2/appMigration.test.mts diff --git a/tests/unit/version2/client/version2Client.test.mts b/tests/unit/version2/client/version2Client.test.mts new file mode 100644 index 0000000000..20a0663690 --- /dev/null +++ b/tests/unit/version2/client/version2Client.test.mts @@ -0,0 +1,179 @@ +import { describe, it, expect } from 'vitest'; +import { Version2Client } from '@/version2/index.mjs'; +import { AnnouncementBanner } from '@/version2/announcementBanner.mjs'; +import { ApplicationRoles } from '@/version2/applicationRoles.mjs'; +import { AppMigration } from '@/version2/appMigration.mjs'; +import { AppProperties } from '@/version2/appProperties.mjs'; +import { AuditRecords } from '@/version2/auditRecords.mjs'; +import { Avatars } from '@/version2/avatars.mjs'; +import { Dashboards } from '@/version2/dashboards.mjs'; +import { DynamicModules } from '@/version2/dynamicModules.mjs'; +import { Filters } from '@/version2/filters.mjs'; +import { FilterSharing } from '@/version2/filterSharing.mjs'; +import { GroupAndUserPicker } from '@/version2/groupAndUserPicker.mjs'; +import { Groups } from '@/version2/groups.mjs'; +import { IssueAttachments } from '@/version2/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version2/issueCommentProperties.mjs'; +import { IssueComments } from '@/version2/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version2/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version2/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version2/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version2/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version2/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version2/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version2/issueFields.mjs'; +import { IssueLinks } from '@/version2/issueLinks.mjs'; +import { IssueLinkTypes } from '@/version2/issueLinkTypes.mjs'; +import { IssueNavigatorSettings } from '@/version2/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version2/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version2/issuePriorities.mjs'; +import { IssueProperties } from '@/version2/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version2/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version2/issueResolutions.mjs'; +import { Issues } from '@/version2/issues.mjs'; +import { IssueSearch } from '@/version2/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version2/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version2/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version2/issueTypeProperties.mjs'; +import { IssueTypes } from '@/version2/issueTypes.mjs'; +import { IssueTypeSchemes } from '@/version2/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version2/issueTypeScreenSchemes.mjs'; +import { IssueVotes } from '@/version2/issueVotes.mjs'; +import { IssueWatchers } from '@/version2/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version2/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version2/issueWorklogs.mjs'; +import { JiraExpressions } from '@/version2/jiraExpressions.mjs'; +import { JiraSettings } from '@/version2/jiraSettings.mjs'; +import { JQL } from '@/version2/jql.mjs'; +import { JqlFunctionsApps } from '@/version2/jqlFunctionsApps.mjs'; +import { Labels } from '@/version2/labels.mjs'; +import { LicenseMetrics } from '@/version2/licenseMetrics.mjs'; +import { Myself } from '@/version2/myself.mjs'; +import { Permissions } from '@/version2/permissions.mjs'; +import { PermissionSchemes } from '@/version2/permissionSchemes.mjs'; +import { ProjectAvatars } from '@/version2/projectAvatars.mjs'; +import { ProjectCategories } from '@/version2/projectCategories.mjs'; +import { ProjectComponents } from '@/version2/projectComponents.mjs'; +import { ProjectEmail } from '@/version2/projectEmail.mjs'; +import { ProjectFeatures } from '@/version2/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version2/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version2/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version2/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version2/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version2/projectRoles.mjs'; +import { Projects } from '@/version2/projects.mjs'; +import { ProjectTypes } from '@/version2/projectTypes.mjs'; +import { ProjectVersions } from '@/version2/projectVersions.mjs'; +import { Screens } from '@/version2/screens.mjs'; +import { ScreenSchemes } from '@/version2/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version2/screenTabFields.mjs'; +import { ScreenTabs } from '@/version2/screenTabs.mjs'; +import { ServerInfo } from '@/version2/serverInfo.mjs'; +import { Status } from '@/version2/status.mjs'; +import { Tasks } from '@/version2/tasks.mjs'; +import { TimeTracking } from '@/version2/timeTracking.mjs'; +import { UiModificationsApps } from '@/version2/uiModificationsApps.mjs'; +import { UserProperties } from '@/version2/userProperties.mjs'; +import { Users } from '@/version2/users.mjs'; +import { UserSearch } from '@/version2/userSearch.mjs'; +import { Webhooks } from '@/version2/webhooks.mjs'; +import { Workflows } from '@/version2/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version2/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version2/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version2/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version2/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version2/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version2/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version2/workflowTransitionRules.mjs'; + +describe('Version2Client', () => { + it('should have all required properties instantiated', () => { + const client = new Version2Client({ host: 'http://localhost:3000' }); + + expect(client.announcementBanner).toBeInstanceOf(AnnouncementBanner); + 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.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.issueAttachments).toBeInstanceOf(IssueAttachments); + 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.projectAvatars).toBeInstanceOf(ProjectAvatars); + expect(client.projectCategories).toBeInstanceOf(ProjectCategories); + 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.status).toBeInstanceOf(Status); + expect(client.tasks).toBeInstanceOf(Tasks); + 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/version2/issueComments.test.ts b/tests/unit/version2/issueComments.test.mts similarity index 100% rename from tests/unit/version2/issueComments.test.ts rename to tests/unit/version2/issueComments.test.mts diff --git a/tests/unit/version2/issueFields.test.ts b/tests/unit/version2/issueFields.test.mts similarity index 100% rename from tests/unit/version2/issueFields.test.ts rename to tests/unit/version2/issueFields.test.mts diff --git a/tests/unit/version2/issueLinks.test.ts b/tests/unit/version2/issueLinks.test.mts similarity index 100% rename from tests/unit/version2/issueLinks.test.ts rename to tests/unit/version2/issueLinks.test.mts diff --git a/tests/unit/version2/issuePriorities.test.ts b/tests/unit/version2/issuePriorities.test.mts similarity index 100% rename from tests/unit/version2/issuePriorities.test.ts rename to tests/unit/version2/issuePriorities.test.mts diff --git a/tests/unit/version2/issueRemoteLinks.test.ts b/tests/unit/version2/issueRemoteLinks.test.mts similarity index 100% rename from tests/unit/version2/issueRemoteLinks.test.ts rename to tests/unit/version2/issueRemoteLinks.test.mts diff --git a/tests/unit/version2/issueSearch.test.mts b/tests/unit/version2/issueSearch.test.mts new file mode 100644 index 0000000000..484ffd892c --- /dev/null +++ b/tests/unit/version2/issueSearch.test.mts @@ -0,0 +1,69 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueSearch, Version2Client } from '@jirajs/version2'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!IssueSearch).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql({ + 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({ + expand: undefined, + fields: ['key', 'summary'], + fieldsByKeys: undefined, + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); + +test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlPost({ + jql: 'test Jql', + expand: ['changelog'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + expand: ['changelog'], + fields: undefined, + fieldsByKeys: undefined, + jql: 'test Jql', + maxResults: undefined, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); diff --git a/tests/unit/version2/issueSearch.test.ts b/tests/unit/version2/issueSearch.test.ts deleted file mode 100644 index 06079ad878..0000000000 --- a/tests/unit/version2/issueSearch.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueSearch, Version2Client } from '@jirajs/version2'; - -const config = { host: 'http://localhost' }; - -test('should be defined', ({ expect }) => { - expect(!!IssueSearch).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql({ - 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({ - expand: undefined, - fields: ['key', 'summary'], - fieldsByKeys: undefined, - jql: 'id IN (TICKET_ID) ORDER BY key ASC', - maxResults: 10, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); - -test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { - const client = new Version2Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJqlPost({ - jql: 'test JQL', - expand: ['changelog'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - expand: ['changelog'], - fields: undefined, - fieldsByKeys: undefined, - jql: 'test JQL', - maxResults: undefined, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); diff --git a/tests/unit/version2/issueVotes.test.ts b/tests/unit/version2/issueVotes.test.mts similarity index 100% rename from tests/unit/version2/issueVotes.test.ts rename to tests/unit/version2/issueVotes.test.mts diff --git a/tests/unit/version2/issueWatcher.test.ts b/tests/unit/version2/issueWatcher.test.mts similarity index 100% rename from tests/unit/version2/issueWatcher.test.ts rename to tests/unit/version2/issueWatcher.test.mts diff --git a/tests/unit/version2/issues.test.ts b/tests/unit/version2/issues.test.mts similarity index 100% rename from tests/unit/version2/issues.test.ts rename to tests/unit/version2/issues.test.mts diff --git a/tests/unit/version2/myself.test.ts b/tests/unit/version2/myself.test.mts similarity index 100% rename from tests/unit/version2/myself.test.ts rename to tests/unit/version2/myself.test.mts diff --git a/tests/unit/version2/projectVersions.test.ts b/tests/unit/version2/projectVersions.test.mts similarity index 100% rename from tests/unit/version2/projectVersions.test.ts rename to tests/unit/version2/projectVersions.test.mts diff --git a/tests/unit/version2/workflowStatuses.test.ts b/tests/unit/version2/workflowStatuses.test.mts similarity index 100% rename from tests/unit/version2/workflowStatuses.test.ts rename to tests/unit/version2/workflowStatuses.test.mts diff --git a/tests/unit/version3/appMigration.test.ts b/tests/unit/version3/appMigration.test.mts similarity index 100% rename from tests/unit/version3/appMigration.test.ts rename to tests/unit/version3/appMigration.test.mts diff --git a/tests/unit/version3/client/version3Client.test.mts b/tests/unit/version3/client/version3Client.test.mts new file mode 100644 index 0000000000..8df5feb53a --- /dev/null +++ b/tests/unit/version3/client/version3Client.test.mts @@ -0,0 +1,181 @@ +import { describe, it, expect } from 'vitest'; +import { Version3Client } from '@/version3/index.mjs'; +import { AnnouncementBanner } from '@/version3/announcementBanner.mjs'; +import { AppMigration } from '@/version3/appMigration.mjs'; +import { AppProperties } from '@/version3/appProperties.mjs'; +import { ApplicationRoles } from '@/version3/applicationRoles.mjs'; +import { AuditRecords } from '@/version3/auditRecords.mjs'; +import { Avatars } from '@/version3/avatars.mjs'; +import { Dashboards } from '@/version3/dashboards.mjs'; +import { DynamicModules } from '@/version3/dynamicModules.mjs'; +import { FilterSharing } from '@/version3/filterSharing.mjs'; +import { Filters } from '@/version3/filters.mjs'; +import { GroupAndUserPicker } from '@/version3/groupAndUserPicker.mjs'; +import { Groups } from '@/version3/groups.mjs'; +import { InstanceInformation } from '@/version3/instanceInformation.mjs'; +import { IssueAttachments } from '@/version3/issueAttachments.mjs'; +import { IssueCommentProperties } from '@/version3/issueCommentProperties.mjs'; +import { IssueComments } from '@/version3/issueComments.mjs'; +import { IssueCustomFieldConfigurationApps } from '@/version3/issueCustomFieldConfigurationApps.mjs'; +import { IssueCustomFieldContexts } from '@/version3/issueCustomFieldContexts.mjs'; +import { IssueCustomFieldOptions } from '@/version3/issueCustomFieldOptions.mjs'; +import { IssueCustomFieldOptionsApps } from '@/version3/issueCustomFieldOptionsApps.mjs'; +import { IssueCustomFieldValuesApps } from '@/version3/issueCustomFieldValuesApps.mjs'; +import { IssueFieldConfigurations } from '@/version3/issueFieldConfigurations.mjs'; +import { IssueFields } from '@/version3/issueFields.mjs'; +import { IssueLinks } from '@/version3/issueLinks.mjs'; +import { IssueLinkTypes } from '@/version3/issueLinkTypes.mjs'; +import { IssueNavigatorSettings } from '@/version3/issueNavigatorSettings.mjs'; +import { IssueNotificationSchemes } from '@/version3/issueNotificationSchemes.mjs'; +import { IssuePriorities } from '@/version3/issuePriorities.mjs'; +import { IssueProperties } from '@/version3/issueProperties.mjs'; +import { IssueRemoteLinks } from '@/version3/issueRemoteLinks.mjs'; +import { IssueResolutions } from '@/version3/issueResolutions.mjs'; +import { Issues } from '@/version3/issues.mjs'; +import { IssueSearch } from '@/version3/issueSearch.mjs'; +import { IssueSecurityLevel } from '@/version3/issueSecurityLevel.mjs'; +import { IssueSecuritySchemes } from '@/version3/issueSecuritySchemes.mjs'; +import { IssueTypeProperties } from '@/version3/issueTypeProperties.mjs'; +import { IssueTypes } from '@/version3/issueTypes.mjs'; +import { IssueTypeSchemes } from '@/version3/issueTypeSchemes.mjs'; +import { IssueTypeScreenSchemes } from '@/version3/issueTypeScreenSchemes.mjs'; +import { IssueVotes } from '@/version3/issueVotes.mjs'; +import { IssueWatchers } from '@/version3/issueWatchers.mjs'; +import { IssueWorklogProperties } from '@/version3/issueWorklogProperties.mjs'; +import { IssueWorklogs } from '@/version3/issueWorklogs.mjs'; +import { JiraExpressions } from '@/version3/jiraExpressions.mjs'; +import { JiraSettings } from '@/version3/jiraSettings.mjs'; +import { JQL } from '@/version3/jql.mjs'; +import { JqlFunctionsApps } from '@/version3/jqlFunctionsApps.mjs'; +import { Labels } from '@/version3/labels.mjs'; +import { LicenseMetrics } from '@/version3/licenseMetrics.mjs'; +import { Myself } from '@/version3/myself.mjs'; +import { Permissions } from '@/version3/permissions.mjs'; +import { PermissionSchemes } from '@/version3/permissionSchemes.mjs'; +import { ProjectAvatars } from '@/version3/projectAvatars.mjs'; +import { ProjectCategories } from '@/version3/projectCategories.mjs'; +import { ProjectComponents } from '@/version3/projectComponents.mjs'; +import { ProjectEmail } from '@/version3/projectEmail.mjs'; +import { ProjectFeatures } from '@/version3/projectFeatures.mjs'; +import { ProjectKeyAndNameValidation } from '@/version3/projectKeyAndNameValidation.mjs'; +import { ProjectPermissionSchemes } from '@/version3/projectPermissionSchemes.mjs'; +import { ProjectProperties } from '@/version3/projectProperties.mjs'; +import { ProjectRoleActors } from '@/version3/projectRoleActors.mjs'; +import { ProjectRoles } from '@/version3/projectRoles.mjs'; +import { Projects } from '@/version3/projects.mjs'; +import { ProjectTypes } from '@/version3/projectTypes.mjs'; +import { ProjectVersions } from '@/version3/projectVersions.mjs'; +import { Screens } from '@/version3/screens.mjs'; +import { ScreenSchemes } from '@/version3/screenSchemes.mjs'; +import { ScreenTabFields } from '@/version3/screenTabFields.mjs'; +import { ScreenTabs } from '@/version3/screenTabs.mjs'; +import { ServerInfo } from '@/version3/serverInfo.mjs'; +import { Status } from '@/version3/status.mjs'; +import { Tasks } from '@/version3/tasks.mjs'; +import { TimeTracking } from '@/version3/timeTracking.mjs'; +import { UiModificationsApps } from '@/version3/uiModificationsApps.mjs'; +import { UserProperties } from '@/version3/userProperties.mjs'; +import { UserSearch } from '@/version3/userSearch.mjs'; +import { Users } from '@/version3/users.mjs'; +import { Webhooks } from '@/version3/webhooks.mjs'; +import { Workflows } from '@/version3/workflows.mjs'; +import { WorkflowSchemeDrafts } from '@/version3/workflowSchemeDrafts.mjs'; +import { WorkflowSchemeProjectAssociations } from '@/version3/workflowSchemeProjectAssociations.mjs'; +import { WorkflowSchemes } from '@/version3/workflowSchemes.mjs'; +import { WorkflowStatusCategories } from '@/version3/workflowStatusCategories.mjs'; +import { WorkflowStatuses } from '@/version3/workflowStatuses.mjs'; +import { WorkflowTransitionProperties } from '@/version3/workflowTransitionProperties.mjs'; +import { WorkflowTransitionRules } from '@/version3/workflowTransitionRules.mjs'; + +describe('Version3Client', () => { + it('should have all required properties instantiated', () => { + const client = new Version3Client({ host: 'http://localhost:3000' }); + + expect(client.announcementBanner).toBeInstanceOf(AnnouncementBanner); + 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.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.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.projectAvatars).toBeInstanceOf(ProjectAvatars); + expect(client.projectCategories).toBeInstanceOf(ProjectCategories); + 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.status).toBeInstanceOf(Status); + expect(client.tasks).toBeInstanceOf(Tasks); + 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/issueComments.test.ts b/tests/unit/version3/issueComments.test.mts similarity index 100% rename from tests/unit/version3/issueComments.test.ts rename to tests/unit/version3/issueComments.test.mts diff --git a/tests/unit/version3/issueFields.test.ts b/tests/unit/version3/issueFields.test.mts similarity index 100% rename from tests/unit/version3/issueFields.test.ts rename to tests/unit/version3/issueFields.test.mts diff --git a/tests/unit/version3/issueLinks.test.ts b/tests/unit/version3/issueLinks.test.mts similarity index 100% rename from tests/unit/version3/issueLinks.test.ts rename to tests/unit/version3/issueLinks.test.mts diff --git a/tests/unit/version3/issuePriorities.test.ts b/tests/unit/version3/issuePriorities.test.mts similarity index 100% rename from tests/unit/version3/issuePriorities.test.ts rename to tests/unit/version3/issuePriorities.test.mts diff --git a/tests/unit/version3/issueRemoteLinks.test.ts b/tests/unit/version3/issueRemoteLinks.test.mts similarity index 100% rename from tests/unit/version3/issueRemoteLinks.test.ts rename to tests/unit/version3/issueRemoteLinks.test.mts diff --git a/tests/unit/version3/issueSearch.test.mts b/tests/unit/version3/issueSearch.test.mts new file mode 100644 index 0000000000..6f6d2b7710 --- /dev/null +++ b/tests/unit/version3/issueSearch.test.mts @@ -0,0 +1,69 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { IssueSearch, Version3Client } from '@jirajs/version3'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!IssueSearch).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql(); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJql({ + 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({ + expand: undefined, + fields: ['key', 'summary'], + fieldsByKeys: undefined, + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); + +test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlPost({ + jql: 'test Jql', + expand: ['changelog'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + expand: ['changelog'], + fields: undefined, + fieldsByKeys: undefined, + jql: 'test Jql', + maxResults: undefined, + properties: undefined, + startAt: undefined, + validateQuery: undefined, + }); +}); diff --git a/tests/unit/version3/issueSearch.test.ts b/tests/unit/version3/issueSearch.test.ts deleted file mode 100644 index 107fc72340..0000000000 --- a/tests/unit/version3/issueSearch.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as sinon from 'sinon'; -import { test } from 'vitest'; -import { IssueSearch, Version3Client } from '@jirajs/version3'; - -const config = { host: 'http://localhost' }; - -test('should be defined', ({ expect }) => { - expect(!!IssueSearch).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql(); - - expect(sendRequestStub.calledOnce).toBeTruthy(); -}); - -test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJql({ - 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({ - expand: undefined, - fields: ['key', 'summary'], - fieldsByKeys: undefined, - jql: 'id IN (TICKET_ID) ORDER BY key ASC', - maxResults: 10, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); - -test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) => { - const client = new Version3Client(config); - const sendRequestStub = sinon.stub(client, 'sendRequest'); - - client.issueSearch.searchForIssuesUsingJqlPost({ - jql: 'test JQL', - expand: ['changelog'], - }); - - expect(sendRequestStub.calledOnce).toBeTruthy(); - - const callArgument = sendRequestStub.getCall(0).args[0]; - - expect(callArgument.data).toStrictEqual({ - expand: ['changelog'], - fields: undefined, - fieldsByKeys: undefined, - jql: 'test JQL', - maxResults: undefined, - properties: undefined, - startAt: undefined, - validateQuery: undefined, - }); -}); diff --git a/tests/unit/version3/issueVotes.test.ts b/tests/unit/version3/issueVotes.test.mts similarity index 100% rename from tests/unit/version3/issueVotes.test.ts rename to tests/unit/version3/issueVotes.test.mts diff --git a/tests/unit/version3/issueWatcher.test.ts b/tests/unit/version3/issueWatcher.test.mts similarity index 100% rename from tests/unit/version3/issueWatcher.test.ts rename to tests/unit/version3/issueWatcher.test.mts diff --git a/tests/unit/version3/issues.test.ts b/tests/unit/version3/issues.test.mts similarity index 100% rename from tests/unit/version3/issues.test.ts rename to tests/unit/version3/issues.test.mts diff --git a/tests/unit/version3/myself.test.ts b/tests/unit/version3/myself.test.mts similarity index 100% rename from tests/unit/version3/myself.test.ts rename to tests/unit/version3/myself.test.mts diff --git a/tests/unit/version3/projectVersions.test.ts b/tests/unit/version3/projectVersions.test.mts similarity index 100% rename from tests/unit/version3/projectVersions.test.ts rename to tests/unit/version3/projectVersions.test.mts diff --git a/tests/unit/version3/workflowStatuses.test.ts b/tests/unit/version3/workflowStatuses.test.mts similarity index 100% rename from tests/unit/version3/workflowStatuses.test.ts rename to tests/unit/version3/workflowStatuses.test.mts diff --git a/tsconfig.json b/tsconfig.json index 83c96b0709..85275fa001 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,23 @@ { "compilerOptions": { - "target": "ES6", - "outDir": "out", - "module": "CommonJS", - "lib": [ - "ES2018", - "DOM" - ], + "target": "ES2022", + "outDir": "dist", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM"], "baseUrl": ".", "paths": { - "@jirajs": ["src"], - "@jirajs/*": ["src/*"], + "@": ["src"], + "@/*": ["src/*"], + "@jirajs": ["src"], // todo remove + "@jirajs/*": ["src/*"], // todo remove "@tests": ["tests"], "@tests/*": ["tests/*"] }, "declaration": true, "importHelpers": true, "strict": true, - "sourceMap": true, + "skipLibCheck": true, "forceConsistentCasingInFileNames": true }, "include": [ @@ -27,7 +27,7 @@ "node_modules", "coverage", "docs", - "out", + "dist", "example" ] } diff --git a/vitest.config.mts b/vitest.config.mts index 3d8f3167d9..f3d4513f8c 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -9,6 +9,14 @@ export default defineConfig({ tsconfig: 'tsconfig.lint.json', }, setupFiles: ['dotenv/config'], + coverage: { + provider: 'v8', + reporter: ['text', 'json', 'html'], + reportsDirectory: './coverage', + all: true, + include: ['src/**/*.mts'], + exclude: ['node_modules', 'test/**/*.mts'], + }, }, resolve: { alias: {